[analyzer] Unbreak body farms in presence of multiple declarations.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 23 Apr 2019 02:56:00 +0000 (02:56 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 23 Apr 2019 02:56:00 +0000 (02:56 +0000)
commit727d6ca3f0a2fdeddfbe22de6812ab301c6a9da2
tree40c4f7a49d1fef57b019fab802eabe8846138c38
parente2a8e43160588e12923994e2b44f67b2a7443a95
[analyzer] Unbreak body farms in presence of multiple declarations.

When growing a body on a body farm, it's essential to use the same redeclaration
of the function that's going to be used during analysis. Otherwise our
ParmVarDecls won't match the ones that are used to identify argument regions.

This boils down to trusting the reasoning in AnalysisDeclContext. We shouldn't
canonicalize the declaration before farming the body because it makes us not
obey the sophisticated decision-making process of AnalysisDeclContext.

Differential Revision: https://reviews.llvm.org/D60899

llvm-svn: 358946
clang/lib/Analysis/BodyFarm.cpp
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
clang/test/Analysis/OSAtomic_mac.c