diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-18 20:30:45 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-18 20:30:45 +0000 |
commit | 89b075e53a42fdcf22f249bbe64b064ca5f4ae84 (patch) | |
tree | 8a14fadc958539395583414e675f098bf882cb19 /llvm/lib/IR/DIBuilder.cpp | |
parent | 67bf4bd3161fe335da6d7918d00b66828d6f9b92 (diff) | |
download | bcm5719-llvm-89b075e53a42fdcf22f249bbe64b064ca5f4ae84.tar.gz bcm5719-llvm-89b075e53a42fdcf22f249bbe64b064ca5f4ae84.zip |
IR: Drop the scope in DI template parameters
The scope/context is always the compile unit, which we replace with
`nullptr` anyway (via `getNonCompileUnitScope()`). Drop it explicitly.
I noticed this field was always null while writing testcase upgrade
scripts to transition to the new hierarchy. Seems wasteful to
transition it over if it's already out-of-use.
llvm-svn: 229740
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index f193e5331dd..2cb27cae144 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -503,13 +503,14 @@ DIBuilder::createObjCProperty(StringRef Name, DIFile File, unsigned LineNumber, DITemplateTypeParameter DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name, DIType Ty) { + assert(!DIScope(getNonCompileUnitScope(Context)).getRef() && + "Expected compile unit"); Metadata *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_template_type_parameter) .concat(Name) .concat(0) .concat(0) .get(VMContext), - DIScope(getNonCompileUnitScope(Context)).getRef(), - Ty.getRef(), nullptr}; + nullptr, Ty.getRef(), nullptr}; return DITemplateTypeParameter(MDNode::get(VMContext, Elts)); } @@ -517,10 +518,11 @@ static DITemplateValueParameter createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag, DIDescriptor Context, StringRef Name, DIType Ty, Metadata *MD) { + assert(!DIScope(getNonCompileUnitScope(Context)).getRef() && + "Expected compile unit"); Metadata *Elts[] = { HeaderBuilder::get(Tag).concat(Name).concat(0).concat(0).get(VMContext), - DIScope(getNonCompileUnitScope(Context)).getRef(), Ty.getRef(), MD, - nullptr}; + nullptr, Ty.getRef(), MD, nullptr}; return DITemplateValueParameter(MDNode::get(VMContext, Elts)); } |