diff options
author | Richard Trieu <rtrieu@google.com> | 2018-07-10 01:40:50 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-07-10 01:40:50 +0000 |
commit | 27c1b1a638d2f6300ebc6f64fd97bd6f4d9c9e2d (patch) | |
tree | 3b7724f9d051c9ec64ba4b74476f5d13df9ee69e /clang/lib/AST/Decl.cpp | |
parent | 2a3036fb1d92747ddaeba88182227c6e726b6d0e (diff) | |
download | bcm5719-llvm-27c1b1a638d2f6300ebc6f64fd97bd6f4d9c9e2d.tar.gz bcm5719-llvm-27c1b1a638d2f6300ebc6f64fd97bd6f4d9c9e2d.zip |
[ODRHash] Merge the two function hashes into one.
Functions that are a sub-Decl of a record were hashed differently than other
functions. This change keeps the AddFunctionDecl function and the hash of
records now calls this function. In addition, AddFunctionDecl has an option
to perform a hash as if the body was absent, which is required for some
checks after loading modules. Additional logic prevents multiple error
message from being printed.
llvm-svn: 336632
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 08718e0a9e8..7db105eded7 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -3658,18 +3658,15 @@ unsigned FunctionDecl::getMemoryFunctionKind() const { return 0; } +unsigned FunctionDecl::getODRHash() const { + assert(HasODRHash); + return ODRHash; +} + unsigned FunctionDecl::getODRHash() { if (HasODRHash) return ODRHash; - if (FunctionDecl *Definition = getDefinition()) { - if (Definition != this) { - HasODRHash = true; - ODRHash = Definition->getODRHash(); - return ODRHash; - } - } - if (auto *FT = getInstantiatedFromMemberFunction()) { HasODRHash = true; ODRHash = FT->getODRHash(); |