summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitbb23a4a9a5eb85f6fe2a8d66fc01afb58ae42515 (patch)
tree521772c71601bb601a331411132bb4d09c274f6a /llvm/lib/Analysis/DebugInfo.cpp
parent93db2277e6e993edfbbec97876abd3f327610e44 (diff)
downloadbcm5719-llvm-bb23a4a9a5eb85f6fe2a8d66fc01afb58ae42515.tar.gz
bcm5719-llvm-bb23a4a9a5eb85f6fe2a8d66fc01afb58ae42515.zip
Distinguish between two copies of one inlined variable. Take 2.
llvm-svn: 137253
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index b243772a016..77dca1d9478 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/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.
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud