On Tue, May 14, 2013 at 2:04 AM, Rajendra <span dir="ltr"><<a href="mailto:rks@cse.iitb.ac.in" target="_blank">rks@cse.iitb.ac.in</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here below is my code of VisitStmt() and VisitLabelStmt(), I know when to<br>
return true//false from visitor method and I have tried<br>
VisitLabelStmt(LabelStmt* s) and VisitLabelDecl(LabelDecl* d) too. No luck.<br>
<br>
bool MyProcessStmtBox::VisitStmt(Stmt *s)<br>
{<br>
clang::SourceManager & sm = this->m_compilerInstance->getSourceManager();<br>
clang::SourceLocation locStart = s->getLocStart();<br>
<br>
std::cerr << "\n found stmt \n";<br>
std::cerr << "\t" << stmtToStr(s) << " at ";<br>
locStart.dump(sm);<br>
std::cerr << "\n";<br>
std::cerr << "StmtClassName = " << s->getStmtClassName();<br>
<br>
if (strcmp(s->getStmtClassName(), "LabelStmt") == 0)<br>
{<br>
std::cerr << "\n found LabelStmt\n";<br>
s->dump();<br>
}<br>
// Returning false from one of the overridden visitor functions<br>
// will abort the entire traversal.<br>
return true;<br>
}<br>
<br>
bool MyProcessStmtBox::VisitLabelStmt(Stmt* s)<br>
{<br>
std::cerr << "\tLabelStmt: \n";<br>
s->dump(); // TODO: remove<br>
<br>
return false;<br>
}</blockquote><div><br></div><div>We need more context than this. Are you deriving from StmtVisitor? RecursiveASTVisitor? What code are you using to visit the body of the function? </div></div>