Problem in wrapping statements

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem in wrapping statements

David Chisnall via cfe-dev
Hi

I have to wrap all the expression which uses logical, relational and
comparison operator. I am doing this by


         virtual bool VisitBinaryOperator(BinaryOperator *bo){
             if(bo->isLogicalOp()  || bo->isComparisonOp() ||
bo->isRelationalOp()){
                 std::string name= "WRAPCONDITION(";
rewriter.InsertTextBefore(bo->getLHS()->getLocStart(),name);
                 name = " ) ";
rewriter.InsertTextAfterToken(bo->getRHS()->getLocEnd(),name);
             }
             return true;
         }
But this is giving me some wiered answer

Ex

a = b == c;

output is

a = WRAPCONDITION(b == c ; // closing bracket is missing.

Can anyone please help me in this?

--
Thanks and Regards
Awanish Pandey
PhD, CSE
IIT Kanpur

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev