summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2014-11-06 17:46:55 +0000
committerFrederic Riss <friss@apple.com>2014-11-06 17:46:55 +0000
commit4aa51ae6c9a56fbc6273a50d232c7a0fed63e29a (patch)
tree1cce19304d20998fc9bd254ead57611ea236b373 /llvm/lib
parent2c769209a103dde2a6eed9b2326f826590bbb299 (diff)
downloadbcm5719-llvm-4aa51ae6c9a56fbc6273a50d232c7a0fed63e29a.tar.gz
bcm5719-llvm-4aa51ae6c9a56fbc6273a50d232c7a0fed63e29a.zip
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. llvm-svn: 221466
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 3276fe6452a..fbd19596377 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -190,10 +190,13 @@ DIImportedEntity DIBuilder::createImportedModule(DIScope Context,
}
DIImportedEntity DIBuilder::createImportedDeclaration(DIScope Context,
- DIScope Decl,
+ DIDescriptor Decl,
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,
- Context, Decl.getRef(), Line, Name,
+ Context, V, Line, Name,
AllImportedModules);
}
OpenPOWER on IntegriCloud