aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ModuleManager.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-08-28 18:44:32 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-08-28 18:44:32 +0000
commit8b2a39e9377ea38f69c27e78964a11e992881d4f (patch)
treebad25fa87ec734a74d398a20122fd653c08bfe4c /clang/lib/Serialization/ModuleManager.cpp
parent83d2f0e7993a376c5ffb65e5760e58e72d27daee (diff)
downloadllvm-8b2a39e9377ea38f69c27e78964a11e992881d4f.zip
llvm-8b2a39e9377ea38f69c27e78964a11e992881d4f.tar.gz
llvm-8b2a39e9377ea38f69c27e78964a11e992881d4f.tar.bz2
[analyzer] Trust global initializers when analyzing main().
If the global variable has an initializer, we'll ignore it because we're usually not analyzing the program from the beginning, which means that the global variable may have changed before we start our analysis. However when we're analyzing main() as the top-level function, we can rely on global initializers to still be valid. At least in C; in C++ we have global constructors that can still break this logic. This patch allows the Static Analyzer to load constant initializers from global variables if the top-level function of the current analysis is main(). Differential Revision: https://reviews.llvm.org/D65361 llvm-svn: 370244
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
0 files changed, 0 insertions, 0 deletions