Add source debug information to the Sparc code generator.
authorRichard Pennington <rich@pennware.com>
Tue, 8 Sep 2009 12:47:30 +0000 (12:47 +0000)
committerRichard Pennington <rich@pennware.com>
Tue, 8 Sep 2009 12:47:30 +0000 (12:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
lib/Target/Sparc/SparcMCAsmInfo.cpp
lib/Target/Sparc/SparcRegisterInfo.cpp

index b94b71800b6283fcda30716fc5e8c62f8967fda7..e608f7ec37a3df5bb60a43c8a7e0bbb68c0410df 100644 (file)
@@ -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;
 }
index c45d124a1c6be36e71aed689362a1ed3628733b4..b67537c17881c36120c91aad250adc51f83223f5 100644 (file)
@@ -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;
index 2acce3d15b79ffde9874ac38a1e2ab5b1a18149d..a99592f3d8ef8a57fc94eefa01896041209c272f 100644 (file)
@@ -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"