[llvm-commits] [llvm] r45281 - in /llvm/trunk/lib/Target/PowerPC: PPCISelLowering.cpp PPCTargetAsmInfo.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Fri Dec 21 04:19:46 PST 2007
Author: geoffray
Date: Fri Dec 21 06:19:44 2007
New Revision: 45281
URL: http://llvm.org/viewvc/llvm-project?rev=45281&view=rev
Log:
Enable EH for linux/ppc32 targets
Modified:
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=45281&r1=45280&r2=45281&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Dec 21 06:19:44 2007
@@ -167,14 +167,12 @@
// Support label based line numbers.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- if (!TM.getSubtarget<PPCSubtarget>().isDarwin()) {
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
- } else {
- setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand);
- setOperationAction(ISD::EHSELECTION, MVT::i64, Expand);
- setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
- setOperationAction(ISD::EHSELECTION, MVT::i32, Expand);
- }
+
+ setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand);
+ setOperationAction(ISD::EHSELECTION, MVT::i64, Expand);
+ setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
+ setOperationAction(ISD::EHSELECTION, MVT::i32, Expand);
+
// We want to legalize GlobalAddress and ConstantPool nodes into the
// appropriate instructions to materialize the address.
@@ -1771,9 +1769,9 @@
// If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
// direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
// node so that legalize doesn't hack it.
- if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
- Callee = DAG.getTargetGlobalAddress(G->getGlobal(), Callee.getValueType());
- else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee))
+ //if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
+ // Callee = DAG.getTargetGlobalAddress(G->getGlobal(), Callee.getValueType());
+ if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee))
Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Callee.getValueType());
else if (SDNode *Dest = isBLACompatibleAddress(Callee, DAG))
// If this is an absolute destination address, use the munged value.
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=45281&r1=45280&r2=45281&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Fri Dec 21 06:19:44 2007
@@ -28,10 +28,6 @@
InlineAsmEnd = "# InlineAsm End";
AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor();
- NeedsSet = true;
- DwarfEHFrameSection =
- ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
- DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
}
DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
@@ -60,7 +56,12 @@
HiddenDirective = "\t.private_extern\t";
SupportsExceptionHandling = true;
NeedsIndirectEncoding = true;
+ NeedsSet = true;
BSSSection = 0;
+
+ DwarfEHFrameSection =
+ ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
+ DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
@@ -98,6 +99,9 @@
WeakRefDirective = "\t.weak\t";
BSSSection = "\t.section\t\".sbss\",\"aw\", at nobits";
+ // Debug Information
+ AbsoluteDebugSectionOffsets = true;
+ SupportsDebugInformation = true;
DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\", at progbits";
DwarfInfoSection = "\t.section\t.debug_info,\"\", at progbits";
DwarfLineSection = "\t.section\t.debug_line,\"\", at progbits";
@@ -109,4 +113,20 @@
DwarfARangesSection = "\t.section\t.debug_aranges,\"\", at progbits";
DwarfRangesSection = "\t.section\t.debug_ranges,\"\", at progbits";
DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\", at progbits";
+
+ ReadOnlySection = "\t.section\t.rodata";
+ FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4";
+ EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\", at progbits,8";
+ SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\", at progbits,16";
+ PCSymbol = ".";
+
+ // Set up DWARF directives
+ HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
+
+ // Exceptions handling
+ if (!TM.getSubtargetImpl()->isPPC64())
+ SupportsExceptionHandling = true;
+ AbsoluteEHSectionOffsets = false;
+ DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits";
+ DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits";
}
More information about the llvm-commits
mailing list