[llvm-commits] [llvm] r77414 - in /llvm/trunk/lib/Target: PowerPC/PPCTargetAsmInfo.cpp X86/X86TargetAsmInfo.cpp
Bill Wendling
isanbard at gmail.com
Tue Jul 28 17:59:34 PDT 2009
Author: void
Date: Tue Jul 28 19:59:34 2009
New Revision: 77414
URL: http://llvm.org/viewvc/llvm-project?rev=77414&view=rev
Log:
Change the "PreferredEHDataFormat" from "absptr" if we're on a Darwin system >
Leopard.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=77414&r1=77413&r2=77414&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Tue Jul 28 19:59:34 2009
@@ -41,12 +41,16 @@
unsigned
PPCDarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const {
- if ((Reason == DwarfEncoding::Data || Reason == DwarfEncoding::Functions)
- && Global)
- return DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
+ const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
- if (Reason == DwarfEncoding::CodeLabels || !Global)
- return DW_EH_PE_pcrel;
+ if (Subtarget->getDarwinVers() > 9) {
+ if ((Reason == DwarfEncoding::Data || Reason == DwarfEncoding::Functions)
+ && Global)
+ return DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
+
+ if (Reason == DwarfEncoding::CodeLabels || !Global)
+ return DW_EH_PE_pcrel;
+ }
return DW_EH_PE_absptr;
}
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77414&r1=77413&r2=77414&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Tue Jul 28 19:59:34 2009
@@ -94,12 +94,16 @@
unsigned
X86DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const {
- if ((Reason == DwarfEncoding::Data || Reason == DwarfEncoding::Functions)
- && Global)
- return DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
+ const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- if (Reason == DwarfEncoding::CodeLabels || !Global)
- return DW_EH_PE_pcrel;
+ if (Subtarget->getDarwinVers() > 9) {
+ if ((Reason == DwarfEncoding::Data || Reason == DwarfEncoding::Functions)
+ && Global)
+ return DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
+
+ if (Reason == DwarfEncoding::CodeLabels || !Global)
+ return DW_EH_PE_pcrel;
+ }
return DW_EH_PE_absptr;
}
More information about the llvm-commits
mailing list