mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Remove the target independent TargetMachine::getSubtarget and
TargetMachine::getSubtargetImpl routines. This keeps the target independent code free of bare subtarget calls while the remainder of the backends are migrated, or not if they don't wish to support per-function subtargets as would be needed for function multiversioning or LTO of disparate cpu subarchitecture types, e.g. clang -msse4.2 -c foo.c -emit-llvm -o foo.bc clang -c bar.c -emit-llvm -o bar.bc llvm-link foo.bc bar.bc -o baz.bc llc baz.bc and get appropriate code for what the command lines requested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232885 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -108,11 +108,8 @@ public:
|
|||||||
|
|
||||||
/// getSubtargetImpl - virtual method implemented by subclasses that returns
|
/// getSubtargetImpl - virtual method implemented by subclasses that returns
|
||||||
/// a reference to that target's TargetSubtargetInfo-derived member variable.
|
/// a reference to that target's TargetSubtargetInfo-derived member variable.
|
||||||
virtual const TargetSubtargetInfo *getSubtargetImpl() const {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
virtual const TargetSubtargetInfo *getSubtargetImpl(const Function &) const {
|
virtual const TargetSubtargetInfo *getSubtargetImpl(const Function &) const {
|
||||||
return getSubtargetImpl();
|
return nullptr;
|
||||||
}
|
}
|
||||||
virtual TargetLoweringObjectFile *getObjFileLowering() const {
|
virtual TargetLoweringObjectFile *getObjFileLowering() const {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -121,9 +118,6 @@ public:
|
|||||||
/// getSubtarget - This method returns a pointer to the specified type of
|
/// getSubtarget - This method returns a pointer to the specified type of
|
||||||
/// TargetSubtargetInfo. In debug builds, it verifies that the object being
|
/// TargetSubtargetInfo. In debug builds, it verifies that the object being
|
||||||
/// returned is of the correct type.
|
/// returned is of the correct type.
|
||||||
template<typename STC> const STC &getSubtarget() const {
|
|
||||||
return *static_cast<const STC*>(getSubtargetImpl());
|
|
||||||
}
|
|
||||||
template <typename STC> const STC &getSubtarget(const Function &F) const {
|
template <typename STC> const STC &getSubtarget(const Function &F) const {
|
||||||
return *static_cast<const STC*>(getSubtargetImpl(F));
|
return *static_cast<const STC*>(getSubtargetImpl(F));
|
||||||
}
|
}
|
||||||
|
@@ -44,7 +44,7 @@ public:
|
|||||||
bool isLittle);
|
bool isLittle);
|
||||||
~ARMBaseTargetMachine() override;
|
~ARMBaseTargetMachine() override;
|
||||||
|
|
||||||
const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
const ARMSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||||
const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
|
const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
|
||||||
bool isLittleEndian() const { return isLittle; }
|
bool isLittleEndian() const { return isLittle; }
|
||||||
|
|
||||||
|
@@ -27,7 +27,10 @@ public:
|
|||||||
const TargetOptions &Options, Reloc::Model RM,
|
const TargetOptions &Options, Reloc::Model RM,
|
||||||
CodeModel::Model CM, CodeGenOpt::Level OL);
|
CodeModel::Model CM, CodeGenOpt::Level OL);
|
||||||
|
|
||||||
const BPFSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
const BPFSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||||
|
const BPFSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
|
return &Subtarget;
|
||||||
|
}
|
||||||
|
|
||||||
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
||||||
|
|
||||||
|
@@ -22,20 +22,13 @@ namespace llvm {
|
|||||||
|
|
||||||
class formatted_raw_ostream;
|
class formatted_raw_ostream;
|
||||||
|
|
||||||
class CPPSubtarget : public TargetSubtargetInfo {
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CPPTargetMachine : public TargetMachine {
|
struct CPPTargetMachine : public TargetMachine {
|
||||||
CPPTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
|
CPPTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
|
||||||
const TargetOptions &Options, Reloc::Model RM,
|
const TargetOptions &Options, Reloc::Model RM,
|
||||||
CodeModel::Model CM, CodeGenOpt::Level OL)
|
CodeModel::Model CM, CodeGenOpt::Level OL)
|
||||||
: TargetMachine(T, "", TT, CPU, FS, Options), Subtarget() {}
|
: TargetMachine(T, "", TT, CPU, FS, Options) {}
|
||||||
|
|
||||||
private:
|
|
||||||
CPPSubtarget Subtarget;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
|
||||||
bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
|
bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
|
||||||
CodeGenFileType FileType, bool DisableVerify,
|
CodeGenFileType FileType, bool DisableVerify,
|
||||||
AnalysisID StartAfter,
|
AnalysisID StartAfter,
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
Reloc::Model RM, CodeModel::Model CM,
|
Reloc::Model RM, CodeModel::Model CM,
|
||||||
CodeGenOpt::Level OL);
|
CodeGenOpt::Level OL);
|
||||||
~HexagonTargetMachine() override;
|
~HexagonTargetMachine() override;
|
||||||
const HexagonSubtarget *getSubtargetImpl() const override {
|
const HexagonSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
return &Subtarget;
|
return &Subtarget;
|
||||||
}
|
}
|
||||||
static unsigned getModuleMatchQuality(const Module &M);
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
|
@@ -34,7 +34,7 @@ public:
|
|||||||
CodeGenOpt::Level OL);
|
CodeGenOpt::Level OL);
|
||||||
~MSP430TargetMachine() override;
|
~MSP430TargetMachine() override;
|
||||||
|
|
||||||
const MSP430Subtarget *getSubtargetImpl() const override {
|
const MSP430Subtarget *getSubtargetImpl(const Function &F) const override {
|
||||||
return &Subtarget;
|
return &Subtarget;
|
||||||
}
|
}
|
||||||
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
TargetIRAnalysis getTargetIRAnalysis() override;
|
TargetIRAnalysis getTargetIRAnalysis() override;
|
||||||
|
|
||||||
const MipsSubtarget *getSubtargetImpl() const override {
|
const MipsSubtarget *getSubtargetImpl() const {
|
||||||
if (Subtarget)
|
if (Subtarget)
|
||||||
return Subtarget;
|
return Subtarget;
|
||||||
return &DefaultSubtarget;
|
return &DefaultSubtarget;
|
||||||
|
@@ -39,7 +39,10 @@ public:
|
|||||||
CodeModel::Model CM, CodeGenOpt::Level OP, bool is64bit);
|
CodeModel::Model CM, CodeGenOpt::Level OP, bool is64bit);
|
||||||
|
|
||||||
~NVPTXTargetMachine() override;
|
~NVPTXTargetMachine() override;
|
||||||
const NVPTXSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
const NVPTXSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
|
return &Subtarget;
|
||||||
|
}
|
||||||
|
const NVPTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||||
bool is64Bit() const { return is64bit; }
|
bool is64Bit() const { return is64bit; }
|
||||||
NVPTX::DrvInterface getDrvInterface() const { return drvInterface; }
|
NVPTX::DrvInterface getDrvInterface() const { return drvInterface; }
|
||||||
ManagedStringPool *getManagedStrPool() const {
|
ManagedStringPool *getManagedStrPool() const {
|
||||||
|
@@ -42,7 +42,8 @@ public:
|
|||||||
CodeModel::Model CM, CodeGenOpt::Level OL);
|
CodeModel::Model CM, CodeGenOpt::Level OL);
|
||||||
~AMDGPUTargetMachine();
|
~AMDGPUTargetMachine();
|
||||||
|
|
||||||
const AMDGPUSubtarget *getSubtargetImpl() const override {
|
const AMDGPUSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||||
|
const AMDGPUSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
return &Subtarget;
|
return &Subtarget;
|
||||||
}
|
}
|
||||||
const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
|
const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
|
||||||
|
@@ -30,7 +30,9 @@ public:
|
|||||||
CodeGenOpt::Level OL, bool is64bit);
|
CodeGenOpt::Level OL, bool is64bit);
|
||||||
~SparcTargetMachine() override;
|
~SparcTargetMachine() override;
|
||||||
|
|
||||||
const SparcSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
const SparcSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
|
return &Subtarget;
|
||||||
|
}
|
||||||
|
|
||||||
// Pass Pipeline Configuration
|
// Pass Pipeline Configuration
|
||||||
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
||||||
|
@@ -33,7 +33,8 @@ public:
|
|||||||
CodeGenOpt::Level OL);
|
CodeGenOpt::Level OL);
|
||||||
~SystemZTargetMachine() override;
|
~SystemZTargetMachine() override;
|
||||||
|
|
||||||
const SystemZSubtarget *getSubtargetImpl() const override {
|
const SystemZSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||||
|
const SystemZSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
return &Subtarget;
|
return &Subtarget;
|
||||||
}
|
}
|
||||||
// Override LLVMTargetMachine
|
// Override LLVMTargetMachine
|
||||||
|
@@ -29,7 +29,10 @@ public:
|
|||||||
CodeGenOpt::Level OL);
|
CodeGenOpt::Level OL);
|
||||||
~XCoreTargetMachine() override;
|
~XCoreTargetMachine() override;
|
||||||
|
|
||||||
const XCoreSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||||
|
const XCoreSubtarget *getSubtargetImpl(const Function &) const override {
|
||||||
|
return &Subtarget;
|
||||||
|
}
|
||||||
|
|
||||||
// Pass Pipeline Configuration
|
// Pass Pipeline Configuration
|
||||||
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
||||||
|
Reference in New Issue
Block a user