summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-01-15 23:24:56 +0000
committerDale Johannesen <dalej@apple.com>2008-01-15 23:24:56 +0000
commit59a2250b0d35195dc3d5ad8aba17e003e19a0b16 (patch)
tree0f08866e91b7e5ab215b98dc8704ff6aff4f8abc /llvm/lib/Target
parent897aed910977aa6f91d70ba89da24ad486ed42ec (diff)
downloadbcm5719-llvm-59a2250b0d35195dc3d5ad8aba17e003e19a0b16.tar.gz
bcm5719-llvm-59a2250b0d35195dc3d5ad8aba17e003e19a0b16.zip
Fix and enable EH for x86-64 Darwin. Adds
ShortenEHDataFor64Bits as a not-very-accurate abstraction to cover all the changes in DwarfWriter. Some cosmetic changes to Darwin assembly code for gcc testsuite compatibility. llvm-svn: 46029
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/X86/X86AsmPrinter.cpp3
-rw-r--r--llvm/lib/Target/X86/X86TargetAsmInfo.cpp15
3 files changed, 14 insertions, 5 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index e593482c65a..8728def217c 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -50,6 +50,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
StaticCtorsSection = ".mod_init_func";
StaticDtorsSection = ".mod_term_func";
}
+ SwitchToSectionDirective = "\t.section ";
UsedDirective = "\t.no_dead_strip\t";
WeakDefDirective = "\t.weak_definition ";
WeakRefDirective = "\t.weak_reference ";
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 8f481626961..b0e8165ad1c 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -358,7 +358,8 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
O << "\n";
- if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI) {
+ if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI &&
+ !Subtarget->is64Bit()) {
// Add the (possibly multiple) personalities to the set of global values.
const std::vector<Function *>& Personalities = MMI->getPersonalities();
diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
index bc698ba0969..293836a06e8 100644
--- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -59,6 +59,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
SixteenByteConstantSection = "\t.literal16\n";
ReadOnlySection = "\t.const\n";
LCOMMDirective = "\t.lcomm\t";
+ SwitchToSectionDirective = "\t.section ";
COMMDirectiveTakesAlignment = false;
HasDotTypeDotSizeDirective = false;
if (TM.getRelocationModel() == Reloc::Static) {
@@ -68,8 +69,13 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
StaticCtorsSection = ".mod_init_func";
StaticDtorsSection = ".mod_term_func";
}
- PersonalityPrefix = "L";
- PersonalitySuffix = "$non_lazy_ptr";
+ if (Subtarget->is64Bit()) {
+ PersonalityPrefix = "";
+ PersonalitySuffix = "+4@GOTPCREL";
+ } else {
+ PersonalityPrefix = "L";
+ PersonalitySuffix = "$non_lazy_ptr";
+ }
NeedsIndirectEncoding = true;
InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End";
@@ -102,11 +108,12 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
// Exceptions handling
- if (!Subtarget->is64Bit())
- SupportsExceptionHandling = true;
+ SupportsExceptionHandling = true;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
AbsoluteEHSectionOffsets = false;
+ if (Subtarget->is64Bit())
+ ShortenEHDataOn64Bit = true;
DwarfEHFrameSection =
".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
OpenPOWER on IntegriCloud