factorize more darwin TAI stuff. Note that this gives

darwin/arm support for .no_dead_strip


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-08-11 22:31:42 +00:00
parent 0c420fc20a
commit e28a2e8b70
4 changed files with 7 additions and 17 deletions

View File

@ -42,21 +42,16 @@ static const char *const arm_asm_table[] = {
ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() { ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
AsmTransCBE = arm_asm_table; AsmTransCBE = arm_asm_table;
AlignmentIsInBytes = false;
Data64bitsDirective = 0; Data64bitsDirective = 0;
CommentString = "@"; CommentString = "@";
COMMDirectiveTakesAlignment = false; COMMDirectiveTakesAlignment = false;
InlineAsmStart = "@ InlineAsm Start"; InlineAsmStart = "@ InlineAsm Start";
InlineAsmEnd = "@ InlineAsm End"; InlineAsmEnd = "@ InlineAsm End";
HasDotTypeDotSizeDirective = false;
SupportsDebugInformation = true; SupportsDebugInformation = true;
// Exceptions handling // Exceptions handling
ExceptionsType = ExceptionHandling::SjLj; ExceptionsType = ExceptionHandling::SjLj;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
AbsoluteEHSectionOffsets = false; AbsoluteEHSectionOffsets = false;
} }

View File

@ -26,6 +26,8 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
AllowQuotesInName = true; AllowQuotesInName = true;
HasSingleParameterDotFile = false; HasSingleParameterDotFile = false;
AlignmentIsInBytes = false;
// In non-PIC modes, emit a special label before jump tables so that the // In non-PIC modes, emit a special label before jump tables so that the
// linker can perform more accurate dead code stripping. We do not check the // linker can perform more accurate dead code stripping. We do not check the
// relocation model here since it can be overridden later. // relocation model here since it can be overridden later.
@ -40,11 +42,16 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
SetDirective = "\t.set"; SetDirective = "\t.set";
ProtectedDirective = "\t.globl\t"; ProtectedDirective = "\t.globl\t";
HasDotTypeDotSizeDirective = false;
UsedDirective = "\t.no_dead_strip\t";
// _foo.eh symbols are currently always exported so that the linker knows // _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 // about them. This is not necessary on 10.6 and later, but it
// doesn't hurt anything. // doesn't hurt anything.
// FIXME: I need to get this from Triple. // FIXME: I need to get this from Triple.
Is_EHSymbolPrivate = false; Is_EHSymbolPrivate = false;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
} }

View File

@ -22,19 +22,13 @@ using namespace llvm::dwarf;
PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) { PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
PCSymbol = "."; PCSymbol = ".";
CommentString = ";"; CommentString = ";";
UsedDirective = "\t.no_dead_strip\t";
ExceptionsType = ExceptionHandling::Dwarf; ExceptionsType = ExceptionHandling::Dwarf;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
bool isPPC64 = Subtarget->isPPC64(); bool isPPC64 = Subtarget->isPPC64();
if (!isPPC64) if (!isPPC64)
Data64bitsDirective = 0; // we can't emit a 64-bit unit Data64bitsDirective = 0; // we can't emit a 64-bit unit
AlignmentIsInBytes = false;
LCOMMDirective = "\t.lcomm\t";
InlineAsmStart = "# InlineAsm Start"; InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End"; InlineAsmEnd = "# InlineAsm End";
AssemblerDialect = Subtarget->getAsmFlavor(); AssemblerDialect = Subtarget->getAsmFlavor();

View File

@ -45,7 +45,6 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>(); const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
bool is64Bit = Subtarget->is64Bit(); bool is64Bit = Subtarget->is64Bit();
AlignmentIsInBytes = false;
TextAlignFillValue = 0x90; TextAlignFillValue = 0x90;
if (!is64Bit) if (!is64Bit)
@ -53,7 +52,6 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
// Leopard and above support aligned common symbols. // Leopard and above support aligned common symbols.
COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9); COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
HasDotTypeDotSizeDirective = false;
if (is64Bit) { if (is64Bit) {
PersonalityPrefix = ""; PersonalityPrefix = "";
@ -67,16 +65,12 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
InlineAsmEnd = "## InlineAsm End"; InlineAsmEnd = "## InlineAsm End";
CommentString = "##"; CommentString = "##";
PCSymbol = "."; PCSymbol = ".";
UsedDirective = "\t.no_dead_strip\t";
ProtectedDirective = "\t.globl\t";
SupportsDebugInformation = true; SupportsDebugInformation = true;
DwarfUsesInlineInfoSection = true; DwarfUsesInlineInfoSection = true;
// Exceptions handling // Exceptions handling
ExceptionsType = ExceptionHandling::Dwarf; ExceptionsType = ExceptionHandling::Dwarf;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
AbsoluteEHSectionOffsets = false; AbsoluteEHSectionOffsets = false;
} }