[ODRHash] Fix early exit that skipped code.
authorRichard Trieu <rtrieu@google.com>
Fri, 14 Sep 2018 01:15:28 +0000 (01:15 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 14 Sep 2018 01:15:28 +0000 (01:15 +0000)
commitd8673901ab8fe5c104196d08b5c44da026f20870
tree1ca90d89577b6302096a9836e663dc3f9f140c69
parent847bd3316640a07dbef20029accc7905d836ecf8
[ODRHash] Fix early exit that skipped code.

There is a bit of code at the end of AddDeclaration that should be run on
every exit of the function.  However, there was an early exit beforehand
that could be triggered, which causes a small amount of data to skip the
hashing, leading to false positive mismatch.  Use a separate function so
that this code is always run.

llvm-svn: 342199
clang/include/clang/AST/ODRHash.h
clang/lib/AST/ODRHash.cpp
clang/test/Modules/Inputs/odr_hash-Unresolved/class.h