Kaydet (Commit) c352f340 authored tarafından Luboš Luňák's avatar Luboš Luňák

note about getDirectCallee() vs getCallee()

Change-Id: I0a4cfd0ddb0c03b0db95d003004195df29a3f6df
üst 015d9327
...@@ -21,6 +21,7 @@ complex expression, operator precedence may mean the result is actually differen ...@@ -21,6 +21,7 @@ complex expression, operator precedence may mean the result is actually differen
This can be easily adjusted for different modifications to a function: This can be easily adjusted for different modifications to a function:
- replace CallExpr with CXXOperatorCallExpr or CXXMemberCallExpr - replace CallExpr with CXXOperatorCallExpr or CXXMemberCallExpr
- check different names or arguments - check different names or arguments
- change getDirectCallee() to getCallee()
- etc. - etc.
*/ */
...@@ -53,6 +54,10 @@ bool ChangeFunctionCalls::VisitCallExpr( const CallExpr* call ) ...@@ -53,6 +54,10 @@ bool ChangeFunctionCalls::VisitCallExpr( const CallExpr* call )
{ {
if( ignoreLocation( call )) if( ignoreLocation( call ))
return true; return true;
// Using getDirectCallee() here means that we find only calls
// that call the function directly (i.e. not using a pointer, for example).
// Use getCallee() to include also those :
// if( const FunctionDecl* func = dyn_cast_or_null< FunctionDecl >( call->getCalleeDecl()))
if( const FunctionDecl* func = call->getDirectCallee()) if( const FunctionDecl* func = call->getDirectCallee())
{ {
// Optimize, getQualifiedNameAsString() is reportedly expensive, // Optimize, getQualifiedNameAsString() is reportedly expensive,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment