aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-05-03 20:28:35 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-05-03 20:28:35 +0000
commite8e5495474d67cd5151bd88e502be3f46ace7a85 (patch)
treeb7d7ba2474eb1c24a5ad9ac687609dd67912cee1
parent2a98ccabb4efe9882cdddd4b659e4935fc646040 (diff)
Debug support for arm-linux.
Patch by Raul Herbster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36690 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp25
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp3
-rw-r--r--lib/Target/ARM/ARMRegisterInfo.cpp5
-rw-r--r--lib/Target/ARM/ARMTargetAsmInfo.cpp17
4 files changed, 32 insertions, 18 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index ac392607b0..c35ef57c9c 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -175,9 +175,7 @@ FunctionPass *llvm::createARMCodePrinterPass(std::ostream &o,
bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
AFI = MF.getInfo<ARMFunctionInfo>();
- if (Subtarget->isTargetDarwin()) {
- DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
- }
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
SetupMachineFunction(MF);
O << "\n";
@@ -231,10 +229,8 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
EmitAlignment(2, F);
O << CurrentFnName << ":\n";
- if (Subtarget->isTargetDarwin()) {
- // Emit pre-function debug information.
- DW.BeginFunction(&MF);
- }
+ // Emit pre-function debug information.
+ DW.BeginFunction(&MF);
// Print out code for the function.
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
@@ -254,10 +250,8 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
if (TAI->hasDotTypeDotSizeDirective())
O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
- if (Subtarget->isTargetDarwin()) {
- // Emit post-function debug information.
- DW.EndFunction();
- }
+ // Emit post-function debug information.
+ DW.EndFunction();
return false;
}
@@ -769,10 +763,8 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
}
bool ARMAsmPrinter::doInitialization(Module &M) {
- if (Subtarget->isTargetDarwin()) {
- // Emit initial debug information.
- DW.BeginModule(&M);
- }
+ // Emit initial debug information.
+ DW.BeginModule(&M);
return AsmPrinter::doInitialization(M);
}
@@ -998,6 +990,9 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
// linker can safely perform dead code stripping. Since LLVM never
// generates code that does this, it is always safe to set.
O << "\t.subsections_via_symbols\n";
+ } else {
+ // Emit final debug information for ELF.
+ DW.EndModule();
}
AsmPrinter::doFinalization(M);
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index 8981ea4299..585b660b9c 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -178,9 +178,6 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
// Support label based line numbers.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- // FIXME - use subtarget debug flags
- if (!Subtarget->isTargetDarwin())
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
setOperationAction(ISD::RET, MVT::Other, Custom);
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
diff --git a/lib/Target/ARM/ARMRegisterInfo.cpp b/lib/Target/ARM/ARMRegisterInfo.cpp
index 4fd0f8929a..a0eb137e94 100644
--- a/lib/Target/ARM/ARMRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMRegisterInfo.cpp
@@ -1373,6 +1373,11 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const {
emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII);
}
+ if(STI.isTargetELF() && hasFP(MF)) {
+ MFI->setOffsetAdjustment(MFI->getOffsetAdjustment() -
+ AFI->getFramePtrSpillOffset());
+ }
+
AFI->setGPRCalleeSavedArea1Size(GPRCS1Size);
AFI->setGPRCalleeSavedArea2Size(GPRCS2Size);
AFI->setDPRCalleeSavedAreaSize(DPRCSSize);
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 735790c237..c7cf074b4e 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -63,8 +63,25 @@ ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
} else {
+ NeedsSet = false;
+ HasLEB128 = true;
+ AbsoluteDebugSectionOffsets = true;
+ ReadOnlySection = "\t.section\t.rodata\n";
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
+ DwarfRequiresFrameSection = false;
+ DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits";
+ DwarfInfoSection = "\t.section\t.debug_info,\"\",%progbits";
+ DwarfLineSection = "\t.section\t.debug_line,\"\",%progbits";
+ DwarfFrameSection = "\t.section\t.debug_frame,\"\",%progbits";
+ DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits";
+ DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits";
+ DwarfStrSection = "\t.section\t.debug_str,\"\",%progbits";
+ DwarfLocSection = "\t.section\t.debug_loc,\"\",%progbits";
+ DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits";
+ DwarfRangesSection = "\t.section\t.debug_ranges,\"\",%progbits";
+ DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits";
+
if (Subtarget->isAAPCS_ABI()) {
StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array";
StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array";