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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229740
91177308-0d34-0410-b5e6-
96231b3b80d8
StringRef getName() const { return getHeaderField(1); }
StringRef getName() const { return getHeaderField(1); }
- DIScopeRef getContext() const { return getFieldAs<DIScopeRef>(1); }
DITypeRef getType() const { return getFieldAs<DITypeRef>(2); }
bool Verify() const;
};
DITypeRef getType() const { return getFieldAs<DITypeRef>(2); }
bool Verify() const;
};
StringRef getName() const { return getHeaderField(1); }
StringRef getName() const { return getHeaderField(1); }
- DIScopeRef getContext() const { return getFieldAs<DIScopeRef>(1); }
DITypeRef getType() const { return getFieldAs<DITypeRef>(2); }
Metadata *getValue() const;
bool Verify() const;
DITypeRef getType() const { return getFieldAs<DITypeRef>(2); }
Metadata *getValue() const;
bool Verify() const;
DITemplateTypeParameter
DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name,
DIType Ty) {
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),
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));
}
return DITemplateTypeParameter(MDNode::get(VMContext, Elts));
}
createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag,
DIDescriptor Context, StringRef Name,
DIType Ty, Metadata *MD) {
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),
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));
}
return DITemplateValueParameter(MDNode::get(VMContext, Elts));
}
DIDescriptor Element = TParams.getElement(I);
if (Element.isTemplateTypeParameter()) {
DITemplateTypeParameter TType(Element);
DIDescriptor Element = TParams.getElement(I);
if (Element.isTemplateTypeParameter()) {
DITemplateTypeParameter TType(Element);
- processScope(TType.getContext().resolve(TypeIdentifierMap));
processType(TType.getType().resolve(TypeIdentifierMap));
} else if (Element.isTemplateValueParameter()) {
DITemplateValueParameter TVal(Element);
processType(TType.getType().resolve(TypeIdentifierMap));
} else if (Element.isTemplateValueParameter()) {
DITemplateValueParameter TVal(Element);
- processScope(TVal.getContext().resolve(TypeIdentifierMap));
processType(TVal.getType().resolve(TypeIdentifierMap));
}
}
processType(TVal.getType().resolve(TypeIdentifierMap));
}
}