Commit d905b5bd authored by Anirudh Kaushik's avatar Anirudh Kaushik
Browse files

Revamp of path enumeration logic

parent 61065098
This diff is collapsed.
...@@ -112,6 +112,12 @@ namespace scpar { ...@@ -112,6 +112,12 @@ namespace scpar {
typedef vector < SusCFG * >susCFGVectorType; typedef vector < SusCFG * >susCFGVectorType;
typedef vector <Transition *> transitionVectorType; typedef vector <Transition *> transitionVectorType;
typedef pair<SusCFG*, int> susCFGSuccIDPairType;
typedef map<SusCFG*, int> susCFGSuccIDMapType;
typedef pair < SusCFG *, State * >susCFGStatePairType;
typedef map < SusCFG *, State * >susCFGStateMapType;
SuspensionAutomata(FindWait::waitListType, CXXMethodDecl *, ASTContext *, SuspensionAutomata(FindWait::waitListType, CXXMethodDecl *, ASTContext *,
raw_ostream &); raw_ostream &);
...@@ -119,9 +125,10 @@ namespace scpar { ...@@ -119,9 +125,10 @@ namespace scpar {
bool isFound(vector < SusCFG * >, SusCFG *); bool isFound(vector < SusCFG * >, SusCFG *);
bool isFound(vector < Transition * >, Transition *); bool isFound(vector < Transition * >, Transition *);
void initialize(); bool initialize();
void genSusCFG(); void genSusCFG();
void genSauto(); void genSauto();
vector<SusCFG*> modifDFS(SusCFG*, State*);
bool isWaitCall(const CFGStmt * cs); bool isWaitCall(const CFGStmt * cs);
bool isTimedWait(Stmt * stmt); bool isTimedWait(Stmt * stmt);
bool isDeltaWait(Stmt * stmt); bool isDeltaWait(Stmt * stmt);
...@@ -139,12 +146,13 @@ namespace scpar { ...@@ -139,12 +146,13 @@ namespace scpar {
private: private:
CXXMethodDecl *_d; CXXMethodDecl *_d;
FindWait::waitListType _waitCalls; FindWait::waitListType _waitCalls;
susCFGSuccIDMapType susCFGSuccIDMap;
susCFGStateMapType susCFGStateMap;
CFG *_cfg; CFG *_cfg;
ASTContext *_a; ASTContext *_a;
raw_ostream & _os; raw_ostream & _os;
susCFGVectorType _susCFGVector; susCFGVectorType _susCFGVector;
transitionVectorType _transitionVector; transitionVectorType _transitionVector;
}; // End class SplitWaitBlocks }; // End class SplitWaitBlocks
} // End namespace scpar } // End namespace scpar
#endif #endif
...@@ -79,15 +79,20 @@ bool SystemCConsumer::fire() ...@@ -79,15 +79,20 @@ bool SystemCConsumer::fire()
FindNotify findNotify(ef->_entryMethodDecl, _os); FindNotify findNotify(ef->_entryMethodDecl, _os);
ef->addNotifys(findNotify); ef->addNotifys(findNotify);
SuspensionAutomata suspensionAutomata(findWaits.getWaitCalls(), ef->getEntryMethod(), &_context, llvm::errs()); SuspensionAutomata suspensionAutomata(findWaits.getWaitCalls(), ef->getEntryMethod(), &_context, llvm::errs());
suspensionAutomata.initialize(); if (suspensionAutomata.initialize()) {
suspensionAutomata.genSusCFG(); suspensionAutomata.genSusCFG();
suspensionAutomata.genSauto(); suspensionAutomata.dumpSusCFG();
suspensionAutomata.genSauto();
suspensionAutomata.dumpSauto();
ef->addSusCFGAuto(suspensionAutomata);
}
ef->addSusCFGAuto(suspensionAutomata);
_entryFunctionContainerVector.push_back(ef); _entryFunctionContainerVector.push_back(ef);
}
}
_systemcModel->addModuleDecl(md); _systemcModel->addModuleDecl(md);
} }
......
...@@ -55,8 +55,7 @@ using namespace clang; ...@@ -55,8 +55,7 @@ using namespace clang;
namespace scpar namespace scpar
{ {
class SystemCConsumer:public ASTConsumer, class SystemCConsumer:public ASTConsumer, public RecursiveASTVisitor < SystemCConsumer >
public RecursiveASTVisitor < SystemCConsumer >
{ {
private: private:
...@@ -65,8 +64,6 @@ namespace scpar ...@@ -65,8 +64,6 @@ namespace scpar
llvm::raw_ostream & _os; llvm::raw_ostream & _os;
SourceManager & _sm; SourceManager & _sm;
SystemCConsumer(CompilerInstance &); SystemCConsumer(CompilerInstance &);
~SystemCConsumer(); ~SystemCConsumer();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment