summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-03-21 20:28:52 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-03-21 20:28:52 +0000
commitcc8d0901630b34628de4da76529a575816c7cb53 (patch)
tree962e7191ad1bab84191e6ed0bba857fc219374bb /llvm/lib/IR
parent8ad22a37af197f443d8db7c839327c34029f3767 (diff)
downloadbcm5719-llvm-cc8d0901630b34628de4da76529a575816c7cb53.tar.gz
bcm5719-llvm-cc8d0901630b34628de4da76529a575816c7cb53.zip
Remove unused field in DISubprogram
llvm-svn: 177661
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp10
-rw-r--r--llvm/lib/IR/DebugInfo.cpp14
2 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 63f7ba5df7c..f1cdccf2110 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -908,7 +908,6 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
- Constant::getNullValue(Type::getInt32Ty(VMContext)),
getNonCompileUnitScope(Context),
MDString::get(VMContext, Name),
MDString::get(VMContext, Name),
@@ -934,7 +933,9 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
// Create a named metadata so that we do not lose this mdnode.
if (isDefinition)
AllSubprograms.push_back(Node);
- return DISubprogram(Node);
+ DISubprogram S(Node);
+ assert(S.Verify() && "createFunction should return a valid DISubprogram");
+ return S;
}
/// createMethod - Create a new descriptor for the specified C++ method.
@@ -954,7 +955,6 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
- Constant::getNullValue(Type::getInt32Ty(VMContext)),
getNonCompileUnitScope(Context),
MDString::get(VMContext, Name),
MDString::get(VMContext, Name),
@@ -979,7 +979,9 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
MDNode *Node = MDNode::get(VMContext, Elts);
if (isDefinition)
AllSubprograms.push_back(Node);
- return DISubprogram(Node);
+ DISubprogram S(Node);
+ assert(S.Verify() && "createMethod should return a valid DISubprogram");
+ return S;
}
/// createNameSpace - This creates new descriptor for a namespace
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 701cf1fdd30..bc5e415eea6 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -485,7 +485,7 @@ bool DISubprogram::Verify() const {
DICompositeType Ty = getType();
if (!Ty.Verify())
return false;
- return DbgNode->getNumOperands() == 21;
+ return DbgNode->getNumOperands() == 20;
}
/// Verify - Verify that a global variable descriptor is well formed.
@@ -642,21 +642,21 @@ bool DISubprogram::describes(const Function *F) {
unsigned DISubprogram::isOptimized() const {
assert (DbgNode && "Invalid subprogram descriptor!");
- if (DbgNode->getNumOperands() == 16)
- return getUnsignedField(15);
+ if (DbgNode->getNumOperands() == 15)
+ return getUnsignedField(14);
return 0;
}
MDNode *DISubprogram::getVariablesNodes() const {
- if (!DbgNode || DbgNode->getNumOperands() <= 19)
+ if (!DbgNode || DbgNode->getNumOperands() <= 18)
return NULL;
- return dyn_cast_or_null<MDNode>(DbgNode->getOperand(19));
+ return dyn_cast_or_null<MDNode>(DbgNode->getOperand(18));
}
DIArray DISubprogram::getVariables() const {
- if (!DbgNode || DbgNode->getNumOperands() <= 19)
+ if (!DbgNode || DbgNode->getNumOperands() <= 18)
return DIArray();
- if (MDNode *T = dyn_cast_or_null<MDNode>(DbgNode->getOperand(19)))
+ if (MDNode *T = dyn_cast_or_null<MDNode>(DbgNode->getOperand(18)))
return DIArray(T);
return DIArray();
}
OpenPOWER on IntegriCloud