[cfe-dev] getLHS() and getRHS()

Rambo hunanlwm at sina.cn
Mon Nov 19 07:42:31 PST 2012


I can do it ,the codes as follows:for A[4]
 Expr *rhs=Decl2->getRHS();
         if(ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(rhs))
         {
           Curr=ICE->getSubExpr();
           if(DeclRefExpr *ICE1 = dyn_cast<DeclRefExpr>(Curr))
             De=ICE1->getNameInfo();
 //          llvm::errs()<<De.getAsString()<<"\n";
         }
This is get "A"and 
Expr *lhs=Decl2->getLHS();
         if(ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(lhs))
         {
           Curr=ICE->getSubExpr();
           if(DeclRefExpr *ICE1 = dyn_cast<DeclRefExpr>(Curr))
             De=ICE1->getNameInfo();
//           llvm::errs()<<De.getAsString()<<"\n";
         }
This is get 4.
Thank your for your reply again.


Rambo



--
View this message in context: http://clang-developers.42468.n3.nabble.com/getLHS-and-getRHS-tp4028364p4028368.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list