diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-11 22:06:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-11 22:06:07 +0000 |
commit | c89ecc5c2f6c089db328e2856aadf9fd4a1a0bd3 (patch) | |
tree | db487ea0e05e19043697704ae86613c740870df4 | |
parent | 766b5efd99c01e26f00f22d81b57d1385b3d2ab0 (diff) |
move LCOMMDirective = "\t.lcomm\t" up to DarwinTAI, eliminate
template in PPC backend for TAI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78727 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMTargetAsmInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMTargetAsmInfo.h | 1 | ||||
-rw-r--r-- | lib/Target/DarwinTargetAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 35 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.h | 25 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.cpp | 2 |
6 files changed, 33 insertions, 35 deletions
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp index 653219bf74..755ee15a8d 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp @@ -62,6 +62,8 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() { PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t"; + LCOMMDirective = "\t.lcomm\t"; + DwarfRequiresFrameSection = false; SupportsDebugInformation = true; diff --git a/lib/Target/ARM/ARMTargetAsmInfo.h b/lib/Target/ARM/ARMTargetAsmInfo.h index 9b97cbdc17..d897d8cc0f 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.h +++ b/lib/Target/ARM/ARMTargetAsmInfo.h @@ -32,7 +32,6 @@ namespace llvm { BaseTAI::COMMDirectiveTakesAlignment = false; BaseTAI::InlineAsmStart = "@ InlineAsm Start"; BaseTAI::InlineAsmEnd = "@ InlineAsm End"; - BaseTAI::LCOMMDirective = "\t.lcomm\t"; } }; diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp index ad669f8c03..808074f410 100644 --- a/lib/Target/DarwinTargetAsmInfo.cpp +++ b/lib/Target/DarwinTargetAsmInfo.cpp @@ -35,7 +35,8 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo() { WeakDefDirective = "\t.weak_definition "; WeakRefDirective = "\t.weak_reference "; HiddenDirective = "\t.private_extern "; - + LCOMMDirective = "\t.lcomm\t"; + // _foo.eh symbols are currently always exported so that the linker knows // about them. This is not necessary on 10.6 and later, but it // doesn't hurt anything. diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 52e29865fa..41d78dcb01 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -19,8 +19,7 @@ using namespace llvm; using namespace llvm::dwarf; -PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) : - PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) { +PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) { PCSymbol = "."; CommentString = ";"; UsedDirective = "\t.no_dead_strip\t"; @@ -28,10 +27,21 @@ PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) : GlobalEHDirective = "\t.globl\t"; SupportsWeakOmittedEHFrame = false; + + const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); + bool isPPC64 = Subtarget->isPPC64(); + + ZeroDirective = "\t.space\t"; + SetDirective = "\t.set"; + Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; + AlignmentIsInBytes = false; + LCOMMDirective = "\t.lcomm\t"; + InlineAsmStart = "# InlineAsm Start"; + InlineAsmEnd = "# InlineAsm End"; + AssemblerDialect = Subtarget->getAsmFlavor(); } -PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) : - PPCTargetAsmInfo<TargetAsmInfo>(TM) { +PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) { CommentString = "#"; GlobalPrefix = ""; PrivateGlobalPrefix = ".L"; @@ -47,12 +57,21 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) : // Set up DWARF directives HasLEB128 = true; // Target asm supports leb128 directives (little-endian) + const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); + bool isPPC64 = Subtarget->isPPC64(); + // Exceptions handling - if (!TM.getSubtargetImpl()->isPPC64()) + if (!isPPC64) ExceptionsType = ExceptionHandling::Dwarf; AbsoluteEHSectionOffsets = false; + + ZeroDirective = "\t.space\t"; + SetDirective = "\t.set"; + Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; + AlignmentIsInBytes = false; + LCOMMDirective = "\t.lcomm\t"; + InlineAsmStart = "# InlineAsm Start"; + InlineAsmEnd = "# InlineAsm End"; + AssemblerDialect = Subtarget->getAsmFlavor(); } - -// Instantiate default implementation. -TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>); diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h index a84db460d2..0d9285a80f 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.h +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.h @@ -21,32 +21,11 @@ namespace llvm { - template <class BaseTAI> - struct PPCTargetAsmInfo : public BaseTAI { - explicit PPCTargetAsmInfo(const PPCTargetMachine &TM) { - const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); - bool isPPC64 = Subtarget->isPPC64(); - - BaseTAI::ZeroDirective = "\t.space\t"; - BaseTAI::SetDirective = "\t.set"; - BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; - BaseTAI::AlignmentIsInBytes = false; - BaseTAI::LCOMMDirective = "\t.lcomm\t"; - BaseTAI::InlineAsmStart = "# InlineAsm Start"; - BaseTAI::InlineAsmEnd = "# InlineAsm End"; - BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor(); - } - }; - - typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo; - - EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>); - - struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> { + struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo { explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM); }; - struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<TargetAsmInfo> { + struct PPCLinuxTargetAsmInfo : public TargetAsmInfo { explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM); }; diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index 7712b02250..c44703835c 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/lib/Target/X86/X86TargetAsmInfo.cpp @@ -48,12 +48,10 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) { AlignmentIsInBytes = false; TextAlignFillValue = 0x90; - if (!is64Bit) Data64bitsDirective = 0; // we can't emit a 64-bit unit ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill - LCOMMDirective = "\t.lcomm\t"; // Leopard and above support aligned common symbols. COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9); |