summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-04-08 15:37:09 +0000
committerDevang Patel <dpatel@apple.com>2010-04-08 15:37:09 +0000
commit6122a4d1c0c73c1d2d5754c50c68d1dc4ae6f70f (patch)
treecdc75eb7ce6e718194194acab50f7066752ec987 /lib
parent454c4ce47963861a6bf159c2700e5a3059fbc298 (diff)
downloadllvm-6122a4d1c0c73c1d2d5754c50c68d1dc4ae6f70f.tar.gz
llvm-6122a4d1c0c73c1d2d5754c50c68d1dc4ae6f70f.tar.bz2
llvm-6122a4d1c0c73c1d2d5754c50c68d1dc4ae6f70f.tar.xz
Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp12
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h5
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 259167b809..b1e190c3f5 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2268,6 +2268,16 @@ bool DwarfDebug::extractScopeInformation() {
CurrentFnDbgScope->fixInstructionMarkers(MIIndexMap);
+ populateDbgScopeInverseMaps();
+
+ return !DbgScopeMap.empty();
+}
+
+/// populateDbgScopeInverseMaps() - Populate DbgScopeBeginMap and
+/// DbgScopeEndMap. This maps are used to indentify debug scope started
+/// and ended by an instruction.
+void DwarfDebug::populateDbgScopeInverseMaps() {
+
// Each scope has first instruction and last instruction to mark beginning
// and end of a scope respectively. Create an inverse map that list scopes
// starts (and ends) with an instruction. One instruction may start (or end)
@@ -2302,8 +2312,6 @@ bool DwarfDebug::extractScopeInformation() {
else
DbgScopeEndMap[MI].push_back(S);
}
-
- return !DbgScopeMap.empty();
}
/// beginFunction - Gather pre-function debug information. Assumes being
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 006ee2d755..6d72564605 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -527,6 +527,11 @@ private:
return Lines.size();
}
+ /// populateDbgScopeInverseMaps() - Populate DbgScopeBeginMap and
+ /// DbgScopeEndMap. This maps are used to indentify debug scope started
+ /// and ended by an instruction.
+ void populateDbgScopeInverseMaps();
+
/// extractScopeInformation - Scan machine instructions in this function
/// and collect DbgScopes. Return true, if atleast one scope was found.
bool extractScopeInformation();