aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/DebugInfo.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index b061827c32..3d9c93378f 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -955,9 +955,7 @@ void DebugInfoFinder::processModule(Module &M) {
/// processType - Process DIType.
void DebugInfoFinder::processType(DIType DT) {
- if (DT.isNull())
- return;
- if (!NodesSeen.insert(DT.getGV()))
+ if (!addType(DT))
return;
addCompileUnit(DT.getCompileUnit());
@@ -1028,6 +1026,18 @@ void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) {
processType(DV.getType());
}
+/// addType - Add type into Tys.
+bool DebugInfoFinder::addType(DIType DT) {
+ if (DT.isNull())
+ return false;
+
+ if (!NodesSeen.insert(DT.getGV()))
+ return false;
+
+ TYs.push_back(DT.getGV());
+ return true;
+}
+
/// addCompileUnit - Add compile unit into CUs.
bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) {
if (CU.isNull())