This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to determine source location of pragma?


I am new to GCC internals.

I'm trying to create a plugin to operate on pragmas. Currently have
this working using c_register_pragma with a callback.

The callback performs pragma_lex and is able to retrieve the string
token of the pragma based on this example.
https://github.com/wh5a/gcc-plugin/blob/master/pragma_plugin.c

How can I determine the line number of the pragma? I tried
DECL_SOURCE_LINE on the tree type but this returns 0. Do I have to
interact with cpplib?

Regards,
Vanush


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]