mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +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:
@@ -11,7 +11,7 @@
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "ErrorBase.h"
|
||||
#include "SmartDashboard/SendableBase.h"
|
||||
@@ -51,9 +51,9 @@ class Command : public ErrorBase, public SendableBase {
|
||||
|
||||
public:
|
||||
Command();
|
||||
explicit Command(const llvm::Twine& name);
|
||||
explicit Command(const wpi::Twine& name);
|
||||
explicit Command(double timeout);
|
||||
Command(const llvm::Twine& name, double timeout);
|
||||
Command(const wpi::Twine& name, double timeout);
|
||||
~Command() override = default;
|
||||
double TimeSinceInitialized() const;
|
||||
void Requires(Subsystem* s);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
#include "Commands/CommandGroupEntry.h"
|
||||
@@ -37,7 +37,7 @@ namespace frc {
|
||||
class CommandGroup : public Command {
|
||||
public:
|
||||
CommandGroup() = default;
|
||||
explicit CommandGroup(const llvm::Twine& name);
|
||||
explicit CommandGroup(const wpi::Twine& name);
|
||||
virtual ~CommandGroup() = default;
|
||||
|
||||
void AddSequential(Command* command);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace frc {
|
||||
class ConditionalCommand : public Command {
|
||||
public:
|
||||
explicit ConditionalCommand(Command* onTrue, Command* onFalse = nullptr);
|
||||
ConditionalCommand(const llvm::Twine& name, Command* onTrue,
|
||||
ConditionalCommand(const wpi::Twine& name, Command* onTrue,
|
||||
Command* onFalse = nullptr);
|
||||
virtual ~ConditionalCommand() = default;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace frc {
|
||||
*/
|
||||
class InstantCommand : public Command {
|
||||
public:
|
||||
explicit InstantCommand(const llvm::Twine& name);
|
||||
explicit InstantCommand(const wpi::Twine& name);
|
||||
InstantCommand() = default;
|
||||
virtual ~InstantCommand() = default;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
#include "PIDController.h"
|
||||
@@ -20,10 +20,10 @@ namespace frc {
|
||||
|
||||
class PIDCommand : public Command, public PIDOutput, public PIDSource {
|
||||
public:
|
||||
PIDCommand(const llvm::Twine& name, double p, double i, double d);
|
||||
PIDCommand(const llvm::Twine& name, double p, double i, double d,
|
||||
PIDCommand(const wpi::Twine& name, double p, double i, double d);
|
||||
PIDCommand(const wpi::Twine& name, double p, double i, double d,
|
||||
double period);
|
||||
PIDCommand(const llvm::Twine& name, double p, double i, double d, double f,
|
||||
PIDCommand(const wpi::Twine& name, double p, double i, double d, double f,
|
||||
double period);
|
||||
PIDCommand(double p, double i, double d);
|
||||
PIDCommand(double p, double i, double d, double period);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Subsystem.h"
|
||||
#include "PIDController.h"
|
||||
@@ -29,9 +29,9 @@ namespace frc {
|
||||
*/
|
||||
class PIDSubsystem : public Subsystem, public PIDOutput, public PIDSource {
|
||||
public:
|
||||
PIDSubsystem(const llvm::Twine& name, double p, double i, double d);
|
||||
PIDSubsystem(const llvm::Twine& name, double p, double i, double d, double f);
|
||||
PIDSubsystem(const llvm::Twine& name, double p, double i, double d, double f,
|
||||
PIDSubsystem(const wpi::Twine& name, double p, double i, double d);
|
||||
PIDSubsystem(const wpi::Twine& name, double p, double i, double d, double f);
|
||||
PIDSubsystem(const wpi::Twine& name, double p, double i, double d, double f,
|
||||
double period);
|
||||
PIDSubsystem(double p, double i, double d);
|
||||
PIDSubsystem(double p, double i, double d, double f);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/InstantCommand.h"
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace frc {
|
||||
|
||||
class PrintCommand : public InstantCommand {
|
||||
public:
|
||||
explicit PrintCommand(const llvm::Twine& message);
|
||||
explicit PrintCommand(const wpi::Twine& message);
|
||||
virtual ~PrintCommand() = default;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <networktables/NetworkTableEntry.h>
|
||||
#include <support/mutex.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
#include "ErrorBase.h"
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <llvm/StringRef.h>
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "ErrorBase.h"
|
||||
#include "SmartDashboard/Sendable.h"
|
||||
@@ -24,20 +24,20 @@ class Subsystem : public ErrorBase, public SendableBase {
|
||||
friend class Scheduler;
|
||||
|
||||
public:
|
||||
explicit Subsystem(const llvm::Twine& name);
|
||||
explicit Subsystem(const wpi::Twine& name);
|
||||
|
||||
void SetDefaultCommand(Command* command);
|
||||
Command* GetDefaultCommand();
|
||||
llvm::StringRef GetDefaultCommandName();
|
||||
wpi::StringRef GetDefaultCommandName();
|
||||
void SetCurrentCommand(Command* command);
|
||||
Command* GetCurrentCommand() const;
|
||||
llvm::StringRef GetCurrentCommandName() const;
|
||||
wpi::StringRef GetCurrentCommandName() const;
|
||||
virtual void Periodic();
|
||||
virtual void InitDefaultCommand();
|
||||
|
||||
void AddChild(const llvm::Twine& name, std::shared_ptr<Sendable> child);
|
||||
void AddChild(const llvm::Twine& name, Sendable* child);
|
||||
void AddChild(const llvm::Twine& name, Sendable& child);
|
||||
void AddChild(const wpi::Twine& name, std::shared_ptr<Sendable> child);
|
||||
void AddChild(const wpi::Twine& name, Sendable* child);
|
||||
void AddChild(const wpi::Twine& name, Sendable& child);
|
||||
void AddChild(std::shared_ptr<Sendable> child);
|
||||
void AddChild(Sendable* child);
|
||||
void AddChild(Sendable& child);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace frc {
|
||||
*/
|
||||
class TimedCommand : public Command {
|
||||
public:
|
||||
TimedCommand(const llvm::Twine& name, double timeout);
|
||||
TimedCommand(const wpi::Twine& name, double timeout);
|
||||
explicit TimedCommand(double timeout);
|
||||
virtual ~TimedCommand() = default;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/TimedCommand.h"
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace frc {
|
||||
class WaitCommand : public TimedCommand {
|
||||
public:
|
||||
explicit WaitCommand(double timeout);
|
||||
WaitCommand(const llvm::Twine& name, double timeout);
|
||||
WaitCommand(const wpi::Twine& name, double timeout);
|
||||
virtual ~WaitCommand() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace frc {
|
||||
class WaitForChildren : public Command {
|
||||
public:
|
||||
explicit WaitForChildren(double timeout);
|
||||
WaitForChildren(const llvm::Twine& name, double timeout);
|
||||
WaitForChildren(const wpi::Twine& name, double timeout);
|
||||
virtual ~WaitForChildren() = default;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/Twine.h>
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "Commands/Command.h"
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace frc {
|
||||
class WaitUntilCommand : public Command {
|
||||
public:
|
||||
explicit WaitUntilCommand(double time);
|
||||
WaitUntilCommand(const llvm::Twine& name, double time);
|
||||
WaitUntilCommand(const wpi::Twine& name, double time);
|
||||
virtual ~WaitUntilCommand() = default;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user