summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-04-19 23:09:22 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-04-19 23:09:22 +0000
commit72da02fc30cd7ce6344107c8b33e48e6322f4d7e (patch)
tree198a1f89eef521f96e44d4366fb445b0eb9ada81 /clang/lib/Analysis/CFG.cpp
parent1707fa337468645d379048526f552fcfcf80eb01 (diff)
downloadbcm5719-llvm-72da02fc30cd7ce6344107c8b33e48e6322f4d7e.tar.gz
bcm5719-llvm-72da02fc30cd7ce6344107c8b33e48e6322f4d7e.zip
[CFG] [analyzer] Don't treat argument constructors as temporary constructors.
Function argument constructors (that are used for passing objects into functions by value) are completely unlike temporary object constructors, but we were treating them as such because they are also wrapped into a CXXBindTemporaryExpr. This patch adds a partial construction context layer for call argument values, but doesn't proceed to transform it into an actual construction context yet. This is tells the clients that we aren't supporting these constructors yet. Differential Revision: https://reviews.llvm.org/D45650 llvm-svn: 330377
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 34d40162275..66019329a3b 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -2367,6 +2367,13 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) {
if (!boundType.isNull()) calleeType = boundType;
}
+ // FIXME: Once actually implemented, this construction context layer should
+ // include the number of the argument as well.
+ for (auto Arg: C->arguments()) {
+ findConstructionContexts(
+ ConstructionContextLayer::create(cfg->getBumpVectorContext(), C), Arg);
+ }
+
// If this is a call to a no-return function, this stops the block here.
bool NoReturn = getFunctionExtInfo(*calleeType).getNoReturn();
OpenPOWER on IntegriCloud