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

@@ -9,8 +9,8 @@
#include <memory>
#include <llvm/Twine.h>
#include <support/deprecated.h>
#include <wpi/Twine.h>
#include <wpi/deprecated.h>
#include "SmartDashboard/Sendable.h"
@@ -31,30 +31,30 @@ class LiveWindow {
void Run() { UpdateValues(); }
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddSensor(const llvm::Twine& subsystem, const llvm::Twine& name,
void AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable* component);
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddSensor(const llvm::Twine& subsystem, const llvm::Twine& name,
void AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable& component);
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddSensor(const llvm::Twine& subsystem, const llvm::Twine& name,
void AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
std::shared_ptr<Sendable> component);
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddActuator(const llvm::Twine& subsystem, const llvm::Twine& name,
void AddActuator(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable* component);
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddActuator(const llvm::Twine& subsystem, const llvm::Twine& name,
void AddActuator(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable& component);
WPI_DEPRECATED("use Sendable::SetName() instead")
void AddActuator(const llvm::Twine& subsystem, const llvm::Twine& name,
void AddActuator(const wpi::Twine& subsystem, const wpi::Twine& name,
std::shared_ptr<Sendable> component);
WPI_DEPRECATED("use SensorBase::SetName() instead")
void AddSensor(const llvm::Twine& type, int channel, Sendable* component);
void AddSensor(const wpi::Twine& type, int channel, Sendable* component);
WPI_DEPRECATED("use SensorBase::SetName() instead")
void AddActuator(const llvm::Twine& type, int channel, Sendable* component);
void AddActuator(const wpi::Twine& type, int channel, Sendable* component);
WPI_DEPRECATED("use SensorBase::SetName() instead")
void AddActuator(const llvm::Twine& type, int module, int channel,
void AddActuator(const wpi::Twine& type, int module, int channel,
Sendable* component);
void Add(std::shared_ptr<Sendable> component);

View File

@@ -9,7 +9,7 @@
#include <string>
#include <support/deprecated.h>
#include <wpi/deprecated.h>
#include "SmartDashboard/Sendable.h"
@@ -39,9 +39,9 @@ class WPI_DEPRECATED("use Sendable directly instead") LiveWindowSendable
virtual void StopLiveWindowMode() = 0;
std::string GetName() const override;
void SetName(const llvm::Twine& name) override;
void SetName(const wpi::Twine& name) override;
std::string GetSubsystem() const override;
void SetSubsystem(const llvm::Twine& subsystem) override;
void SetSubsystem(const wpi::Twine& subsystem) override;
void InitSendable(SendableBuilder& builder) override;
};