summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-28 23:12:48 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-28 23:12:48 +0100
commit4f762202f647976ffd80c23bacada8401d633001 (patch)
tree762d96b5fd3568abd0ecec821f9519a85a841e83 /compilerplugins
parentc0c3575f7434712d294ccb0eaa7f49bf845437e0 (diff)
Adapt loplugin:sallogareas
...to b6a69585b00867005820c1dd94e10e0e6b545e2a "old sal_detail_log_backtrace into sal_detail_log" and follow-up c697ae306cd4eaa8144ed93fc908e50d5934e249 "Some clean up" Change-Id: Ie38899e70c5b326724f9442fbf92e453b05eec01
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/sallogareas.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index bde35137f1a3..e6c2997263da 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -51,7 +51,7 @@ bool SalLogAreas::VisitCallExpr( const CallExpr* call )
return true;
if( const FunctionDecl* func = call->getDirectCallee())
{
- if( func->getNumParams() == 4 && func->getIdentifier() != NULL
+ if( func->getNumParams() == 5 && func->getIdentifier() != NULL
&& ( func->getName() == "sal_detail_log" || func->getName() == "log" ))
{
auto tc = loplugin::DeclCheck(func);
@@ -73,8 +73,9 @@ bool SalLogAreas::VisitCallExpr( const CallExpr* call )
area->getLocStart());
return true;
}
- if( loplugin::DeclCheck(inFunction).Function("log").Namespace("detail").Namespace("sal").GlobalNamespace() )
- return true; // This function only forwards to sal_detail_log, so ok.
+ if( loplugin::DeclCheck(inFunction).Function("log").Namespace("detail").Namespace("sal").GlobalNamespace()
+ || loplugin::DeclCheck(inFunction).Function("sal_detail_logFormat").GlobalNamespace() )
+ return true; // These functions only forward to sal_detail_log, so ok.
if( call->getArg( 1 )->isNullPointerConstant( compiler.getASTContext(),
Expr::NPC_ValueDependentIsNotNull ) != Expr::NPCK_NotNull )
{ // If the area argument is a null pointer, that is allowed only for SAL_DEBUG.