[cfe-dev] Cheat Cheat

phi clang via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 23 00:44:29 PDT 2019


Hi Gurus,
I am a newbie at llvm/clang, I am doing research at the preprocessor level.

I am now able to build clang in debug mode and manage to navigate into it
with GDB, working on linux desktop.

I'd like to know if cheat cheat exist about

How to add a new directive (other than extending #pragma) i.e adding
#MyDirective

How to add a new predefined fun-like macro, for instance _MyMacro()

For #MyDirective case, my guess that I need to do:

- Define a new MyDirective token
- Implement a Handler for it
-  Implement the PrintPreprocessedOutput
- Test indeed :)

I can't translate  into a fileset I should look at and patch.

The _MyMacro() case will be different, didn't not looked at it yet.

Does someone has a chat cheat at hand ? :-) or a git*.com link of an
implementation I could infere from ?

Thanx in advance,
Cheers,
Phi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191023/4f246189/attachment.html>


More information about the cfe-dev mailing list