summaryrefslogtreecommitdiff
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-08-10 21:50:54 +0000
committerDevang Patel <dpatel@apple.com>2011-08-10 21:50:54 +0000
commitb549bcfe6c19dbb24162c75bbcc06d4a5fa90cb8 (patch)
tree93e9f8ad8dbecdfc7d0843923b336a39aa05666f /lib/Analysis/DebugInfo.cpp
parentc722c3d5ffd4ad07e17f81c2b2eb7f8074559600 (diff)
downloadllvm-b549bcfe6c19dbb24162c75bbcc06d4a5fa90cb8.tar.gz
llvm-b549bcfe6c19dbb24162c75bbcc06d4a5fa90cb8.tar.bz2
llvm-b549bcfe6c19dbb24162c75bbcc06d4a5fa90cb8.tar.xz
Distinguish between two copies of one inlined variable. Take 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137253 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 b243772a01..77dca1d947 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -818,6 +818,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.
//===----------------------------------------------------------------------===//