[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Add new compilation directives to clang?
From:       Eli Friedman <eli.friedman () gmail ! com>
Date:       2009-07-30 19:19:25
Message-ID: f5aa3e9b0907301219o4272240eua77c5e73bdfd07af () mail ! gmail ! com
[Download RAW message or body]

On Thu, Jul 30, 2009 at 10:38 AM, zhunan<zhunansjtu@gmail.com> wrote:
> Hi,all
>
> I just develop some programs which need a new compilation directives,it
> just like OpenMP's directives(#pragma omp parallel for),
>
> for example,I want Clang to recognize "#pragma GCB i" and then change i
> to idx_i when it generate LLVM IR.
>
> what should I do to archieve this?

Roughly, you add parsing code to lib/Parse/ParsePragma.cpp, add an
action to include/clang/Parse/Action.h, add some representation in the
AST, add a handler to Sema to create the necessary AST node, and make
CodeGen handle the new AST node.

I'm not sure I quite follow what you're trying to do, though.

-Eli
_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic