summaryrefslogtreecommitdiff
path: root/lib/Target/Sparc
diff options
context:
space:
mode:
authorRichard Pennington <rich@pennware.com>2009-09-08 12:47:30 +0000
committerRichard Pennington <rich@pennware.com>2009-09-08 12:47:30 +0000
commit930e4d96e8718abcb56212676c35e6f7ea0ab605 (patch)
tree0cd37e192575757adc053e2ca1abfc050e638d61 /lib/Target/Sparc
parent22f35ace4599f28f50159cf0e19436e755669340 (diff)
downloadllvm-930e4d96e8718abcb56212676c35e6f7ea0ab605.tar.gz
llvm-930e4d96e8718abcb56212676c35e6f7ea0ab605.tar.bz2
llvm-930e4d96e8718abcb56212676c35e6f7ea0ab605.tar.xz
Add source debug information to the Sparc code generator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r--lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp5
-rw-r--r--lib/Target/Sparc/SparcMCAsmInfo.cpp3
-rw-r--r--lib/Target/Sparc/SparcRegisterInfo.cpp9
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
index b94b71800b..e608f7ec37 100644
--- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
@@ -104,6 +104,8 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
O << "\t.type\t" << CurrentFnName << ", #function\n";
O << CurrentFnName << ":\n";
+ // Emit pre-function debug information.
+ DW->BeginFunction(&MF);
// Number each basic block so that we can consistently refer to them
// in PC-relative references.
@@ -130,6 +132,9 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
}
}
+ // Emit post-function debug information.
+ DW->EndFunction(&MF);
+
// We didn't modify anything.
return false;
}
diff --git a/lib/Target/Sparc/SparcMCAsmInfo.cpp b/lib/Target/Sparc/SparcMCAsmInfo.cpp
index c45d124a1c..b67537c178 100644
--- a/lib/Target/Sparc/SparcMCAsmInfo.cpp
+++ b/lib/Target/Sparc/SparcMCAsmInfo.cpp
@@ -22,6 +22,9 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) {
ZeroDirective = "\t.skip\t";
CommentString = "!";
COMMDirectiveTakesAlignment = true;
+ HasLEB128 = true;
+ AbsoluteDebugSectionOffsets = true;
+ SupportsDebugInformation = true;
SunStyleELFSectionSwitchSyntax = true;
UsesELFSectionDirectiveForBSS = true;
diff --git a/lib/Target/Sparc/SparcRegisterInfo.cpp b/lib/Target/Sparc/SparcRegisterInfo.cpp
index 2acce3d15b..a99592f3d8 100644
--- a/lib/Target/Sparc/SparcRegisterInfo.cpp
+++ b/lib/Target/Sparc/SparcRegisterInfo.cpp
@@ -169,13 +169,11 @@ void SparcRegisterInfo::emitEpilogue(MachineFunction &MF,
}
unsigned SparcRegisterInfo::getRARegister() const {
- llvm_unreachable("What is the return address register");
- return 0;
+ return SP::I7;
}
unsigned SparcRegisterInfo::getFrameRegister(MachineFunction &MF) const {
- llvm_unreachable("What is the frame register");
- return SP::G1;
+ return SP::I6;
}
unsigned SparcRegisterInfo::getEHExceptionRegister() const {
@@ -189,8 +187,7 @@ unsigned SparcRegisterInfo::getEHHandlerRegister() const {
}
int SparcRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
- llvm_unreachable("What is the dwarf register number");
- return -1;
+ return SparcGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
#include "SparcGenRegisterInfo.inc"