mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
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:
@@ -9,20 +9,20 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <llvm/DenseMap.h>
|
||||
#include <llvm/SmallString.h>
|
||||
#include <llvm/raw_ostream.h>
|
||||
#include <networktables/NetworkTable.h>
|
||||
#include <networktables/NetworkTableEntry.h>
|
||||
#include <networktables/NetworkTableInstance.h>
|
||||
#include <support/mutex.h>
|
||||
#include <wpi/DenseMap.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/mutex.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "Commands/Scheduler.h"
|
||||
#include "SmartDashboard/SendableBuilderImpl.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
using llvm::Twine;
|
||||
using wpi::Twine;
|
||||
|
||||
struct LiveWindow::Impl {
|
||||
Impl();
|
||||
@@ -37,7 +37,7 @@ struct LiveWindow::Impl {
|
||||
|
||||
wpi::mutex mutex;
|
||||
|
||||
llvm::DenseMap<void*, Component> components;
|
||||
wpi::DenseMap<void*, Component> components;
|
||||
|
||||
std::shared_ptr<nt::NetworkTable> liveWindowTable;
|
||||
std::shared_ptr<nt::NetworkTable> statusTable;
|
||||
@@ -115,8 +115,8 @@ void LiveWindow::SetEnabled(bool enabled) {
|
||||
* @brief Use a STL smart pointer to share ownership of component.
|
||||
* @deprecated Use Sendable::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddSensor(const llvm::Twine& subsystem,
|
||||
const llvm::Twine& name,
|
||||
void LiveWindow::AddSensor(const wpi::Twine& subsystem,
|
||||
const wpi::Twine& name,
|
||||
std::shared_ptr<Sendable> component) {
|
||||
Add(component);
|
||||
component->SetName(subsystem, name);
|
||||
@@ -126,8 +126,8 @@ void LiveWindow::AddSensor(const llvm::Twine& subsystem,
|
||||
* @brief Pass a reference to LiveWindow and retain ownership of the component.
|
||||
* @deprecated Use Sendable::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddSensor(const llvm::Twine& subsystem,
|
||||
const llvm::Twine& name, Sendable& component) {
|
||||
void LiveWindow::AddSensor(const wpi::Twine& subsystem,
|
||||
const wpi::Twine& name, Sendable& component) {
|
||||
Add(&component);
|
||||
component.SetName(subsystem, name);
|
||||
}
|
||||
@@ -136,8 +136,8 @@ void LiveWindow::AddSensor(const llvm::Twine& subsystem,
|
||||
* @brief Use a raw pointer to the LiveWindow.
|
||||
* @deprecated Use Sendable::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddSensor(const llvm::Twine& subsystem,
|
||||
const llvm::Twine& name, Sendable* component) {
|
||||
void LiveWindow::AddSensor(const wpi::Twine& subsystem,
|
||||
const wpi::Twine& name, Sendable* component) {
|
||||
Add(component);
|
||||
component->SetName(subsystem, name);
|
||||
}
|
||||
@@ -157,8 +157,8 @@ void LiveWindow::AddSensor(const llvm::Twine& subsystem,
|
||||
/**
|
||||
* @brief Use a STL smart pointer to share ownership of component.
|
||||
*/
|
||||
void LiveWindow::AddActuator(const llvm::Twine& subsystem,
|
||||
const llvm::Twine& name,
|
||||
void LiveWindow::AddActuator(const wpi::Twine& subsystem,
|
||||
const wpi::Twine& name,
|
||||
std::shared_ptr<Sendable> component) {
|
||||
Add(component);
|
||||
component->SetName(subsystem, name);
|
||||
@@ -168,8 +168,8 @@ void LiveWindow::AddActuator(const llvm::Twine& subsystem,
|
||||
* @brief Pass a reference to LiveWindow and retain ownership of the component.
|
||||
* @deprecated Use Sendable::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddActuator(const llvm::Twine& subsystem,
|
||||
const llvm::Twine& name, Sendable& component) {
|
||||
void LiveWindow::AddActuator(const wpi::Twine& subsystem,
|
||||
const wpi::Twine& name, Sendable& component) {
|
||||
Add(&component);
|
||||
component.SetName(subsystem, name);
|
||||
}
|
||||
@@ -178,8 +178,8 @@ void LiveWindow::AddActuator(const llvm::Twine& subsystem,
|
||||
* @brief Use a raw pointer to the LiveWindow.
|
||||
* @deprecated Use Sendable::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddActuator(const llvm::Twine& subsystem,
|
||||
const llvm::Twine& name, Sendable* component) {
|
||||
void LiveWindow::AddActuator(const wpi::Twine& subsystem,
|
||||
const wpi::Twine& name, Sendable* component) {
|
||||
Add(component);
|
||||
component->SetName(subsystem, name);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void LiveWindow::AddActuator(const llvm::Twine& subsystem,
|
||||
* Meant for internal use in other WPILib classes.
|
||||
* @deprecated Use SensorBase::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddSensor(const llvm::Twine& type, int channel,
|
||||
void LiveWindow::AddSensor(const wpi::Twine& type, int channel,
|
||||
Sendable* component) {
|
||||
Add(component);
|
||||
component->SetName("Ungrouped",
|
||||
@@ -200,7 +200,7 @@ void LiveWindow::AddSensor(const llvm::Twine& type, int channel,
|
||||
* Meant for internal use in other WPILib classes.
|
||||
* @deprecated Use SensorBase::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddActuator(const llvm::Twine& type, int channel,
|
||||
void LiveWindow::AddActuator(const wpi::Twine& type, int channel,
|
||||
Sendable* component) {
|
||||
Add(component);
|
||||
component->SetName("Ungrouped",
|
||||
@@ -211,7 +211,7 @@ void LiveWindow::AddActuator(const llvm::Twine& type, int channel,
|
||||
* Meant for internal use in other WPILib classes.
|
||||
* @deprecated Use SensorBase::SetName() instead.
|
||||
*/
|
||||
void LiveWindow::AddActuator(const llvm::Twine& type, int module, int channel,
|
||||
void LiveWindow::AddActuator(const wpi::Twine& type, int module, int channel,
|
||||
Sendable* component) {
|
||||
Add(component);
|
||||
component->SetName("Ungrouped", type + Twine('[') + Twine(module) +
|
||||
|
||||
Reference in New Issue
Block a user