summaryrefslogtreecommitdiff
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-07-19 22:31:15 +0000
committerDevang Patel <dpatel@apple.com>2011-07-19 22:31:15 +0000
commitc8fcfc9cd9c0940e8afdaba8b815f8f489b457ba (patch)
tree15388a01e5f814adf55d45af3d3fc596f87d361b /lib/Analysis/DebugInfo.cpp
parent80d01dd3d19a84621324ac444c6749602df7a513 (diff)
downloadllvm-c8fcfc9cd9c0940e8afdaba8b815f8f489b457ba.tar.gz
llvm-c8fcfc9cd9c0940e8afdaba8b815f8f489b457ba.tar.bz2
llvm-c8fcfc9cd9c0940e8afdaba8b815f8f489b457ba.tar.xz
Distinguish between two copies of one inlined variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 8fac3fb721..4dcf04ef21 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -776,6 +776,17 @@ DIVariable llvm::createInlinedVariable(MDNode *DV, MDNode *InlinedScope,
return DIVariable(MDNode::get(VMContext, Elts));
}
+/// cleanseInlinedVariable - Remove inlined scope from the variable.
+DIVariable llvm::cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext) {
+ SmallVector<Value *, 16> Elts;
+ // Insert inlined scope as 7th element.
+ for (unsigned i = 0, e = DV->getNumOperands(); i != e; ++i)
+ i == 7 ?
+ Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext))):
+ Elts.push_back(DV->getOperand(i));
+ return DIVariable(MDNode::get(VMContext, Elts));
+}
+
//===----------------------------------------------------------------------===//
// DebugInfoFinder implementations.
//===----------------------------------------------------------------------===//