summaryrefslogtreecommitdiff
path: root/lib
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
commit4159733c1a9a6f4aea6ea4d558ca4806a3f959d2 (patch)
treeb675d616bb766ffd11477da9ea8449685328f2d6 /lib
parentff64b7d7e36b55ecb3cce38f08f60fce7892b269 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/DIBuilder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index ffac183928e..bdbba1b36e3 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/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),