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

@@ -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