From c8fcfc9cd9c0940e8afdaba8b815f8f489b457ba Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 19 Jul 2011 22:31:15 +0000 Subject: 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 --- lib/Analysis/DebugInfo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Analysis/DebugInfo.cpp') 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 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. //===----------------------------------------------------------------------===// -- cgit v1.2.3