EntryFunctionContainer.h 2.81 KB
Newer Older
Anirudh Kaushik's avatar
Anirudh Kaushik committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//===-- src/EntryFunctionContainer.h - systec-clang class definition -------*- C++ -*-===//
//
//                     systemc-clang: SystemC Parser
//
// This file is distributed under the University of Illinois License.
// See LICENSE.mkd for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief A container class to hold entry function information.
///
//===----------------------------------------------------------------------===//
#ifndef _ENTRY_FUNCTION_CONTAINER_H_
#define _ENTRY_FUNCTION_CONTAINER_H_

#include <string>
#include <map>
#include "clang/AST/DeclCXX.h"
#include "WaitContainer.h"
#include "NotifyContainer.h"
#include "enums.h"
#include "FindWait.h"
#include "Utility.h"
#include "FindNotify.h"
#include "FindSensitivity.h"
#include "SuspensionAutomata.h"
namespace scpar {

	using namespace clang;
	using namespace std;

	class EntryFunctionContainer {
	public:
		// typedefs
		typedef vector < WaitContainer * >waitContainerListType;
37
  	typedef vector < NotifyContainer *> notifyContainerListType;
Anirudh Kaushik's avatar
Anirudh Kaushik committed
38
   
39
40
41
42
43
44
45
		typedef pair<int, SuspensionAutomata::transitionVectorType> instanceSautoPairType;
		typedef map<int, SuspensionAutomata::transitionVectorType> instanceSautoMapType;

		typedef pair <int, SuspensionAutomata::susCFGVectorType> instanceSusCFGPairType;
		typedef map <int, SuspensionAutomata::susCFGVectorType> instanceSusCFGMapType;
  	
		EntryFunctionContainer ();
Anirudh Kaushik's avatar
Anirudh Kaushik committed
46
47
48
49
50
51
52
53
54
55
56
		EntryFunctionContainer (string, PROCESS_TYPE, CXXMethodDecl *, Stmt *);
		EntryFunctionContainer (const EntryFunctionContainer &);
	 ~EntryFunctionContainer ();

		// Accessors.
		string getName ();
		CXXMethodDecl *getEntryMethod ();
		//Stmt *getConstructorStmt ();
		PROCESS_TYPE getProcessType ();

		waitContainerListType getWaitCalls ();
57
58
59
60
61
62
  	notifyContainerListType getNotifyCalls();
  	FindSensitivity::senseMapType getSenseMap();
  	SuspensionAutomata::susCFGVectorType getSusCFG(int);
  	SuspensionAutomata::transitionVectorType getSusAuto(int);
		instanceSautoMapType getInstanceSautoMap();
		instanceSusCFGMapType getInstanceSusCFGMap();
Anirudh Kaushik's avatar
Anirudh Kaushik committed
63
64
65

		// Add waits.
		void addSensitivityInfo(FindSensitivity &);
66
  	void addWaits (FindWait &);
Anirudh Kaushik's avatar
Anirudh Kaushik committed
67
		void addNotifys(FindNotify &);   
68
		void addSusCFGAuto(SuspensionAutomata &, int);
Anirudh Kaushik's avatar
Anirudh Kaushik committed
69
70
71
72
73
74
  
  //void setConstructorStmt (Stmt *);
		void setName (string);
		void setProcessType (PROCESS_TYPE);
		void setEntryMethod (CXXMethodDecl *);
		void dumpSusCFG(raw_ostream &);
75
76
  	void dumpSauto(raw_ostream &);
  	void dump (raw_ostream &, int);
Anirudh Kaushik's avatar
Anirudh Kaushik committed
77
78
79
80
81
82


		//private:    
		string _entryName;
		PROCESS_TYPE _procType;
		CXXMethodDecl *_entryMethodDecl;
83

Anirudh Kaushik's avatar
Anirudh Kaushik committed
84
85
		// Hold all the waits.
		waitContainerListType _waitCalls;
86
  	notifyContainerListType _notifyCalls;
Anirudh Kaushik's avatar
Anirudh Kaushik committed
87
	 FindSensitivity::senseMapType _senseMap;
88
89
	 instanceSautoMapType _instanceSautoMap;
	 instanceSusCFGMapType _instanceSusCFGMap;
Anirudh Kaushik's avatar
Anirudh Kaushik committed
90
91
92
 };
}
#endif