summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-04-07 20:44:42 +0000
committerJim Laskey <jlaskey@mac.com>2006-04-07 20:44:42 +0000
commitc0d6518f276cd4980e9dd2433572846bc55480ef (patch)
treecc500cf2e4ab9a7098f1d2dccef20c8fb1401b7b /llvm/lib/CodeGen
parent292574fbbc4682cd765dfddf8836053a479085c0 (diff)
downloadbcm5719-llvm-c0d6518f276cd4980e9dd2433572846bc55480ef.tar.gz
bcm5719-llvm-c0d6518f276cd4980e9dd2433572846bc55480ef.zip
Make sure that debug labels are defined within the same section and after the
entry point of a function. llvm-svn: 27494
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/DwarfWriter.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp
index 19b1d8409c6..ab00a998530 100644
--- a/llvm/lib/CodeGen/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/DwarfWriter.cpp
@@ -1626,15 +1626,13 @@ void DwarfWriter::ConstructRootScope(DebugScope *RootScope) {
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 @@ void DwarfWriter::EndModule() {
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 @@ void DwarfWriter::BeginFunction(MachineFunction *MF) {
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);
}
OpenPOWER on IntegriCloud