aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-05-20 23:28:48 +0000
committerBill Wendling <isanbard@gmail.com>2009-05-20 23:28:48 +0000
commit065d8473bc3b511dd90e8f551d9ffe6a14dfd9e2 (patch)
tree1d65676b16cfa4355f21224bb6d8161169769be0 /lib/CodeGen/AsmPrinter
parent0d3db8b07e2638cb8a0e005ff08dd824e851d1c7 (diff)
downloadexternal_llvm-065d8473bc3b511dd90e8f551d9ffe6a14dfd9e2.zip
external_llvm-065d8473bc3b511dd90e8f551d9ffe6a14dfd9e2.tar.gz
external_llvm-065d8473bc3b511dd90e8f551d9ffe6a14dfd9e2.tar.bz2
Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp47
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h8
2 files changed, 14 insertions, 41 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index ec4602d..bdbb988 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1092,7 +1092,8 @@ void DwarfDebug::ConstructDbgScope(DbgScope *ParentScope,
/// 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 @@ void DwarfDebug::ConstructFunctionDbgScope(DbgScope *RootScope) {
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 @@ void DwarfDebug::EndFunction(MachineFunction *MF) {
for (SmallVector<DbgScope *, 32>::iterator
I = AbstractInstanceRootList.begin(),
E = AbstractInstanceRootList.end(); I != E; ++I)
- ConstructAbstractDbgScope(*I);
+ ConstructFunctionDbgScope(*I);
// Construct scopes for subprogram.
if (FunctionDbgScope)
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index d81ebbf..9824566 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -355,12 +355,8 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
/// 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.
///