Index: lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
===================================================================
--- lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp	(revision 80953)
+++ lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp	(working copy)
@@ -44,6 +44,8 @@
 
 namespace {
   class VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
+    DwarfWriter *DW;
+
     /// We name each basic block in a Function with a unique number, so
     /// that we can consistently refer to them later. This is cleared
     /// at the beginning of each call to runOnMachineFunction().
@@ -54,7 +56,7 @@
   public:
     explicit SparcAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
                              const MCAsmInfo *T, bool V)
-      : AsmPrinter(O, TM, T, V), BBNumber(0) {}
+      : AsmPrinter(O, TM, T, V), DW(0), BBNumber(0) {}
 
     virtual const char *getPassName() const {
       return "Sparc Assembly Printer";
@@ -72,6 +74,7 @@
                        unsigned AsmVariant, const char *ExtraCode);
     bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
                              unsigned AsmVariant, const char *ExtraCode);
+    bool doInitialization(Module &M);
   };
 } // end of anonymous namespace
 
@@ -104,6 +107,8 @@
 
   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 +135,9 @@
     }
   }
 
+  // Emit post-function debug information.
+  DW->EndFunction(&MF);
+
   // We didn't modify anything.
   return false;
 }
@@ -210,6 +218,12 @@
   O << SPARCCondCodeToString((SPCC::CondCodes)CC);
 }
 
+bool SparcAsmPrinter::doInitialization(Module &M) {
+  bool Result = AsmPrinter::doInitialization(M);
+  DW = getAnalysisIfAvailable<DwarfWriter>();
+  return Result;
+}
+
 void SparcAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
   const TargetData *TD = TM.getTargetData();
 
Index: lib/Target/Sparc/SparcMCAsmInfo.cpp
===================================================================
--- lib/Target/Sparc/SparcMCAsmInfo.cpp	(revision 80953)
+++ lib/Target/Sparc/SparcMCAsmInfo.cpp	(working copy)
@@ -22,6 +22,9 @@
   ZeroDirective = "\t.skip\t";
   CommentString = "!";
   COMMDirectiveTakesAlignment = true;
+  HasLEB128 = true;
+  AbsoluteDebugSectionOffsets = true;
+  SupportsDebugInformation = true;
   
   SunStyleELFSectionSwitchSyntax = true;
   UsesELFSectionDirectiveForBSS = true;
Index: lib/Target/Sparc/SparcRegisterInfo.cpp
===================================================================
--- lib/Target/Sparc/SparcRegisterInfo.cpp	(revision 80953)
+++ lib/Target/Sparc/SparcRegisterInfo.cpp	(working copy)
@@ -169,13 +169,11 @@
 }
 
 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 @@
 }
 
 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"
