mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-10 02:25:47 +00:00
Change DIBuilder::createImportedDeclaration from taking a DIScope to a DIDescriptor.
Imported declarations can be DIGlobalVariables which aren't a DIScope. Today clang (unknowingly I believe) shoehorns these into a DIScope and it all works just because we never access the fields. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221466 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -651,7 +651,7 @@ namespace llvm {
|
|||||||
/// @param Decl The declaration (or definition) of a function, type, or
|
/// @param Decl The declaration (or definition) of a function, type, or
|
||||||
/// variable
|
/// variable
|
||||||
/// @param Line Line number
|
/// @param Line Line number
|
||||||
DIImportedEntity createImportedDeclaration(DIScope Context, DIScope Decl,
|
DIImportedEntity createImportedDeclaration(DIScope Context, DIDescriptor Decl,
|
||||||
unsigned Line,
|
unsigned Line,
|
||||||
StringRef Name = StringRef());
|
StringRef Name = StringRef());
|
||||||
DIImportedEntity createImportedDeclaration(DIScope Context,
|
DIImportedEntity createImportedDeclaration(DIScope Context,
|
||||||
|
@@ -190,10 +190,13 @@ DIImportedEntity DIBuilder::createImportedModule(DIScope Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DIImportedEntity DIBuilder::createImportedDeclaration(DIScope Context,
|
DIImportedEntity DIBuilder::createImportedDeclaration(DIScope Context,
|
||||||
DIScope Decl,
|
DIDescriptor Decl,
|
||||||
unsigned Line, StringRef Name) {
|
unsigned Line, StringRef Name) {
|
||||||
|
// Make sure to use the unique identifier based metadata reference for
|
||||||
|
// types that have one.
|
||||||
|
Value *V = Decl.isType() ? DIType(Decl).getRef() : Decl;
|
||||||
return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_declaration,
|
return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_declaration,
|
||||||
Context, Decl.getRef(), Line, Name,
|
Context, V, Line, Name,
|
||||||
AllImportedModules);
|
AllImportedModules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user