summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/store
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/store')
-rw-r--r--compilerplugins/clang/store/lclstaticfix.cxx2
-rw-r--r--compilerplugins/clang/store/lclstaticfix.hxx2
-rw-r--r--compilerplugins/clang/store/removeforwardstringdecl.cxx2
-rw-r--r--compilerplugins/clang/store/removeforwardstringdecl.hxx2
-rw-r--r--compilerplugins/clang/store/tutorial/tutorial1.cxx2
-rw-r--r--compilerplugins/clang/store/tutorial/tutorial1.hxx2
-rw-r--r--compilerplugins/clang/store/tutorial/tutorial2.cxx4
-rw-r--r--compilerplugins/clang/store/tutorial/tutorial2.hxx2
-rw-r--r--compilerplugins/clang/store/tutorial/tutorial3.cxx4
-rw-r--r--compilerplugins/clang/store/tutorial/tutorial3.hxx2
-rw-r--r--compilerplugins/clang/store/unusedcode.cxx6
11 files changed, 15 insertions, 15 deletions
diff --git a/compilerplugins/clang/store/lclstaticfix.cxx b/compilerplugins/clang/store/lclstaticfix.cxx
index 423a1caa4af8..01dafd5fb1ac 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 1fc485b4c7e7..256c6dd14e0e 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 8350c777abd1..ac85e1cd3288 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 b57afebe2db3..774bbc3ffb0d 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 42443afa571c..09bdaec458b9 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 cb56a3bf16c7..144d0dc64f36 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 63131fb17544..5d78ff26332b 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 e0d31f3c245d..71cec477a81e 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 95323a667452..b099f99888dc 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 af512c1ac489..a3dd0bdd7374 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 d42cb6020ccd..37c626e0782f 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.