I want to add the AST node for OpenMP statement. I create OmpStmt class that inherit from Stmt class and add the definition in StmtNodes.td as follow<div><br></div><div><div>def OmpStmt : Stmt<1>;</div><div>def OmpAtomicStmt : DStmt<OmpStmt>;</div>
<div>def OmpBarrierStmt : DStmt<OmpStmt>;</div><div>def OmpCriticalStmt : DStmt<OmpStmt>;</div><div>def OmpFlushStmt : DStmt<OmpStmt>;</div><div>def OmpMasterStmt : DStmt<OmpStmt>;</div><div>def OmpOrderedStmt : DStmt<OmpStmt>;</div>
<div>def OmpParallelStmt : DStmt<OmpStmt>;</div><div>def OmpForStmt : DStmt<OmpStmt>;</div><div>def OmpSectionsStmt : DStmt<OmpStmt>;</div><div>def OmpSectionStmt : DStmt<OmpStmt>;</div><div>def OmpSingleStmt : DStmt<OmpStmt>;</div>
<div>def OmpTaskStmt : DStmt<OmpStmt>;</div><div>def OmpTaskwaitStmt : DStmt<OmpStmt>;</div><div>def OmpThreadprivateStmt : DStmt<OmpStmt>;</div><div><br></div><div>when I build project, it show error like</div>
<div><br></div><div><div>In file included from /home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtVisitor.h:111,</div><div>                 from ASTImporter.cpp:21:</div><div>/home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc: In member function ‘RetTy clang::StmtVisitor<ImplClass, RetTy>::Visit(clang::Stmt*) [with ImplClass = <unnamed>::ASTNodeImporter, RetTy = clang::Stmt*]’:</div>
<div>ASTImporter.cpp:3045:   instantiated from here</div><div>/home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:617: error: invalid static_cast from type ‘clang::Stmt*’ to type ‘clang::OmpAtomicStmt*’</div>
<div>/home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:623: error: invalid static_cast from type ‘clang::Stmt*’ to type ‘clang::OmpBarrierStmt*’</div><div>/home/remixman/Desktop/llvm/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:629: error: invalid static_cast from type ‘clang::Stmt*’ to type ‘clang::OmpCriticalStmt*’</div>
</div><div><br></div><div>OmpAtomicStmt and other OpenMP Stmt class is inherit from OmpStmt. Why the error show that? How can I fixed?</div><div><br></div><div><br></div><div><br></div>Thanks in advance<br>-- <br>Remixman (Pisit Makpaisit)<br>

</div>