diff options
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r-- | lib/IR/DIBuilder.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index ffac183..bdbba1b 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), |