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,10 +9,10 @@
#include <CameraServer.h>
#include <IterativeRobot.h>
#include <llvm/raw_ostream.h>
#include <opencv2/core/core.hpp>
#include <opencv2/core/types.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <wpi/raw_ostream.h>
/**
* This is a demo program showing the use of OpenCV to do vision processing. The
@@ -69,8 +69,8 @@ private:
std::thread visionThread(VisionThread);
visionThread.detach();
#else
llvm::errs() << "Vision only available on Linux.\n";
llvm::errs().flush();
wpi::errs() << "Vision only available on Linux.\n";
wpi::errs().flush();
#endif
}
};

View File

@@ -7,7 +7,7 @@
#include <CameraServer.h>
#include <IterativeRobot.h>
#include <llvm/raw_ostream.h>
#include <wpi/raw_ostream.h>
/**
* Uses the CameraServer class to automatically capture video from a USB webcam
@@ -22,8 +22,8 @@ public:
#if defined(__linux__)
CameraServer::GetInstance()->StartAutomaticCapture();
#else
llvm::errs() << "Vision only available on Linux.\n";
llvm::errs().flush();
wpi::errs() << "Vision only available on Linux.\n";
wpi::errs().flush();
#endif
}
};