Yes, OmpStmt inherit from Stmt and other omp stmt inherit from OmpStmt.<br><br>
<div class="gmail_quote">On Sun, Aug 1, 2010 at 10:12 AM, Sean Hunt <span dir="ltr"><<a href="mailto:rideau3@gmail.com">rideau3@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">On 07/31/2010 08:59 PM, Pisit Makpaisit wrote:<br>> I want to add the AST node for OpenMP statement. I create OmpStmt class<br>> that inherit from Stmt class and add the definition in StmtNodes.td as<br>
> follow<br>><br>> def OmpStmt : Stmt<1>;<br>> def OmpAtomicStmt : DStmt<OmpStmt>;<br>> def OmpBarrierStmt : DStmt<OmpStmt>;<br>> def OmpCriticalStmt : DStmt<OmpStmt>;<br>> def OmpFlushStmt : DStmt<OmpStmt>;<br>
> def OmpMasterStmt : DStmt<OmpStmt>;<br>> def OmpOrderedStmt : DStmt<OmpStmt>;<br>> def OmpParallelStmt : DStmt<OmpStmt>;<br>> def OmpForStmt : DStmt<OmpStmt>;<br>> def OmpSectionsStmt : DStmt<OmpStmt>;<br>
> def OmpSectionStmt : DStmt<OmpStmt>;<br>> def OmpSingleStmt : DStmt<OmpStmt>;<br>> def OmpTaskStmt : DStmt<OmpStmt>;<br>> def OmpTaskwaitStmt : DStmt<OmpStmt>;<br>> def OmpThreadprivateStmt : DStmt<OmpStmt>;<br>
><br>> when I build project, it show error like<br>><br>> In file included from<br>> /home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtVisitor.h:111,<br>>                   from ASTImporter.cpp:21:<br>
> /home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:<br>> In member function ‘RetTy clang::StmtVisitor<ImplClass,<br>> RetTy>::Visit(clang::Stmt*) [with ImplClass =<br>> <unnamed>::ASTNodeImporter, RetTy = clang::Stmt*]’:<br>
> ASTImporter.cpp:3045:   instantiated from here<br>> /home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:617:<br>> error: invalid static_cast from type ‘clang::Stmt*’ to type<br>
> ‘clang::OmpAtomicStmt*’<br>> /home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:623:<br>> error: invalid static_cast from type ‘clang::Stmt*’ to type<br>> ‘clang::OmpBarrierStmt*’<br>
> /home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:629:<br>> error: invalid static_cast from type ‘clang::Stmt*’ to type<br>> ‘clang::OmpCriticalStmt*’<br>><br>> OmpAtomicStmt and other OpenMP Stmt class is inherit from OmpStmt. Why<br>
> the error show that? How can I fixed?<br><br></div></div>Did you make the OmpStmt class inherit from Stmt?<br><br>Sean<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Remixman (Pisit Makpaisit)<br>