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

Luboš Luňák l.lunak at suse.cz
Thu May 2 09:20:23 PDT 2013


 compilerplugins/clang/bodynotinblock.cxx                |    2 +-
 compilerplugins/clang/bodynotinblock.hxx                |    2 +-
 compilerplugins/clang/literalalternative.cxx            |    4 ++--
 compilerplugins/clang/postfixincrementfix.cxx           |    2 +-
 compilerplugins/clang/postfixincrementfix.hxx           |    2 +-
 compilerplugins/clang/sallogareas.cxx                   |    6 +++---
 compilerplugins/clang/sallogareas.hxx                   |    4 ++--
 compilerplugins/clang/store/lclstaticfix.cxx            |    2 +-
 compilerplugins/clang/store/lclstaticfix.hxx            |    2 +-
 compilerplugins/clang/store/removeforwardstringdecl.cxx |    2 +-
 compilerplugins/clang/store/removeforwardstringdecl.hxx |    2 +-
 compilerplugins/clang/store/tutorial/tutorial1.cxx      |    2 +-
 compilerplugins/clang/store/tutorial/tutorial1.hxx      |    2 +-
 compilerplugins/clang/store/tutorial/tutorial2.cxx      |    4 ++--
 compilerplugins/clang/store/tutorial/tutorial2.hxx      |    2 +-
 compilerplugins/clang/store/tutorial/tutorial3.cxx      |    4 ++--
 compilerplugins/clang/store/tutorial/tutorial3.hxx      |    2 +-
 compilerplugins/clang/store/unusedcode.cxx              |    6 +++---
 compilerplugins/clang/unusedvariablecheck.cxx           |    2 +-
 compilerplugins/clang/unusedvariablecheck.hxx           |    2 +-
 20 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit e6c20364e715fc7b7922d4470d5c32c781f71e48
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Thu May 2 18:17:32 2013 +0200

    add const
    
    Change-Id: I71236b9ca6300372ba00c85401cf19f6c0e7ac99

diff --git a/compilerplugins/clang/bodynotinblock.cxx b/compilerplugins/clang/bodynotinblock.cxx
index afd486d..104a146 100644
--- a/compilerplugins/clang/bodynotinblock.cxx
+++ b/compilerplugins/clang/bodynotinblock.cxx
@@ -38,7 +38,7 @@ void BodyNotInBlock::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool BodyNotInBlock::VisitFunctionDecl( FunctionDecl* declaration )
+bool BodyNotInBlock::VisitFunctionDecl( const FunctionDecl* declaration )
     {
     if( ignoreLocation( declaration ))
         return true;
diff --git a/compilerplugins/clang/bodynotinblock.hxx b/compilerplugins/clang/bodynotinblock.hxx
index 23f7609..9c5ed78 100644
--- a/compilerplugins/clang/bodynotinblock.hxx
+++ b/compilerplugins/clang/bodynotinblock.hxx
@@ -23,7 +23,7 @@ class BodyNotInBlock
     public:
         explicit BodyNotInBlock( CompilerInstance& compiler );
         virtual void run();
-        bool VisitFunctionDecl( FunctionDecl* declaration );
+        bool VisitFunctionDecl( const FunctionDecl* declaration );
     private:
         typedef vector< const Stmt* > StmtParents;
         void traverseStatement( const Stmt* stmt, StmtParents& parents );
diff --git a/compilerplugins/clang/literalalternative.cxx b/compilerplugins/clang/literalalternative.cxx
index 06ba803..f856404 100644
--- a/compilerplugins/clang/literalalternative.cxx
+++ b/compilerplugins/clang/literalalternative.cxx
@@ -25,10 +25,10 @@ public:
 
     virtual void run() { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
 
-    bool VisitCallExpr(CallExpr * expr);
+    bool VisitCallExpr(const CallExpr * expr);
 };
 
-bool LiteralAlternative::VisitCallExpr(CallExpr * expr) {
+bool LiteralAlternative::VisitCallExpr(const CallExpr * expr) {
     if (ignoreLocation(expr)) {
         return true;
     }
diff --git a/compilerplugins/clang/postfixincrementfix.cxx b/compilerplugins/clang/postfixincrementfix.cxx
index 0402dec..edb31e3 100644
--- a/compilerplugins/clang/postfixincrementfix.cxx
+++ b/compilerplugins/clang/postfixincrementfix.cxx
@@ -29,7 +29,7 @@ void PostfixIncrementFix::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool PostfixIncrementFix::VisitFunctionDecl( FunctionDecl* declaration )
+bool PostfixIncrementFix::VisitFunctionDecl( const FunctionDecl* declaration )
     {
     if( ignoreLocation( declaration ))
         return true;
diff --git a/compilerplugins/clang/postfixincrementfix.hxx b/compilerplugins/clang/postfixincrementfix.hxx
index f3afbd7f..d65c197 100644
--- a/compilerplugins/clang/postfixincrementfix.hxx
+++ b/compilerplugins/clang/postfixincrementfix.hxx
@@ -23,7 +23,7 @@ class PostfixIncrementFix
     public:
         explicit PostfixIncrementFix( CompilerInstance& compiler, Rewriter& rewriter );
         virtual void run();
-        bool VisitFunctionDecl( FunctionDecl* declaration );
+        bool VisitFunctionDecl( const FunctionDecl* declaration );
     private:
         typedef std::vector< const Stmt* > StmtParents;
         void fixPostfixOperator( const CXXOperatorCallExpr* op, StmtParents& parents );
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index 0724ca7..26b22a2 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -37,17 +37,17 @@ void SalLogAreas::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool SalLogAreas::VisitFunctionDecl( FunctionDecl* function )
+bool SalLogAreas::VisitFunctionDecl( const FunctionDecl* function )
     {
     inFunction = function;
     return true;
     }
 
-bool SalLogAreas::VisitCallExpr( CallExpr* call )
+bool SalLogAreas::VisitCallExpr( const CallExpr* call )
     {
     if( ignoreLocation( call ))
         return true;
-    if( FunctionDecl* func = call->getDirectCallee())
+    if( const FunctionDecl* func = call->getDirectCallee())
         {
         // Optimize, getQualifiedNameAsString() is reportedly expensive.
         if( func->getNumParams() == 4 && func->getIdentifier() != NULL
diff --git a/compilerplugins/clang/sallogareas.hxx b/compilerplugins/clang/sallogareas.hxx
index 4b3e366..2c0326d 100644
--- a/compilerplugins/clang/sallogareas.hxx
+++ b/compilerplugins/clang/sallogareas.hxx
@@ -25,8 +25,8 @@ class SalLogAreas
     public:
         explicit SalLogAreas( CompilerInstance& compiler );
         virtual void run();
-        bool VisitFunctionDecl( FunctionDecl* function );
-        bool VisitCallExpr( CallExpr* call );
+        bool VisitFunctionDecl( const FunctionDecl* function );
+        bool VisitCallExpr( const CallExpr* call );
     private:
         void checkArea( StringRef area, SourceLocation location );
         void readLogAreas();
diff --git a/compilerplugins/clang/store/lclstaticfix.cxx b/compilerplugins/clang/store/lclstaticfix.cxx
index 423a1ca..01dafd5 100644
--- a/compilerplugins/clang/store/lclstaticfix.cxx
+++ b/compilerplugins/clang/store/lclstaticfix.cxx
@@ -29,7 +29,7 @@ void LclStaticFix::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
+bool LclStaticFix::VisitFunctionDecl( const FunctionDecl* declaration )
     {
     if( ignoreLocation( declaration ))
         return true;
diff --git a/compilerplugins/clang/store/lclstaticfix.hxx b/compilerplugins/clang/store/lclstaticfix.hxx
index 1fc485b..256c6dd 100644
--- a/compilerplugins/clang/store/lclstaticfix.hxx
+++ b/compilerplugins/clang/store/lclstaticfix.hxx
@@ -23,7 +23,7 @@ class LclStaticFix
     public:
         explicit LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter );
         virtual void run();
-        bool VisitFunctionDecl( FunctionDecl* declaration );
+        bool VisitFunctionDecl( const FunctionDecl* declaration );
     };
 
 } // namespace
diff --git a/compilerplugins/clang/store/removeforwardstringdecl.cxx b/compilerplugins/clang/store/removeforwardstringdecl.cxx
index 8350c77..ac85e1c 100644
--- a/compilerplugins/clang/store/removeforwardstringdecl.cxx
+++ b/compilerplugins/clang/store/removeforwardstringdecl.cxx
@@ -29,7 +29,7 @@ void RemoveForwardStringDecl::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool RemoveForwardStringDecl::VisitNamespaceDecl( NamespaceDecl* declaration )
+bool RemoveForwardStringDecl::VisitNamespaceDecl( const NamespaceDecl* declaration )
     {
     if( ignoreLocation( declaration ))
         return true;
diff --git a/compilerplugins/clang/store/removeforwardstringdecl.hxx b/compilerplugins/clang/store/removeforwardstringdecl.hxx
index b57afeb..774bbc3 100644
--- a/compilerplugins/clang/store/removeforwardstringdecl.hxx
+++ b/compilerplugins/clang/store/removeforwardstringdecl.hxx
@@ -23,7 +23,7 @@ class RemoveForwardStringDecl
     public:
         explicit RemoveForwardStringDecl( CompilerInstance& compiler, Rewriter& rewriter );
         virtual void run();
-        bool VisitNamespaceDecl( NamespaceDecl* declaration );
+        bool VisitNamespaceDecl( const NamespaceDecl* declaration );
     private:
         bool tryRemoveStringForwardDecl( const Decl* decl );
     };
diff --git a/compilerplugins/clang/store/tutorial/tutorial1.cxx b/compilerplugins/clang/store/tutorial/tutorial1.cxx
index 42443af..09bdaec 100644
--- a/compilerplugins/clang/store/tutorial/tutorial1.cxx
+++ b/compilerplugins/clang/store/tutorial/tutorial1.cxx
@@ -35,7 +35,7 @@ void Tutorial1::run()
 
 // This function is called for every return statement.
 // Returning true means to continue with examining the AST, false means to stop (just always return true).
-bool Tutorial1::VisitReturnStmt( ReturnStmt* returnstmt )
+bool Tutorial1::VisitReturnStmt( const ReturnStmt* returnstmt )
     {
     // Helper function from the LO base plugin class, call at the very beginning to ignore sources
     // that should not be processed (e.g. system headers).
diff --git a/compilerplugins/clang/store/tutorial/tutorial1.hxx b/compilerplugins/clang/store/tutorial/tutorial1.hxx
index cb56a3b..144d0dc 100644
--- a/compilerplugins/clang/store/tutorial/tutorial1.hxx
+++ b/compilerplugins/clang/store/tutorial/tutorial1.hxx
@@ -29,7 +29,7 @@ class Tutorial1
         // The function that will be called to perform the actual action.
         virtual void run();
         // Function from Clang, it will be called for every return statement in the source.
-        bool VisitReturnStmt( ReturnStmt* returnstmt );
+        bool VisitReturnStmt( const ReturnStmt* returnstmt );
     };
 
 } // namespace
diff --git a/compilerplugins/clang/store/tutorial/tutorial2.cxx b/compilerplugins/clang/store/tutorial/tutorial2.cxx
index 63131fb..5d78ff2 100644
--- a/compilerplugins/clang/store/tutorial/tutorial2.cxx
+++ b/compilerplugins/clang/store/tutorial/tutorial2.cxx
@@ -33,7 +33,7 @@ void Tutorial2::run()
     }
 
 // This function is called for every if statement.
-bool Tutorial2::VisitIfStmt( IfStmt* ifstmt )
+bool Tutorial2::VisitIfStmt( const IfStmt* ifstmt )
     {
     if( ignoreLocation( ifstmt ))
         return true;
@@ -49,7 +49,7 @@ bool Tutorial2::VisitIfStmt( IfStmt* ifstmt )
             if( isReturnFalse( ifstmt->getThen()))
                 warn = ifstmt->getThen();
             // Check if the sub-statement is '{ return false; }'
-            else if( CompoundStmt* compound = dyn_cast< CompoundStmt >( ifstmt->getThen()))
+            else if( const CompoundStmt* compound = dyn_cast< CompoundStmt >( ifstmt->getThen()))
                 {
                 if( compound->size() == 1 ) // one statement
                     if( isReturnFalse( *compound->body_begin())) // check the one sub-statement
diff --git a/compilerplugins/clang/store/tutorial/tutorial2.hxx b/compilerplugins/clang/store/tutorial/tutorial2.hxx
index e0d31f3..71cec47 100644
--- a/compilerplugins/clang/store/tutorial/tutorial2.hxx
+++ b/compilerplugins/clang/store/tutorial/tutorial2.hxx
@@ -25,7 +25,7 @@ class Tutorial2
         Tutorial2( CompilerInstance& compiler );
         virtual void run();
         // Will be called for every if statement.
-        bool VisitIfStmt( IfStmt* ifstmt );
+        bool VisitIfStmt( const IfStmt* ifstmt );
     private:
         // Helper function to check if the statement is 'return false;'.
         bool isReturnFalse( const Stmt* stmt );
diff --git a/compilerplugins/clang/store/tutorial/tutorial3.cxx b/compilerplugins/clang/store/tutorial/tutorial3.cxx
index 95323a6..b099f99 100644
--- a/compilerplugins/clang/store/tutorial/tutorial3.cxx
+++ b/compilerplugins/clang/store/tutorial/tutorial3.cxx
@@ -31,7 +31,7 @@ void Tutorial3::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool Tutorial3::VisitIfStmt( IfStmt* ifstmt )
+bool Tutorial3::VisitIfStmt( const IfStmt* ifstmt )
     {
     if( ignoreLocation( ifstmt ))
         return true;
@@ -42,7 +42,7 @@ bool Tutorial3::VisitIfStmt( IfStmt* ifstmt )
             // Modify the sub-statement if it is 'return false'.
             modifyReturnFalse( ifstmt->getThen());
             // Modify the sub-statement if it is '{ return false; }'.
-            if( CompoundStmt* compound = dyn_cast< CompoundStmt >( ifstmt->getThen()))
+            if( const CompoundStmt* compound = dyn_cast< CompoundStmt >( ifstmt->getThen()))
                 {
                 if( compound->size() == 1 ) // one statement
                     modifyReturnFalse( *compound->body_begin());
diff --git a/compilerplugins/clang/store/tutorial/tutorial3.hxx b/compilerplugins/clang/store/tutorial/tutorial3.hxx
index af512c1..a3dd0bd 100644
--- a/compilerplugins/clang/store/tutorial/tutorial3.hxx
+++ b/compilerplugins/clang/store/tutorial/tutorial3.hxx
@@ -26,7 +26,7 @@ class Tutorial3
         Tutorial3( CompilerInstance& compiler, Rewriter& rewriter );
         virtual void run();
         // Will be called for every if statement.
-        bool VisitIfStmt( IfStmt* ifstmt );
+        bool VisitIfStmt( const IfStmt* ifstmt );
     private:
         // Helper function to check if the statement is 'return false;' and
         // modify it if yes.
diff --git a/compilerplugins/clang/store/unusedcode.cxx b/compilerplugins/clang/store/unusedcode.cxx
index d42cb60..37c626e 100644
--- a/compilerplugins/clang/store/unusedcode.cxx
+++ b/compilerplugins/clang/store/unusedcode.cxx
@@ -30,7 +30,7 @@ class UnusedCode
     public:
         explicit UnusedCode( CompilerInstance& compiler, Rewriter& rewriter );
         virtual void run();
-        bool VisitFunctionDecl( FunctionDecl* declaration );
+        bool VisitFunctionDecl( const FunctionDecl* declaration );
     };
 
 UnusedCode::UnusedCode( CompilerInstance& compiler, Rewriter& rewriter )
@@ -43,12 +43,12 @@ void UnusedCode::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool UnusedCode::VisitFunctionDecl( FunctionDecl* declaration )
+bool UnusedCode::VisitFunctionDecl( const FunctionDecl* declaration )
     {
     if( ignoreLocation( declaration ))
         return true;
     bool isUsed = declaration->isUsed();
-    if( CXXMethodDecl* cxxmethod = dyn_cast< CXXMethodDecl >( declaration ))
+    if( const CXXMethodDecl* cxxmethod = dyn_cast< CXXMethodDecl >( declaration ))
         {
         if( !isUsed && cxxmethod->isVirtual())
             { // Virtual methods are used also if a method they override is used.
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx
index c0bf8be..a0763ac 100644
--- a/compilerplugins/clang/unusedvariablecheck.cxx
+++ b/compilerplugins/clang/unusedvariablecheck.cxx
@@ -40,7 +40,7 @@ void UnusedVariableCheck::run()
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
 
-bool UnusedVariableCheck::VisitVarDecl( VarDecl* var )
+bool UnusedVariableCheck::VisitVarDecl( const VarDecl* var )
     {
     if( ignoreLocation( var ))
         return true;
diff --git a/compilerplugins/clang/unusedvariablecheck.hxx b/compilerplugins/clang/unusedvariablecheck.hxx
index 98df658..ef14942 100644
--- a/compilerplugins/clang/unusedvariablecheck.hxx
+++ b/compilerplugins/clang/unusedvariablecheck.hxx
@@ -23,7 +23,7 @@ class UnusedVariableCheck
     public:
         explicit UnusedVariableCheck( CompilerInstance& compiler );
         virtual void run();
-        bool VisitVarDecl( VarDecl* var );
+        bool VisitVarDecl( const VarDecl* var );
     };
 
 } // namespace


More information about the Libreoffice-commits mailing list