[llvm-commits] [llvm] r72197 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h
Bill Wendling
isanbard at gmail.com
Wed May 20 16:28:57 PDT 2009
Author: void
Date: Wed May 20 18:28:48 2009
New Revision: 72197
URL: http://llvm.org/viewvc/llvm-project?rev=72197&view=rev
Log:
Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=72197&r1=72196&r2=72197&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed May 20 18:28:48 2009
@@ -1092,7 +1092,8 @@
/// ConstructFunctionDbgScope - Construct the scope for the subprogram.
///
-void DwarfDebug::ConstructFunctionDbgScope(DbgScope *RootScope) {
+void DwarfDebug::ConstructFunctionDbgScope(DbgScope *RootScope,
+ bool AbstractScope) {
// Exit if there is no root scope.
if (!RootScope) return;
DIDescriptor Desc = RootScope->getDesc();
@@ -1111,43 +1112,19 @@
DIE *SPDie = Unit->getDieMapSlotFor(SPD.getGV());
assert(SPDie && "Missing subprogram descriptor");
- // Add the function bounds.
- AddLabel(SPDie, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr,
- DWLabel("func_begin", SubprogramCount));
- AddLabel(SPDie, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr,
- DWLabel("func_end", SubprogramCount));
- MachineLocation Location(RI->getFrameRegister(*MF));
- AddAddress(SPDie, dwarf::DW_AT_frame_base, Location);
+ if (!AbstractScope) {
+ // Add the function bounds.
+ AddLabel(SPDie, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr,
+ DWLabel("func_begin", SubprogramCount));
+ AddLabel(SPDie, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr,
+ DWLabel("func_end", SubprogramCount));
+ MachineLocation Location(RI->getFrameRegister(*MF));
+ AddAddress(SPDie, dwarf::DW_AT_frame_base, Location);
+ }
ConstructDbgScope(RootScope, 0, 0, SPDie, Unit);
}
-/// ConstructFunctionDbgScope - Construct the scope for the abstract debug
-/// scope.
-///
-void DwarfDebug::ConstructAbstractDbgScope(DbgScope *AbsScope) {
- // Exit if there is no root scope.
- if (!AbsScope) return;
-
- DIDescriptor Desc = AbsScope->getDesc();
- if (Desc.isNull())
- return;
-
- // Get the subprogram debug information entry.
- DISubprogram SPD(Desc.getGV());
-
- // Get the compile unit context.
- CompileUnit *Unit = MainCU;
- if (!Unit)
- Unit = &FindCompileUnit(SPD.getCompileUnit());
-
- // Get the subprogram die.
- DIE *SPDie = Unit->getDieMapSlotFor(SPD.getGV());
- assert(SPDie && "Missing subprogram descriptor");
-
- ConstructDbgScope(AbsScope, 0, 0, SPDie, Unit);
-}
-
/// ConstructDefaultDbgScope - Construct a default scope for the subprogram.
///
void DwarfDebug::ConstructDefaultDbgScope(MachineFunction *MF) {
@@ -1587,7 +1564,7 @@
for (SmallVector<DbgScope *, 32>::iterator
I = AbstractInstanceRootList.begin(),
E = AbstractInstanceRootList.end(); I != E; ++I)
- ConstructAbstractDbgScope(*I);
+ ConstructFunctionDbgScope(*I);
// Construct scopes for subprogram.
if (FunctionDbgScope)
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=72197&r1=72196&r2=72197&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed May 20 18:28:48 2009
@@ -355,12 +355,8 @@
/// ConstructFunctionDbgScope - Construct the scope for the subprogram.
///
- void ConstructFunctionDbgScope(DbgScope *RootScope);
-
- /// ConstructFunctionDbgScope - Construct the scope for the abstract debug
- /// scope.
- ///
- void ConstructAbstractDbgScope(DbgScope *AbsScope);
+ void ConstructFunctionDbgScope(DbgScope *RootScope,
+ bool AbstractScope = false);
/// ConstructDefaultDbgScope - Construct a default scope for the subprogram.
///
More information about the llvm-commits
mailing list