summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-10-15 23:31:36 +0000
committerEric Christopher <echristo@gmail.com>2013-10-15 23:31:36 +0000
commit5cb56322b8831e9d4502c4acd157ea45b01c88cc (patch)
tree3135209ca6bbf39dd9144de1e2f2a65a28074614 /llvm
parent98f9c23614ed26833ab431b0052fbdd22e07c774 (diff)
downloadbcm5719-llvm-5cb56322b8831e9d4502c4acd157ea45b01c88cc.tar.gz
bcm5719-llvm-5cb56322b8831e9d4502c4acd157ea45b01c88cc.zip
Add an assert that we have a scope that matters for methods
and remove a call to getNonCompileUnitScope as a method shouldn't be in the compile unit scope. llvm-svn: 192748
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index ffac183928e..bdbba1b36e3 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -1113,11 +1113,14 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context, StringRef Name,
MDNode *TParam) {
assert(Ty.getTag() == dwarf::DW_TAG_subroutine_type &&
"function types should be subroutines");
+ assert(getNonCompileUnitScope(Context) &&
+ "Methods should have both a Context and a context that isn't "
+ "the compile unit.");
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
F.getFileNode(),
- DIScope(getNonCompileUnitScope(Context)).getRef(),
+ DIScope(Context).getRef(),
MDString::get(VMContext, Name),
MDString::get(VMContext, Name),
MDString::get(VMContext, LinkageName),
OpenPOWER on IntegriCloud