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

@@ -20,14 +20,14 @@ namespace cs {
class CvSourceImpl : public SourceImpl {
public:
CvSourceImpl(llvm::StringRef name, const VideoMode& mode);
CvSourceImpl(wpi::StringRef name, const VideoMode& mode);
~CvSourceImpl() override;
void Start();
// Property functions
void SetProperty(int property, int value, CS_Status* status) override;
void SetStringProperty(int property, llvm::StringRef value,
void SetStringProperty(int property, wpi::StringRef value,
CS_Status* status) override;
// Standard common camera properties
@@ -47,21 +47,21 @@ class CvSourceImpl : public SourceImpl {
// OpenCV-specific functions
void PutFrame(cv::Mat& image);
void NotifyError(llvm::StringRef msg);
int CreateProperty(llvm::StringRef name, CS_PropertyKind kind, int minimum,
void NotifyError(wpi::StringRef msg);
int CreateProperty(wpi::StringRef name, CS_PropertyKind kind, int minimum,
int maximum, int step, int defaultValue, int value);
int CreateProperty(llvm::StringRef name, CS_PropertyKind kind, int minimum,
int CreateProperty(wpi::StringRef name, CS_PropertyKind kind, int minimum,
int maximum, int step, int defaultValue, int value,
std::function<void(CS_Property property)> onChange);
void SetEnumPropertyChoices(int property, llvm::ArrayRef<std::string> choices,
void SetEnumPropertyChoices(int property, wpi::ArrayRef<std::string> choices,
CS_Status* status);
// Property data
class PropertyData : public PropertyImpl {
public:
PropertyData() = default;
explicit PropertyData(llvm::StringRef name_) : PropertyImpl{name_} {}
PropertyData(llvm::StringRef name_, CS_PropertyKind kind_, int minimum_,
explicit PropertyData(wpi::StringRef name_) : PropertyImpl{name_} {}
PropertyData(wpi::StringRef name_, CS_PropertyKind kind_, int minimum_,
int maximum_, int step_, int defaultValue_, int value_)
: PropertyImpl{name_, kind_, step_, defaultValue_, value_} {
hasMinimum = true;
@@ -76,7 +76,7 @@ class CvSourceImpl : public SourceImpl {
protected:
std::unique_ptr<PropertyImpl> CreateEmptyProperty(
llvm::StringRef name) const override;
wpi::StringRef name) const override;
bool CacheProperties(CS_Status* status) const override;