Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.54 -> 1.55 --- Log message: Make sure that debug labels are defined within the same section and after the entry point of a function. --- Diffs of the changes: (+5 -8) DwarfWriter.cpp | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.54 llvm/lib/CodeGen/DwarfWriter.cpp:1.55 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.54 Fri Apr 7 11:34:45 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Fri Apr 7 15:44:42 2006 @@ -1626,15 +1626,13 @@ CompileUnitDesc *UnitDesc = static_cast<CompileUnitDesc *>(SPD->getContext()); CompileUnit *Unit = FindCompileUnit(UnitDesc); - // Generate the mangled name. - std::string MangledName = Asm->Mang->getValueName(MF->getFunction()); - // Get the subprogram die. DIE *SPDie = Unit->getDieMapSlotFor(SPD); assert(SPDie && "Missing subprogram descriptor"); // Add the function bounds. - SPDie->AddObjectLabel(DW_AT_low_pc, DW_FORM_addr, MangledName); + SPDie->AddLabel(DW_AT_low_pc, DW_FORM_addr, + DWLabel("func_begin", SubprogramCount)); SPDie->AddLabel(DW_AT_high_pc, DW_FORM_addr, DWLabel("func_end", SubprogramCount)); MachineLocation Location(RI->getFrameRegister(*MF)); @@ -2408,8 +2406,8 @@ EmitDebugMacInfo(); } -/// BeginFunction - Gather pre-function debug information. -/// +/// BeginFunction - Gather pre-function debug information. Assumes being +/// emitted immediately after the function entry point. void DwarfWriter::BeginFunction(MachineFunction *MF) { this->MF = MF; @@ -2419,8 +2417,7 @@ if (!ShouldEmitDwarf()) return; EOL("Dwarf Begin Function"); - // Define begin label for subprogram. - Asm->SwitchSection(TextSection, 0); + // Assumes in correct section after the entry point. EmitLabel("func_begin", ++SubprogramCount); } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits