diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-08-12 07:22:17 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-08-12 07:22:17 +0000 |
| commit | d88f9fd3f28cee69b0fcdca59532824d5617577e (patch) | |
| tree | ac43fb9b39f3a7abe8aa7cb217860e4d29329963 /lib/Target/MSP430 | |
| parent | cdd849e6363813d9dad21dd4da5e4d47f60b551f (diff) | |
| download | external_llvm-d88f9fd3f28cee69b0fcdca59532824d5617577e.zip external_llvm-d88f9fd3f28cee69b0fcdca59532824d5617577e.tar.gz external_llvm-d88f9fd3f28cee69b0fcdca59532824d5617577e.tar.bz2 | |
Change TargetAsmInfo to be constructed via TargetRegistry from a Target+Triple
pair instead of from a virtual method on TargetMachine. This cuts the final
ties of TargetAsmInfo to TargetMachine, meaning that MC can now use
TargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430')
| -rw-r--r-- | lib/Target/MSP430/MSP430AsmPrinter.cpp | 3 | ||||
| -rw-r--r-- | lib/Target/MSP430/MSP430TargetAsmInfo.cpp | 2 | ||||
| -rw-r--r-- | lib/Target/MSP430/MSP430TargetAsmInfo.h | 4 | ||||
| -rw-r--r-- | lib/Target/MSP430/MSP430TargetMachine.cpp | 3 | ||||
| -rw-r--r-- | lib/Target/MSP430/MSP430TargetMachine.h | 3 |
5 files changed, 6 insertions, 9 deletions
diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp index 6209fc4..fd8c7d1 100644 --- a/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -15,6 +15,7 @@ #define DEBUG_TYPE "asm-printer" #include "MSP430.h" #include "MSP430InstrInfo.h" +#include "MSP430TargetAsmInfo.h" #include "MSP430TargetMachine.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" @@ -25,7 +26,6 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" -#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegistry.h" @@ -246,4 +246,5 @@ extern "C" void LLVMInitializeMSP430Target() { // Register the target. RegisterTargetMachine<MSP430TargetMachine> X(TheMSP430Target); RegisterAsmPrinter<MSP430AsmPrinter> Y(TheMSP430Target); + RegisterAsmInfo<MSP430TargetAsmInfo> Z(TheMSP430Target); } diff --git a/lib/Target/MSP430/MSP430TargetAsmInfo.cpp b/lib/Target/MSP430/MSP430TargetAsmInfo.cpp index 1aae9f2..56560d6 100644 --- a/lib/Target/MSP430/MSP430TargetAsmInfo.cpp +++ b/lib/Target/MSP430/MSP430TargetAsmInfo.cpp @@ -14,6 +14,6 @@ #include "MSP430TargetAsmInfo.h" using namespace llvm; -MSP430TargetAsmInfo::MSP430TargetAsmInfo() { +MSP430TargetAsmInfo::MSP430TargetAsmInfo(const Target &T, const StringRef &TT) { AlignmentIsInBytes = false; } diff --git a/lib/Target/MSP430/MSP430TargetAsmInfo.h b/lib/Target/MSP430/MSP430TargetAsmInfo.h index 8b4580c..510e239 100644 --- a/lib/Target/MSP430/MSP430TargetAsmInfo.h +++ b/lib/Target/MSP430/MSP430TargetAsmInfo.h @@ -17,8 +17,10 @@ #include "llvm/Target/TargetAsmInfo.h" namespace llvm { + class Target; + class StringRef; struct MSP430TargetAsmInfo : public TargetAsmInfo { - explicit MSP430TargetAsmInfo(); + explicit MSP430TargetAsmInfo(const Target &T, const StringRef &TT); }; } // namespace llvm diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index f34e3db..56495e6 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -29,9 +29,6 @@ MSP430TargetMachine::MSP430TargetMachine(const Target &T, InstrInfo(*this), TLInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsDown, 2, -2) { } -const TargetAsmInfo *MSP430TargetMachine::createTargetAsmInfo() const { - return new MSP430TargetAsmInfo(); -} bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { diff --git a/lib/Target/MSP430/MSP430TargetMachine.h b/lib/Target/MSP430/MSP430TargetMachine.h index 44cdd54..d386140 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.h +++ b/lib/Target/MSP430/MSP430TargetMachine.h @@ -37,9 +37,6 @@ class MSP430TargetMachine : public LLVMTargetMachine { // any MSP430 specific FrameInfo class. TargetFrameInfo FrameInfo; -protected: - virtual const TargetAsmInfo *createTargetAsmInfo() const; - public: MSP430TargetMachine(const Target &T, const std::string &TT, const std::string &FS); |
