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,7 +14,7 @@
#include <memory>
#include <support/mutex.h>
#include <wpi/mutex.h>
#include "PropertyImpl.h"
@@ -24,10 +24,10 @@ namespace cs {
class UsbCameraProperty : public PropertyImpl {
public:
UsbCameraProperty() = default;
explicit UsbCameraProperty(llvm::StringRef name_) : PropertyImpl{name_} {}
explicit UsbCameraProperty(wpi::StringRef name_) : PropertyImpl{name_} {}
// Normalized property constructor
UsbCameraProperty(llvm::StringRef name_, int rawIndex_,
UsbCameraProperty(wpi::StringRef name_, int rawIndex_,
const UsbCameraProperty& rawProp, int defaultValue_,
int value_)
: PropertyImpl(name_, rawProp.propKind, 1, defaultValue_, value_),
@@ -52,7 +52,7 @@ class UsbCameraProperty : public PropertyImpl {
bool DeviceGet(std::unique_lock<wpi::mutex>& lock, int fd);
bool DeviceSet(std::unique_lock<wpi::mutex>& lock, int fd) const;
bool DeviceSet(std::unique_lock<wpi::mutex>& lock, int fd, int newValue,
llvm::StringRef newValueStr) const;
wpi::StringRef newValueStr) const;
#endif
// If this is a percentage (rather than raw) property