From ff267df0de9664fa9af06987d455ae5f02425c3f Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Thu, 28 Jun 2018 00:04:54 +0000 Subject: [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 --- clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp') 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), -- cgit v1.2.3