From 9ac2e1138519c78f6b4850a367b0801b5988c74e Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Mon, 12 Feb 2018 22:36:36 +0000 Subject: [CFG] Provide construction contexts for return value constructors. When the current function returns a C++ object by value, CFG elements for constructors that construct the return values can now be queried to discover that they're indeed participating in construction of the respective return value at the respective return statement. Differential Revision: https://reviews.llvm.org/D42875 llvm-svn: 324952 --- clang/lib/Analysis/CFG.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Analysis') diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index 934abb063e8..cec5a652b94 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/lib/Analysis/CFG.cpp @@ -2575,6 +2575,8 @@ CFGBlock *CFGBuilder::VisitReturnStmt(ReturnStmt *R) { addAutomaticObjHandling(ScopePos, LocalScope::const_iterator(), R); + EnterConstructionContextIfNecessary(R, R->getRetValue()); + // If the one of the destructors does not return, we already have the Exit // block as a successor. if (!Block->hasNoReturnElement()) -- cgit v1.2.3