Move entirety of llvm namespace to wpi namespace.

During shared library loading, a different libLLVM can be pulled in, causing
llvm symbols from dependent libraries to resolve to that library instead of
this one. This has been seen in the wild with the Mesa OpenGL implementation
in JavaFX applications (see wpilibsuite/shuffleboard#361).

This is clearly a very breaking change. For some level of backwards
compatibility, a namespace alias from llvm to wpi is performed in the "llvm"
headers.  Unfortunately, forward declarations of llvm classes will still break,
but compilers seem to generate clear error messages in those cases
("namespace alias 'llvm' not allowed here, assuming 'wpi'").

This change also moves all the wpiutil headers to a single "wpi" subdirectory
from the previously split "llvm", "support", "tcpsockets", and "udpsockets".
Shim headers will be added for backwards compatibility in a later commit.
This commit is contained in:
Peter Johnson
2018-04-29 23:33:19 -07:00
parent 93859eb84f
commit f84018af5f
377 changed files with 2747 additions and 2742 deletions

View File

@@ -14,10 +14,10 @@
#include <thread>
#include <HAL/DriverStation.h>
#include <llvm/Twine.h>
#include <support/condition_variable.h>
#include <support/deprecated.h>
#include <support/mutex.h>
#include <wpi/Twine.h>
#include <wpi/condition_variable.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>
#include "ErrorBase.h"
#include "RobotState.h"
@@ -38,11 +38,11 @@ class DriverStation : public ErrorBase, public RobotStateInterface {
~DriverStation() override;
static DriverStation& GetInstance();
static void ReportError(const llvm::Twine& error);
static void ReportWarning(const llvm::Twine& error);
static void ReportError(bool isError, int code, const llvm::Twine& error,
const llvm::Twine& location,
const llvm::Twine& stack);
static void ReportError(const wpi::Twine& error);
static void ReportWarning(const wpi::Twine& error);
static void ReportError(bool isError, int code, const wpi::Twine& error,
const wpi::Twine& location,
const wpi::Twine& stack);
static constexpr int kJoystickPorts = 6;
@@ -130,8 +130,8 @@ class DriverStation : public ErrorBase, public RobotStateInterface {
private:
DriverStation();
void ReportJoystickUnpluggedError(const llvm::Twine& message);
void ReportJoystickUnpluggedWarning(const llvm::Twine& message);
void ReportJoystickUnpluggedError(const wpi::Twine& message);
void ReportJoystickUnpluggedWarning(const wpi::Twine& message);
void Run();
void UpdateControlWord(bool force, HAL_ControlWord& controlWord) const;
void SendMatchData();