diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2018-06-28 00:04:54 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2018-06-28 00:04:54 +0000 |
commit | ff267df0de9664fa9af06987d455ae5f02425c3f (patch) | |
tree | d7ca32950960fee9964aa476bbe3d622323074b9 /clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp | |
parent | 5bf1ead3771667bc51d7b6b2ddc29cb860b4fe21 (diff) | |
download | bcm5719-llvm-ff267df0de9664fa9af06987d455ae5f02425c3f.tar.gz bcm5719-llvm-ff267df0de9664fa9af06987d455ae5f02425c3f.zip |
[CFG] [analyzer] Add construction contexts that explain pre-C++17 copy elision.
Before C++17 copy elision was optional, even if the elidable copy/move
constructor had arbitrary side effects. The elidable constructor is present
in the AST, but marked as elidable.
In these cases CFG now contains additional information that allows its clients
to figure out if a temporary object is only being constructed so that to pass
it to an elidable constructor. If so, it includes a reference to the elidable
constructor's construction context, so that the client could elide the
elidable constructor and construct the object directly at its final destination.
Differential Revision: https://reviews.llvm.org/D47616
llvm-svn: 335795
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp b/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp index af107ab224f..dc0d3ec8493 100644 --- a/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp @@ -31,6 +31,7 @@ AnalysisManager::AnalysisManager( Options.shouldConditionalizeStaticInitializers(), /*addCXXNewAllocator=*/true, Options.includeRichConstructorsInCFG(), + Options.shouldElideConstructors(), injector), Ctx(ASTCtx), Diags(diags), LangOpts(lang), PathConsumers(PDC), CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr), |