[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Fri Jun 23 13:18:53 UTC 2017


 compilerplugins/clang/staticmethods.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e9ad1b4f2fdecaac13af9eeacf2b261890afd941
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jun 23 15:18:21 2017 +0200

    std::string -> StringRef
    
    Change-Id: I06145822290ae4b3690a792eb4d2ad79437fd9cc

diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx
index d0dd43eb40ee..6360295968bd 100644
--- a/compilerplugins/clang/staticmethods.cxx
+++ b/compilerplugins/clang/staticmethods.cxx
@@ -36,7 +36,7 @@ public:
     bool VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *) { bVisitedThis = true; return true; }
     bool VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *) { bVisitedThis = true; return true; }
 private:
-    std::string getFilename(SourceLocation loc);
+    StringRef getFilename(SourceLocation loc);
 };
 
 bool BaseCheckNotTestFixtureSubclass(
@@ -64,7 +64,7 @@ bool isDerivedFromTestFixture(const CXXRecordDecl *decl) {
     return false;
 }
 
-std::string StaticMethods::getFilename(SourceLocation loc)
+StringRef StaticMethods::getFilename(SourceLocation loc)
 {
     SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(loc);
     return compiler.getSourceManager().getFilename(spellingLocation);
@@ -103,7 +103,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
         return true;
     }
     // the DDE has a dummy implementation on Linux and a real one on Windows
-    std::string aFilename = getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart());
+    auto aFilename = getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart());
     if (loplugin::isSamePathname(aFilename, SRCDIR "/include/svl/svdde.hxx")) {
         return true;
     }


More information about the Libreoffice-commits mailing list