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

Rajendra rks at cse.iitb.ac.in
Tue May 14 00:19:42 PDT 2013


How to get label of a LabelStmt? 

e.g. from code below, I want to get label MYASSERT1 and MYASSERT2, how to do
that?

int main() 
{ 
  int x, y; 
  x = 10; 
  MYASSERT1: x>0; 
  y = 0; 
  MYASSERT2: x==0; 
  return 0; 
} 

I have written VisitLabelStmt(Stmt*) but control doesn't come to this
function. Also in VisitStmt(Stmt*) when I check stmt class as "LabelStmt", I
dont't get label. Any help?



--
View this message in context: http://clang-developers.42468.n3.nabble.com/how-to-get-label-from-a-statement-and-VisitLabelExpr-tp4032103.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list