add const

Change-Id: I71236b9ca6300372ba00c85401cf19f6c0e7ac99
This commit is contained in:
Luboš Luňák
2013-05-02 18:17:32 +02:00
parent da4aca0972
commit e6c20364e7
20 changed files with 28 additions and 28 deletions

View File

@@ -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());