1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

eliminate the X86TargetAsmInfo template.

llvm-svn: 78724
This commit is contained in:
Chris Lattner 2009-08-11 21:57:08 +00:00
parent b2288f269b
commit 05bde58b5e
2 changed files with 24 additions and 26 deletions

View File

@ -26,7 +26,7 @@
using namespace llvm; using namespace llvm;
using namespace llvm::dwarf; using namespace llvm::dwarf;
const char *const llvm::x86_asm_table[] = { static const char *const x86_asm_table[] = {
"{si}", "S", "{si}", "S",
"{di}", "D", "{di}", "D",
"{ax}", "a", "{ax}", "a",
@ -38,8 +38,10 @@ const char *const llvm::x86_asm_table[] = {
"{cc}", "cc", "{cc}", "cc",
0,0}; 0,0};
X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
X86TargetAsmInfo<DarwinTargetAsmInfo>(TM) { AsmTransCBE = x86_asm_table;
AssemblerDialect = TM.getSubtarget<X86Subtarget>().getAsmFlavor();
const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>(); const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
bool is64Bit = Subtarget->is64Bit(); bool is64Bit = Subtarget->is64Bit();
@ -83,8 +85,9 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
AbsoluteEHSectionOffsets = false; AbsoluteEHSectionOffsets = false;
} }
X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) : X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) {
X86TargetAsmInfo<TargetAsmInfo>(TM) { AsmTransCBE = x86_asm_table;
AssemblerDialect = TM.getSubtarget<X86Subtarget>().getAsmFlavor();
PrivateGlobalPrefix = ".L"; PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t"; WeakRefDirective = "\t.weak\t";
@ -107,9 +110,17 @@ X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) :
NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; 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 = "_"; GlobalPrefix = "_";
CommentString = ";"; CommentString = ";";
@ -131,6 +142,3 @@ X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):
AlignmentIsInBytes = true; AlignmentIsInBytes = true;
} }
// Instantiate default implementation.
TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>);

View File

@ -22,29 +22,19 @@
namespace llvm { namespace llvm {
extern const char *const x86_asm_table[]; struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
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> {
explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM); explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
}; };
struct X86ELFTargetAsmInfo : public X86TargetAsmInfo<TargetAsmInfo> { struct X86ELFTargetAsmInfo : public TargetAsmInfo {
explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM); 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); explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
}; };