Usage of pragma directives

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Usage of pragma directives

kalyan ponnala
Hi,

I would like to know Clang pragmas usage (poison, system_header etc). And is there any way to define pragmas of our own.

Thanks

--
Kalyan Ponnala
phone: 8163772059

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Usage of pragma directives

Charles Davis-3
kalyan ponnala wrote:
> Hi,
>
> I would like to know Clang pragmas usage (poison, system_header etc).
Huh? I don't think I understand what you're asking. Please explain.
> And is there any way to define pragmas of our own.
Yeah. What you want to do is define a PragmaHandler (that is, derive a
class from PragmaHandler), and implement the HandlePragma() method.
Then, you can register the PragmaHandler by calling the
AddPragmaHandler() of the Preprocessor object.

You can add your own pragma namespace by creating a PragmaNamespace
object (itself a PragmaHandler), then populating it with your custom
pragmas.

You can even handle any pragma not otherwise handled by registering a
PragmaHandler whose identifier is null.

Chip

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev