diff options
author | Richard Trieu <rtrieu@google.com> | 2017-12-09 01:29:40 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-12-09 01:29:40 +0000 |
commit | e81caeb3147f9366d264fbacca95e8e17465ee65 (patch) | |
tree | 2725a92f660c45c99c72986e9150d415b516517e /clang/lib/Serialization/ASTReaderDecl.cpp | |
parent | a249c4f513aec66a08ac0d92c52980f84bdcd17c (diff) | |
download | bcm5719-llvm-e81caeb3147f9366d264fbacca95e8e17465ee65.tar.gz bcm5719-llvm-e81caeb3147f9366d264fbacca95e8e17465ee65.zip |
[ODRHash] Support ODR violation detection in functions.
Extend the hashing to functions, which allows detection of function definition
mismatches across modules.
llvm-svn: 320230
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index a3bf0d97126..efbaf92a849 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -796,6 +796,9 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { FD->setCachedLinkage(Linkage(Record.readInt())); FD->EndRangeLoc = ReadSourceLocation(); + FD->ODRHash = Record.readInt(); + FD->HasODRHash = true; + switch ((FunctionDecl::TemplatedKind)Record.readInt()) { case FunctionDecl::TK_NonTemplate: mergeRedeclarable(FD, Redecl); |