diff options
author | Richard Smith <richard@metafoo.co.uk> | 2020-09-02 14:42:37 -0700 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2020-09-16 18:11:18 -0700 |
commit | 905b9ca26c94fa86339451a528cedde5004fc1bb (patch) | |
tree | 38cf5aa37cc4e11d9dc86643137768c0609acbb8 /clang/lib/AST/DeclBase.cpp | |
parent | 344a3d0bc0fb0868b519c3342b4982d6121eece3 (diff) | |
download | llvm-905b9ca26c94fa86339451a528cedde5004fc1bb.zip llvm-905b9ca26c94fa86339451a528cedde5004fc1bb.tar.gz llvm-905b9ca26c94fa86339451a528cedde5004fc1bb.tar.bz2 |
Canonicalize declaration pointers when forming APValues.
References to different declarations of the same entity aren't different
values, so shouldn't have different representations.
Recommit of e6393ee813178e9d3306b8e3c6949a4f32f8a2cb with fixed
handling for weak declarations. We now look for attributes on the most
recent declaration when determining whether a declaration is weak.
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index f4314d0..ab2b55c 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -720,7 +720,7 @@ bool Decl::isWeakImported() const { if (!canBeWeakImported(IsDefinition)) return false; - for (const auto *A : attrs()) { + for (const auto *A : getMostRecentDecl()->attrs()) { if (isa<WeakImportAttr>(A)) return true; |