Keep track of MCSymbol used to mark beginning of a function.
authorDevang Patel <dpatel@apple.com>
Thu, 22 Apr 2010 18:39:21 +0000 (18:39 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 22 Apr 2010 18:39:21 +0000 (18:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102104 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h

index b245e45f3c17032a661ad6ba4fc37f7b53a4d0b8..676a96acfc44e51e96a178300270cb954dca913f 100644 (file)
@@ -330,6 +330,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
   DwarfFrameSectionSym = DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0;
   DwarfStrSectionSym = TextSectionSym = 0;
   DwarfDebugRangeSectionSym = 0;
+  FunctionBeginSym = 0;
   if (TimePassesIsEnabled) {
       NamedRegionTimer T(DbgTimerName, DWARFGroupName);
       beginModule(M);
@@ -2444,9 +2445,10 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
   
   collectVariableInfo();
 
+  FunctionBeginSym = Asm->GetTempSymbol("func_begin",
+                                        Asm->getFunctionNumber());
   // Assumes in correct section after the entry point.
-  Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("func_begin",
-                                                Asm->getFunctionNumber()));
+  Asm->OutStreamer.EmitLabel(FunctionBeginSym);
 
   // Emit label for the implicitly defined dbg.stoppoint at the start of the
   // function.
index 4ae768abae6412503f7b93ac58a15ebfe970edc8..380f2014c23c97b59a08f1304e0be4204b12b97e 100644 (file)
@@ -218,7 +218,8 @@ class DwarfDebug {
   // section offsets and are created by EmitSectionLabels.
   MCSymbol *DwarfFrameSectionSym, *DwarfInfoSectionSym, *DwarfAbbrevSectionSym;
   MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym;
-  
+
+  MCSymbol *FunctionBeginSym;
 private:
   
   /// getSourceDirectoryAndFileIds - Return the directory and file ids that