Pragmas.

Hi,
Does # pragmas work with clang? We want to add a
# prgrama Key = Value kind of syntax for PIC16? How does this info get encoded into bc?

- Sanjiv

Each pragma needs special support from the compiler; what are you trying to do?

-Eli

Each pragma needs special support from the compiler; what are you trying to do?

-Eli

I want the frontend to allow following

#pragma config blah, blah, blah

The backend should be able to see this as it is, and will emit some special section to place this blah,blah info into.

  • Sanjiv

Hmm... to make clang able to recognize something like that, you need a
hook in the parser for the pragma, a new declaration kind in the AST,
a new method on Action, and an implementation of that method in Sema
to add the declaration to the AST.

How to represent it in the AST and how to deal with it for CodeGen
depends on what exactly goes into the "blah, blah, blah". We want to
keep the AST and the IR as structured as possible, so I'd like to
avoid adding a mechanism to dump an opaque string onto the backend.
If you really need to pass stuff through to the assembler, we already
support module-level asm statements.

-Eli

If you really need to pass stuff through to the assembler, we already
support module-level asm statements.

-Eli
  

Thanks. That should do I guess.

- Sanjiv