systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
FindEntryFunctions.h
Go to the documentation of this file.
1#ifndef _FIND_ENTRY_FUNCTIONS_H_
2#define _FIND_ENTRY_FUNCTIONS_H_
3
5#include "clang/AST/RecursiveASTVisitor.h"
6#include <map>
7#include <string>
8#include <vector>
9
10namespace systemc_clang {
11
12using namespace clang;
13
14class FindEntryFunctions : public RecursiveASTVisitor<FindEntryFunctions> {
15public:
17 typedef std::vector<EntryFunctionContainer *> entryFunctionVectorType;
18
19 typedef std::pair<string, vector<string>> entryFunctionLHSPairType;
20 typedef std::map<string, vector<string>> entryFunctionLHSMapType;
21
22 FindEntryFunctions(const clang::CXXRecordDecl *d, llvm::raw_ostream &os, clang::ASTContext &ctx);
23 virtual ~FindEntryFunctions();
24
26 virtual bool VisitStringLiteral(StringLiteral *l);
27 virtual bool VisitCXXMethodDecl(CXXMethodDecl *d);
28 virtual bool VisitMemberExpr(MemberExpr *e);
30
31 // Access Methods
32 CXXRecordDecl *getEntryCXXRecordDecl();
33 CXXMethodDecl *getEntryMethodDecl();
34 string getEntryName();
36 vector<CXXMethodDecl *> getOtherFunctions();
37
38 void dump();
39
40private:
41 clang::ASTContext &context_;
42 llvm::raw_ostream &os_;
43 const CXXRecordDecl *_d;
47 CXXRecordDecl *entry_cxx_record_decl_;
48 CXXMethodDecl *entry_method_decl_;
52 int pass_;
53 clang::CXXConstructorDecl* ctor_decl_;
56 vector<CXXMethodDecl *> other_function_list_;
57 clang::MemberExpr* process_me_;
58
59 // Disallow constructor with no argument
60 FindEntryFunctions(llvm::raw_ostream &os);
61};
62} // namespace systemc_clang
63#endif
A container class to hold entry function information.
virtual bool VisitCXXMethodDecl(CXXMethodDecl *d)
virtual bool VisitStringLiteral(StringLiteral *l)
Virtual methods from RecursiveASTVisitor.
vector< CXXMethodDecl * > other_function_list_
FindEntryFunctions(llvm::raw_ostream &os)
entryFunctionVectorType entry_function_list_
entryFunctionLHSMapType entry_function_map_
vector< CXXMethodDecl * > getOtherFunctions()
std::vector< EntryFunctionContainer * > entryFunctionVectorType
Typedefs.
FindEntryFunctions(const clang::CXXRecordDecl *d, llvm::raw_ostream &os, clang::ASTContext &ctx)
virtual bool VisitMemberExpr(MemberExpr *e)
std::pair< string, vector< string > > entryFunctionLHSPairType
clang::CXXConstructorDecl * ctor_decl_
entryFunctionVectorType * getEntryFunctions()
std::map< string, vector< string > > entryFunctionLHSMapType
Clang forward declarations.
Definition FindArgument.h:6