summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-12-23 00:41:01 +0000
committerRichard Trieu <rtrieu@google.com>2017-12-23 00:41:01 +0000
commite6caa26e5d1f277c620976923bf6fd58433b2c86 (patch)
treeb240071434e238f24a4724c4abaa6fa2f8611171 /clang/lib/Serialization/ASTReaderDecl.cpp
parent50c342bf3f99c653716bd91201cc2a5189d596db (diff)
downloadbcm5719-llvm-e6caa26e5d1f277c620976923bf6fd58433b2c86.tar.gz
bcm5719-llvm-e6caa26e5d1f277c620976923bf6fd58433b2c86.zip
[ODRHash] Support ODR violation detection in functions.
Extend the hashing to functions, which allows detection of function definition mismatches across modules. This is a re-commit of r320230. llvm-svn: 321395
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp3
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);
OpenPOWER on IntegriCloud