diff options
author | Devang Patel <dpatel@apple.com> | 2011-07-19 22:31:15 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-07-19 22:31:15 +0000 |
commit | a59b24b090cd4273f7a246f3d886fe8496266fe3 (patch) | |
tree | e2a2db0ba292336a2b96f5865fa6946b198064fd /llvm/lib/Analysis | |
parent | 97094d8f060ff6dcf0e7aa95224a6f388a772351 (diff) | |
download | bcm5719-llvm-a59b24b090cd4273f7a246f3d886fe8496266fe3.tar.gz bcm5719-llvm-a59b24b090cd4273f7a246f3d886fe8496266fe3.zip |
Distinguish between two copies of one inlined variable.
llvm-svn: 135528
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 8fac3fb7218..4dcf04ef216 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/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. //===----------------------------------------------------------------------===// |