[cfe-dev] How to determine the corresponding block of a statement?

Marcel Schaible via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 31 07:49:42 PDT 2017


Hi everyone,

what is the proper way to determine the surrounding block/scope of a 
statement?

I want to insert in each branch some diagnostic code like e.g.

int foo(void) {

     if ( ...) return 0;

     else {

         return 1;

    }

}

transform into:

int foo(void) {

     if ( ...) {

         somediagnostic();

         return 0;

     } else {

         somediagnostic();

         return 1;

    }

}



Thanks

Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170731/4dc07a59/attachment.html>


More information about the cfe-dev mailing list