Cheat Cheat

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

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 :slight_smile:

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 ? :slight_smile: or a git*.com link of an implementation I could infere from ?

Thanx in advance,