diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-11 21:57:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-11 21:57:08 +0000 |
commit | a1a1f02708261aedd2e74d4a11c129f9bbc39716 (patch) | |
tree | f05ddf1b80fef5315e121543f3a122c37458bca5 | |
parent | b08ae6b0fb8860badfaeb8f96908bd133f27543a (diff) |
eliminate the X86TargetAsmInfo template.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78724 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.cpp | 28 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.h | 22 |
2 files changed, 24 insertions, 26 deletions
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index b702cbfc44..7712b02250 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/lib/Target/X86/X86TargetAsmInfo.cpp @@ -26,7 +26,7 @@ using namespace llvm; using namespace llvm::dwarf; -const char *const llvm::x86_asm_table[] = { +static const char *const x86_asm_table[] = { "{si}", "S", "{di}", "D", "{ax}", "a", @@ -38,8 +38,10 @@ const char *const llvm::x86_asm_table[] = { "{cc}", "cc", 0,0}; -X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): - X86TargetAsmInfo<DarwinTargetAsmInfo>(TM) { +X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = TM.getSubtarget<X86Subtarget>().getAsmFlavor(); + const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>(); bool is64Bit = Subtarget->is64Bit(); @@ -83,8 +85,9 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): AbsoluteEHSectionOffsets = false; } -X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) : - X86TargetAsmInfo<TargetAsmInfo>(TM) { +X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = TM.getSubtarget<X86Subtarget>().getAsmFlavor(); PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; @@ -107,9 +110,17 @@ X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) : NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; } +X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = TM.getSubtarget<X86Subtarget>().getAsmFlavor(); + +} + + +X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM) { + AsmTransCBE = x86_asm_table; + AssemblerDialect = TM.getSubtarget<X86Subtarget>().getAsmFlavor(); -X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM): - X86TargetAsmInfo<TargetAsmInfo>(TM) { GlobalPrefix = "_"; CommentString = ";"; @@ -131,6 +142,3 @@ X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM): AlignmentIsInBytes = true; } - -// Instantiate default implementation. -TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>); diff --git a/lib/Target/X86/X86TargetAsmInfo.h b/lib/Target/X86/X86TargetAsmInfo.h index 34599e5a92..9ce34f278f 100644 --- a/lib/Target/X86/X86TargetAsmInfo.h +++ b/lib/Target/X86/X86TargetAsmInfo.h @@ -22,29 +22,19 @@ namespace llvm { - extern const char *const x86_asm_table[]; - - template <class BaseTAI> - struct X86TargetAsmInfo : public BaseTAI { - explicit X86TargetAsmInfo(const TargetMachine &TM) { - BaseTAI::AsmTransCBE = x86_asm_table; - BaseTAI::AssemblerDialect =TM.getSubtarget<X86Subtarget>().getAsmFlavor(); - } - }; - - EXTERN_TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>); - - struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo<DarwinTargetAsmInfo> { + struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo { explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM); }; - struct X86ELFTargetAsmInfo : public X86TargetAsmInfo<TargetAsmInfo> { + struct X86ELFTargetAsmInfo : public TargetAsmInfo { explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM); }; - typedef X86TargetAsmInfo<COFFTargetAsmInfo> X86COFFTargetAsmInfo; + struct X86COFFTargetAsmInfo : public TargetAsmInfo { + explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM); + }; - struct X86WinTargetAsmInfo : public X86TargetAsmInfo<TargetAsmInfo> { + struct X86WinTargetAsmInfo : public TargetAsmInfo { explicit X86WinTargetAsmInfo(const X86TargetMachine &TM); }; |