diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:11:02 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:11:02 +0000 |
commit | 750ce4d809c7e2a298a389a512a17652ff5be3f2 (patch) | |
tree | 70fbd90da02177c8e6ef82adba9fa8ace285a5e3 /lib/Analysis/DebugInfo.cpp | |
parent | 5f970ec96e421f64db6b1c6509a902ea73d98cc7 (diff) | |
download | FreeBSD-src-750ce4d809c7e2a298a389a512a17652ff5be3f2.zip FreeBSD-src-750ce4d809c7e2a298a389a512a17652ff5be3f2.tar.gz |
Update LLVM to r103004.
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 8ba1902..141b181 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -402,6 +402,17 @@ uint64_t DIDerivedType::getOriginalTypeSize() const { return getSizeInBits(); } +/// isInlinedFnArgument - Return trule if this variable provides debugging +/// information for an inlined function arguments. +bool DIVariable::isInlinedFnArgument(const Function *CurFn) { + assert(CurFn && "Invalid function"); + if (!getContext().isSubprogram()) + return false; + // This variable is not inlined function argument if its scope + // does not describe current function. + return !(DISubprogram(getContext().getNode()).describes(CurFn)); +} + /// describes - Return true if this subprogram provides debugging /// information for the function F. bool DISubprogram::describes(const Function *F) { @@ -414,6 +425,13 @@ bool DISubprogram::describes(const Function *F) { return false; } +unsigned DISubprogram::isOptimized() const { + assert (DbgNode && "Invalid subprogram descriptor!"); + if (DbgNode->getNumOperands() == 16) + return getUnsignedField(15); + return 0; +} + StringRef DIScope::getFilename() const { if (!DbgNode) return StringRef(); @@ -901,7 +919,8 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context, bool isDefinition, unsigned VK, unsigned VIndex, DIType ContainingType, - bool isArtificial) { + bool isArtificial, + bool isOptimized) { Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_subprogram), @@ -918,9 +937,10 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context, ConstantInt::get(Type::getInt32Ty(VMContext), (unsigned)VK), ConstantInt::get(Type::getInt32Ty(VMContext), VIndex), ContainingType.getNode(), - ConstantInt::get(Type::getInt1Ty(VMContext), isArtificial) + ConstantInt::get(Type::getInt1Ty(VMContext), isArtificial), + ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized) }; - return DISubprogram(MDNode::get(VMContext, &Elts[0], 15)); + return DISubprogram(MDNode::get(VMContext, &Elts[0], 16)); } /// CreateSubprogramDefinition - Create new subprogram descriptor for the @@ -945,9 +965,10 @@ DISubprogram DIFactory::CreateSubprogramDefinition(DISubprogram &SPDeclaration) DeclNode->getOperand(11), // Virtuality DeclNode->getOperand(12), // VIndex DeclNode->getOperand(13), // Containting Type - DeclNode->getOperand(14) // isArtificial + DeclNode->getOperand(14), // isArtificial + DeclNode->getOperand(15) // isOptimized }; - return DISubprogram(MDNode::get(VMContext, &Elts[0], 15)); + return DISubprogram(MDNode::get(VMContext, &Elts[0], 16)); } /// CreateGlobalVariable - Create a new descriptor for the specified global. @@ -1150,10 +1171,8 @@ void DebugInfoFinder::processModule(Module &M) { for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI) for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE; ++BI) { - if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) { + if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) processDeclare(DDI); - continue; - } DebugLoc Loc = BI->getDebugLoc(); if (Loc.isUnknown()) |