[cfe-dev] how to get label from a statement and VisitLabelExpr

Gábor Kozár kozargabor at gmail.com
Tue May 14 04:35:41 PDT 2013


2013/5/14 Rajendra <rks at cse.iitb.ac.in>

> if (strcmp(s->getStmtClassName(), "LabelStmt") == 0)


Ough, don't do this. Use llvm::isa<> and llvm::dyn_cast<>.

Another idea: I think you're supposed to call the base class' VisitStmt
method after you're done with your custom logic. Try doing that instead of
returning with just true.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130514/8f89dd50/attachment.html>


More information about the cfe-dev mailing list