Canonicalize declaration pointers when forming APValues.
authorRichard Smith <richard@metafoo.co.uk>
Wed, 2 Sep 2020 21:42:37 +0000 (14:42 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Thu, 17 Sep 2020 01:11:18 +0000 (18:11 -0700)
commit905b9ca26c94fa86339451a528cedde5004fc1bb
tree38cf5aa37cc4e11d9dc86643137768c0609acbb8
parent344a3d0bc0fb0868b519c3342b4982d6121eece3
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.
clang/include/clang/AST/APValue.h
clang/lib/AST/APValue.cpp
clang/lib/AST/Decl.cpp
clang/lib/AST/DeclBase.cpp
clang/lib/AST/ExprConstant.cpp
clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
clang/test/OpenMP/ordered_messages.cpp