summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/singlevalfields.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-25 13:59:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-25 14:35:24 +0100
commitace70dae44eea914ea460cc2feb49202b61a20fc (patch)
tree4559c0ff67367b54925e2acd6c5a7cb13e30153d /compilerplugins/clang/singlevalfields.cxx
parent2029b2f6dd0109c5892e5ac5640022b31fe42fd2 (diff)
loplugins ignoreLocation() is unreliable with PCH
Change-Id: Ic12cacb6e058a8725ea6d722399e3afe6ea458c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132115 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/singlevalfields.cxx')
-rw-r--r--compilerplugins/clang/singlevalfields.cxx13
1 files changed, 2 insertions, 11 deletions
diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx
index 81fa76da885e..3d966c9e9be3 100644
--- a/compilerplugins/clang/singlevalfields.cxx
+++ b/compilerplugins/clang/singlevalfields.cxx
@@ -180,8 +180,7 @@ bool SingleValFields::VisitFieldDecl( const FieldDecl* fieldDecl )
{
auto canonicalDecl = fieldDecl->getCanonicalDecl();
- if( ignoreLocation( canonicalDecl )
- || isInUnoIncludeFile( compiler.getSourceManager().getSpellingLoc(canonicalDecl->getLocation())) )
+ if( isInUnoIncludeFile( compiler.getSourceManager().getSpellingLoc(canonicalDecl->getLocation())) )
return true;
MyFieldInfo aInfo;
@@ -212,8 +211,7 @@ bool SingleValFields::VisitVarDecl( const VarDecl* varDecl )
if (!canonicalDecl->getLocation().isValid())
return true;
- if( ignoreLocation( canonicalDecl )
- || isInUnoIncludeFile( compiler.getSourceManager().getSpellingLoc(canonicalDecl->getLocation())) )
+ if( isInUnoIncludeFile( compiler.getSourceManager().getSpellingLoc(canonicalDecl->getLocation())) )
return true;
MyFieldInfo aInfo;
@@ -233,9 +231,6 @@ bool SingleValFields::VisitVarDecl( const VarDecl* varDecl )
bool SingleValFields::VisitCXXConstructorDecl( const CXXConstructorDecl* decl )
{
- if( ignoreLocation( decl ) )
- return true;
-
// doesn't count as a write to fields because it's self->self
if (decl->isCopyOrMoveConstructor())
return true;
@@ -266,8 +261,6 @@ bool SingleValFields::VisitMemberExpr( const MemberExpr* memberExpr )
const FieldDecl* fieldDecl = dyn_cast<FieldDecl>(decl);
if (!fieldDecl)
return true;
- if (ignoreLocation(memberExpr))
- return true;
walkPotentialAssign(fieldDecl, memberExpr);
return true;
}
@@ -283,8 +276,6 @@ bool SingleValFields::VisitDeclRefExpr( const DeclRefExpr* declRefExpr )
return true;
if (!(varDecl->isStaticLocal() || varDecl->isStaticDataMember() || varDecl->hasGlobalStorage()))
return true;
- if (ignoreLocation(declRefExpr))
- return true;
walkPotentialAssign(varDecl, declRefExpr);
return true;
}