From 4f762202f647976ffd80c23bacada8401d633001 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 28 Feb 2017 23:12:48 +0100 Subject: Adapt loplugin:sallogareas ...to b6a69585b00867005820c1dd94e10e0e6b545e2a "old sal_detail_log_backtrace into sal_detail_log" and follow-up c697ae306cd4eaa8144ed93fc908e50d5934e249 "Some clean up" Change-Id: Ie38899e70c5b326724f9442fbf92e453b05eec01 --- compilerplugins/clang/sallogareas.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compilerplugins') 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. -- cgit