diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-09-07 22:06:40 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-09-07 22:06:40 +0000 |
commit | a0f3d17daac73c9c71aad497b298cbe82848f726 (patch) | |
tree | 66926558c3c809eb673cc06c4bd7a2cc9d0cec7a /lib/Target/Sparc | |
parent | 8e8de8f7765a08ab3aa4f48b302cf19ccb9740e2 (diff) |
Make target asm info a property of the target machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/SparcAsmPrinter.cpp | 16 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcTargetMachine.h | 4 |
2 files changed, 6 insertions, 14 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index 2bc6f6332e..1e6efcbeaf 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -37,19 +37,8 @@ using namespace llvm; namespace { Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed"); - struct VISIBILITY_HIDDEN SparcTargetAsmInfo : public TargetAsmInfo { - SparcTargetAsmInfo() { - Data16bitsDirective = "\t.half\t"; - Data32bitsDirective = "\t.word\t"; - Data64bitsDirective = 0; // .xword is only supported by V9. - ZeroDirective = "\t.skip\t"; - CommentString = "!"; - ConstantPoolSection = "\t.section \".rodata\",#alloc\n"; - } - }; - struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter { - SparcAsmPrinter(std::ostream &O, TargetMachine &TM, TargetAsmInfo *T) + SparcAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T) : AsmPrinter(O, TM, T) { } @@ -85,8 +74,7 @@ namespace { /// FunctionPass *llvm::createSparcCodePrinterPass(std::ostream &o, TargetMachine &tm) { - SparcTargetAsmInfo *TAI = new SparcTargetAsmInfo(); - return new SparcAsmPrinter(o, tm, TAI); + return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo()); } /// runOnMachineFunction - This uses the printMachineInstruction() diff --git a/lib/Target/Sparc/SparcTargetMachine.h b/lib/Target/Sparc/SparcTargetMachine.h index e377afa085..995d346f92 100644 --- a/lib/Target/Sparc/SparcTargetMachine.h +++ b/lib/Target/Sparc/SparcTargetMachine.h @@ -19,6 +19,7 @@ #include "llvm/Target/TargetFrameInfo.h" #include "SparcInstrInfo.h" #include "SparcSubtarget.h" +#include "SparcTargetAsmInfo.h" namespace llvm { @@ -41,6 +42,9 @@ public: virtual const TargetData *getTargetData() const { return &DataLayout; } static unsigned getModuleMatchQuality(const Module &M); + virtual const TargetAsmInfo *createTargetAsmInfo() const { + return static_cast<const TargetAsmInfo *>(new SparcTargetAsmInfo(*this)); + } // Pass Pipeline Configuration virtual bool addInstSelector(FunctionPassManager &PM, bool Fast); |