About trees and expanded code by macros

2012-05-14 Thread Alberto Lozano Alelu
Hello. I'am developing an statement detector for c++ and I would like to detect if an statement is expanded from macro. Can I detect in ast tree if an statement is expanded code from macro? Thanks.

Re: About trees and expanded code by macros

2012-05-14 Thread Paulo J. Matos
Hi Alberto, As far as I understand it you want to know if a statement was expanded from a preprocessor macro, right? This isn't possible. The preprocessor is a separate thing altogether and I doubt any preprocessing information remains for the compiler proper to deal with. Cheers, Paulo M

Re: About trees and expanded code by macros

2012-05-14 Thread Manuel López-Ibáñez
This information is incorrect. GCC tracks macro expansion information since GCC 4.7, and it has been further improved and enabled by default in GCC 4.8. See the option ftrack-macro-expansion and the interface located in libcpp/include/line-map.h. If you have trouble understanding the interface, f

Re: About trees and expanded code by macros

2012-05-14 Thread Paulo J. Matos
Thanks for correcting me Manuel. I am just getting acquainted with GCC4.7, good to know that information has been added. Cheers, Paulo Matos On 14/05/12 10:07, Manuel López-Ibáñez wrote: This information is incorrect. GCC tracks macro expansion information since GCC 4.7, and it has been fur

Re: About trees and expanded code by macros

2012-05-20 Thread Dodji Seketeli
Alberto Lozano Alelu a écrit: > Hello. Hello Alberto, > I'am developing an statement detector for c++ and I would like to > detect if an statement is expanded from macro. I guess you are doing this from a plugin? > Can I detect in ast tree if an statement is expanded code from macro? As Manu