]> granicus.if.org Git - clang/commit
Teach CallGraph to look into Generic Lambdas.
authorErich Keane <erich.keane@intel.com>
Mon, 30 Sep 2019 19:12:29 +0000 (19:12 +0000)
committerErich Keane <erich.keane@intel.com>
Mon, 30 Sep 2019 19:12:29 +0000 (19:12 +0000)
commit6ce1fe9e5bbde65d436064f64edfe2de06add2d7
treea0be50e1367d9f6423df4a51b89afd4436b0585e
parent051067842e97a124c09bf53d98e4ffa28ba078f5
Teach CallGraph to look into Generic Lambdas.

CallGraph visited LambdaExpr by getting the Call Operator from
CXXRecordDecl (LambdaExpr::getCallOperator calls
CXXRecordDecl::getLambdaCallOperator), which replaced generic lambda
call operators with the non-instantiated FunctionDecl.  The result was
that the CallGraph would only pick up non-dependent calls.

This patch does a few things:
1- Extend CXXRecordDecl to have a getDependentLambdaCallOperator, which
will get the FunctionTemplateDecl, rather than immediately getting the
TemplateDecl.
2- Define getLambdaCallOperator and getDependentLambdaCallOperator in
terms of a common function.
3- Extend LambdaExpr with a getDependentCallOperator, which just calls
the above function.
4- Changes CallGraph to handle Generic LambdaExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373247 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclCXX.h
include/clang/AST/ExprCXX.h
lib/AST/DeclCXX.cpp
lib/AST/ExprCXX.cpp
lib/Analysis/CallGraph.cpp
test/Analysis/debug-CallGraph.cpp