summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-04-30 19:38:23 +0000
committerDevang Patel <dpatel@apple.com>2010-04-30 19:38:23 +0000
commitb4e3b9025cac155d16215c6f1342c925088ddb89 (patch)
tree9132569ab3268b785abb618df259a7e1391e8b31 /llvm/lib/Analysis
parent8acc8f7dfdcefae6c8d4a3cdeb625b58f5d87000 (diff)
downloadbcm5719-llvm-b4e3b9025cac155d16215c6f1342c925088ddb89.tar.gz
bcm5719-llvm-b4e3b9025cac155d16215c6f1342c925088ddb89.zip
Attach AT_APPLE_optimized attribute to optimized function's debug info.
llvm-svn: 102743
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index d33bb6042b2..8d5a3c7ed7b 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -425,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();
@@ -912,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),
@@ -929,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
@@ -956,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.
OpenPOWER on IntegriCloud