7#include <unordered_set>
9#include "clang/AST/DeclCXX.h"
10#include "clang/AST/Stmt.h"
11#include "clang/AST/Expr.h"
12#include "llvm/Support/raw_ostream.h"
13#include "clang/AST/RecursiveASTVisitor.h"
14#include "clang/Basic/Diagnostic.h"
16#include "llvm/ADT/StringRef.h"
34class HDLBody :
public RecursiveASTVisitor<HDLBody> {
36 HDLBody(clang::DiagnosticsEngine &diag_engine,
const ASTContext &ast_context,
43 HDLType *HDLt_userclassesp = NULL);
113 bool isLogicalOp(clang::OverloadedOperatorKind opc);
116 return (hp->
h_op == hNode::hdlopsEnum::hBinop) && (hp->
h_name ==
"=");
120 return (hp->
h_op == hNode::hdlopsEnum::hBinop) &&
121 (hp->
h_name ==
"ARRAYSUBSCRIPT");
133class StmtVisitor :
public clang::RecursiveASTVisitor<StmtVisitor> {
usertype_info_t usertype_info
const ASTContext & ast_context_
bool VisitCXXOperatorCallExpr(CXXOperatorCallExpr *opcall)
bool VisitBinaryOperator(BinaryOperator *expr)
bool isLogicalOp(clang::OverloadedOperatorKind opc)
bool VisitCaseStmt(CaseStmt *stmt)
string FindFname(FunctionDecl *funcd)
hdecl_name_map_t vname_map
overridden_method_map_t & overridden_method_map_
hfunc_name_map_t methodecls
bool VisitCompoundStmt(CompoundStmt *compoundStmt)
bool VisitDefaultStmt(DefaultStmt *stmt)
void NormalizeSwitchStmt(hNodep hswitchbody)
void GetWaitArg(hNodep &h_callp, Expr *callarg)
bool VisitConditionalOperator(ConditionalOperator *expr)
bool VisitReturnStmt(ReturnStmt *stmt)
bool VisitDeclStmt(DeclStmt *declstmt)
bool ProcessVarDecl(VarDecl *vardecl)
bool VisitMemberExpr(MemberExpr *memberexpr)
string generate_vname(string nm)
bool VisitUnaryOperator(UnaryOperator *expr)
bool isUserClass(const Type *classrectype)
const string nextstate_string
bool VisitArraySubscriptExpr(ArraySubscriptExpr *expr)
void AddVnames(hNodep &hvns)
bool VisitSwitchStmt(SwitchStmt *switchs)
bool TraverseStmt(Stmt *stmt)
HDLBody(clang::DiagnosticsEngine &diag_engine, const ASTContext &ast_context, hdecl_name_map_t &mod_vname_map, hfunc_name_map_t &allmethodecls, overridden_method_map_t &overridden_method_map)
hdecl_name_map_t & mod_vname_map_
hfunc_name_map_t & allmethodecls_
bool isAssignOp(hNodep hp)
bool VisitWhileStmt(WhileStmt *whiles)
bool VisitContinueStmt(ContinueStmt *stmt)
HDLType * HDLt_userclassesp_
void Run(Stmt *stmt, hNodep &h_top, HDLBodyMode runmode, HDLType *HDLt_userclassesp=NULL)
hNodep NormalizeAssignmentChain(hNodep hinp)
bool VisitInitListExpr(InitListExpr *stmt)
clang::DiagnosticsEngine & diag_e
bool ProcessSwitchCase(SwitchCase *cases)
bool VisitDoStmt(DoStmt *whiles)
bool isArrayRef(hNodep hp)
bool VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *b)
bool VisitIfStmt(IfStmt *ifs)
bool VisitCallExpr(CallExpr *callexpr)
bool VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *stmt)
bool VisitBreakStmt(BreakStmt *stmt)
string FindVname(NamedDecl *vard)
bool VisitCXXMemberCallExpr(CXXMemberCallExpr *callexpr)
bool VisitDeclRefExpr(DeclRefExpr *expr)
bool VisitForStmt(ForStmt *fors)
bool VisitIntegerLiteral(IntegerLiteral *lit)
bool VisitMaterializeTemporaryExpr(Stmt *st)
bool VisitBreakStmt(BreakStmt *st)
bool shouldVisitTemplateInstantiations() const
bool VisitReturnStmt(ReturnStmt *st)
bool VisitCaseStmt(CaseStmt *st)
StmtVisitor(clang::Stmt *st, HDLBodyMode mode)
bool VisitCompoundStmt(Stmt *st)
bool VisitContinueStmt(ContinueStmt *st)
bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *st)
bool VisitDefaultStmt(DefaultStmt *st)
virtual bool VisitStmt(Stmt *s)
Clang forward declarations.
std::unordered_map< const CXXMethodDecl *, const CXXMethodDecl * > overridden_method_map_t
userrectype_map_t userrectypes