1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

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
This commit is contained in:
Eric Christopher 2013-10-15 23:31:36 +00:00
parent 772fd268c4
commit f506a0ede8

View File

@ -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),