[cfe-dev] Adding a Node to the AST?

Larisse Voufo lvoufo at cs.indiana.edu
Fri Oct 29 05:03:44 PDT 2010


Please, never mind this. I figured it out.

On Thu, Oct 28, 2010 at 6:49 PM, Larisse Voufo <lvoufo at cs.indiana.edu>wrote:

> By the way, here the exact line (bolded) of the generated DeclNode.inc at
> which it is complaining:
> -------------------------------------------
> DECL_CONTEXT(TranslationUnit)
> DECL_CONTEXT(Namespace)
> *DECL_CONTEXT(Concept)*
> DECL_CONTEXT(ObjCMethod)
> DECL_CONTEXT(LinkageSpec)
> -------------------------------------------
>
>
>
> On Thu, Oct 28, 2010 at 6:46 PM, Larisse Voufo <lvoufo at cs.indiana.edu>wrote:
>
>> Hi Folks,
>>
>> If anyone can quickly answer this question for me, it'd definitely help
>> by a great deal.
>> I am trying to add a node into the AST, but it seems there is at least one
>> important parameter I'm overlooking.
>>
>> I figured out that I was supposed to modify the DeclNodes.td file by
>> inserting the following at some appropriate spot:
>> ----------------------------------------
>> def Concept : DDecl<Named, 1>, DeclContext;
>> ----------------------------------------
>>
>> However, this action is breaking my builds, and I'm not sure how to fix
>> it.
>>
>> --------------------------------------------------------
>> llvm[2]: Compiling ParseConceptDecl.cpp for Debug+Asserts build
>> In file included from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/DeclBase.h:1187,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/Decl.h:18,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/ASTContext.h:21,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/Stmt.h:25,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/Expr.h:18,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/DeclCXX.h:18,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/DeclTemplate.h:17,
>>                  from
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/DeclConcept.h:13,
>>                  from ParseConceptDecl.cpp:88:
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/DeclNodes.inc:415:
>> error: expected ‘,’ or ‘...’ before ‘*’ token
>> /Users/lvoufo/llvm/tools/clang/lib/Parse/../../include/clang/AST/DeclNodes.inc:415:
>> error: ISO C++ forbids declaration of ‘ConceptDecl’ with no type
>> make[2]: ***
>> [/Users/lvoufo/llvm/tools/clang/lib/Parse/Debug+Asserts/ParseConceptDecl.o]
>> Error 1
>> make[1]: *** [Parse/.makeall] Error 2
>> make: *** [all] Error 1
>> --------------------------------------------------------
>>
>> What am I missing?
>>
>> Thanks,
>>
>> -- Larisse.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101029/4d1f271f/attachment.html>


More information about the cfe-dev mailing list