No other functionality changes, DIBuilder testcase is included in a paired
CFE commit.
This relaxes the assertion in isScopeRef to also accept subclasses of
DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205279
91177308-0d34-0410-b5e6-
96231b3b80d8
/// variable
/// @param Line Line number
DIImportedEntity createImportedDeclaration(DIScope Context,
- DIDescriptor Decl,
+ DIScope Decl,
unsigned Line);
/// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
public:
explicit DIImportedEntity(const MDNode *N) : DIDescriptor(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
- DIDescriptor getEntity() const { return getFieldAs<DIDescriptor>(2); }
+ DIScopeRef getEntity() const { return getFieldAs<DIScopeRef>(2); }
unsigned getLineNumber() const { return getUnsignedField(3); }
StringRef getName() const { return getStringField(4); }
bool Verify() const;
DIE *IMDie = new DIE(Module.getTag());
TheCU->insertDIE(Module, IMDie);
DIE *EntityDie;
- DIDescriptor Entity = Module.getEntity();
+ DIDescriptor Entity = resolve(Module.getEntity());
if (Entity.isNameSpace())
EntityDie = TheCU->getOrCreateNameSpace(DINameSpace(Entity));
else if (Entity.isSubprogram())
}
DIImportedEntity DIBuilder::createImportedDeclaration(DIScope Context,
- DIDescriptor Decl,
+ DIScope Decl,
unsigned Line) {
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_imported_declaration),
Context,
- Decl,
+ Decl.getRef(),
ConstantInt::get(Type::getInt32Ty(VMContext), Line),
};
DIImportedEntity M(MDNode::get(VMContext, Elts));
static bool isScopeRef(const Value *Val) {
return !Val ||
(isa<MDString>(Val) && !cast<MDString>(Val)->getString().empty()) ||
- (isa<MDNode>(Val) && DIScope(cast<MDNode>(Val)).isScope());
+ isa<MDNode>(Val);
}
/// Check if a field at position Elt of a MDNode can be a ScopeRef.
DIArray Imports = CU.getImportedEntities();
for (unsigned i = 0, e = Imports.getNumElements(); i != e; ++i) {
DIImportedEntity Import = DIImportedEntity(Imports.getElement(i));
- DIDescriptor Entity = Import.getEntity();
+ DIDescriptor Entity = Import.getEntity().resolve(TypeIdentifierMap);
if (Entity.isType())
processType(DIType(Entity));
else if (Entity.isSubprogram())