[cfe-dev] [RFC] OpenMP Support in Clang

Alexey Bataev a.bataev at hotmail.com
Tue Feb 12 09:01:38 PST 2013

Dmitri, thank you very much for your answer.
Yes, I remember It was discussed. But I can parse pragmas as pragmas but 
represent them as an attributes. So I just wanted to be sure that the 
new classes are still ok.

Best regards,
Alexey Bataev
Software Engineer
Intel Compiler Team
Intel Corp.

12.02.2013 17:24, Dmitri Gribenko пишет:
> On Tue, Feb 12, 2013 at 2:26 PM, Alexey Bataev <a.bataev at hotmail.com> wrote:
>> Hello everybody,
>> I'd like to discuss representation of OpenMP directives and clauses in AST.
>> I'm trying to solve this problem by introducing new Stmt-based classes for
>> each executable directive and clause. But there is a class AttributedStmt
>> with some remarkable comment:
>> /// Represents an attribute applied to a statement. For example:
>> ///   [[omp::for(...)]] for (...) { ... }
>> So, what is preferred solution? Introduce new Stmt classes for directives
>> and clauses or it would be better to try to represent them as attributes and
>> to use existing class AttributedStmt?
> I think this was discussed before, and the consensus was to create new
> AST nodes because:
> * translating pragmas to attributes might be hard;
> * preserving enough source information in attributes that really
> represent pragmas will be definitely hard and non-intuitive.
> The [[omp::for...]] example is there because OpenMP pragmas was a
> motivation for C++11 attributes.  Like: C++11 attributes will enable
> OpenMP to create a new syntax without pramgas.  But this did not
> happen yet.
> Dmitri

More information about the cfe-dev mailing list