-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix issue 1139 #1155
fix issue 1139 #1155
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,28 +97,9 @@ void AndersenBase::finalize() | |
BVDataPTAImpl::finalize(); | ||
} | ||
|
||
/*! | ||
* Andersen analysis | ||
*/ | ||
void AndersenBase::analyze() | ||
void AndersenBase::solveConstraints() | ||
{ | ||
/// Initialization for the Solver | ||
initialize(); | ||
|
||
bool readResultsFromFile = false; | ||
if(!Options::ReadAnder().empty()) | ||
{ | ||
readResultsFromFile = this->readFromFile(Options::ReadAnder()); | ||
// Finalize the analysis | ||
PointerAnalysis::finalize(); | ||
} | ||
|
||
if (!Options::WriteAnder().empty()) | ||
this->writeObjVarToFile(Options::WriteAnder()); | ||
|
||
if(!readResultsFromFile) | ||
{ | ||
// Start solving constraints | ||
// Start solving constraints | ||
DBOUT(DGENERAL, outs() << SVFUtil::pasMsg("Start Solving Constraints\n")); | ||
|
||
bool limitTimerSet = SVFUtil::startAnalysisLimitTimer(Options::AnderTimeLimit()); | ||
|
@@ -144,9 +125,30 @@ void AndersenBase::analyze() | |
SVFUtil::stopAnalysisLimitTimer(limitTimerSet); | ||
|
||
DBOUT(DGENERAL, outs() << SVFUtil::pasMsg("Finish Solving Constraints\n")); | ||
} | ||
|
||
/*! | ||
* Andersen analysis | ||
*/ | ||
void AndersenBase::analyze() | ||
{ | ||
/// Initialization for the Solver | ||
initialize(); | ||
|
||
bool readResultsFromFile = false; | ||
if(!Options::ReadAnder().empty()) | ||
{ | ||
readResultsFromFile = this->readFromFile(Options::ReadAnder()); | ||
// Finalize the analysis | ||
PointerAnalysis::finalize(); | ||
} | ||
|
||
if (!Options::WriteAnder().empty()) | ||
this->writeObjVarToFile(Options::WriteAnder()); | ||
|
||
if(!readResultsFromFile) | ||
solveConstraints(); | ||
|
||
if (!Options::WriteAnder().empty()) | ||
{ | ||
this->writeToFile(Options::WriteAnder()); | ||
|
@@ -157,6 +159,30 @@ void AndersenBase::analyze() | |
finalize(); | ||
} | ||
|
||
|
||
void AndersenBase::analyzeAndWrite(const std::string& filename) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. analyzeAndWrite => SolveAndWritePtsToFile SolveAndWritePtsToFile(filename){ initialize(); } |
||
{ | ||
/// Initialization for the Solver | ||
initialize(); | ||
|
||
bool readResultsFromFile = false; | ||
|
||
if (filename.empty()) | ||
this->writeObjVarToFile(filename); | ||
|
||
if(!readResultsFromFile) | ||
solveConstraints(); | ||
|
||
if (filename.empty()) | ||
{ | ||
this->writeToFile(filename); | ||
} | ||
|
||
if (!readResultsFromFile) | ||
// Finalize the analysis | ||
finalize(); | ||
} | ||
|
||
void AndersenBase::cleanConsCG(NodeID id) | ||
{ | ||
consCG->resetSubs(consCG->getRep(id)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,18 +74,8 @@ void FlowSensitive::initialize() | |
setGraph(svfg); | ||
//AndersenWaveDiff::releaseAndersenWaveDiff(); | ||
} | ||
|
||
/*! | ||
* Start analysis | ||
*/ | ||
void FlowSensitive::analyze() | ||
void FlowSensitive::solveConstraints() | ||
{ | ||
bool limitTimerSet = SVFUtil::startAnalysisLimitTimer(Options::FsTimeLimit()); | ||
|
||
/// Initialization for the Solver | ||
initialize(); | ||
|
||
double start = stat->getClk(true); | ||
/// Start solving constraints | ||
DBOUT(DGENERAL, outs() << SVFUtil::pasMsg("Start Solving Constraints\n")); | ||
|
||
|
@@ -104,6 +94,46 @@ void FlowSensitive::analyze() | |
while (updateCallGraph(getIndirectCallsites())); | ||
|
||
DBOUT(DGENERAL, outs() << SVFUtil::pasMsg("Finish Solving Constraints\n")); | ||
} | ||
|
||
/*! | ||
* Start analysis | ||
*/ | ||
void FlowSensitive::analyzeAndWrite(const std::string& filename) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add two methods "solveAndwritePtsToFile" and "readPtsFromFile" |
||
{ | ||
bool limitTimerSet = SVFUtil::startAnalysisLimitTimer(Options::FsTimeLimit()); | ||
|
||
/// Initialization for the Solver | ||
initialize(); | ||
|
||
double start = stat->getClk(true); | ||
writeObjVarToFile(filename); | ||
solveConstraints(); | ||
|
||
// Reset the time-up alarm; analysis is done. | ||
SVFUtil::stopAnalysisLimitTimer(limitTimerSet); | ||
|
||
writeToFile(filename); | ||
|
||
double end = stat->getClk(true); | ||
solveTime += (end - start) / TIMEINTERVAL; | ||
|
||
/// finalize the analysis | ||
finalize(); | ||
} | ||
|
||
/*! | ||
* Start analysis | ||
*/ | ||
void FlowSensitive::analyze() | ||
{ | ||
bool limitTimerSet = SVFUtil::startAnalysisLimitTimer(Options::FsTimeLimit()); | ||
|
||
/// Initialization for the Solver | ||
initialize(); | ||
|
||
double start = stat->getClk(true); | ||
solveConstraints(); | ||
|
||
// Reset the time-up alarm; analysis is done. | ||
SVFUtil::stopAnalysisLimitTimer(limitTimerSet); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(!Options::ReadAnder().empty()){
readPtsFromFile(Options::ReadAnder());
}
else{
if(Options::WriteAnder().empty()) {
initialize();
solveConstraints();
finalize();
}
else{
solveAndwritePtsToFile(Options::WriteAnder());
}
}
readPtsFromFile(filename){
initialize();
this->readFromFile(Options::ReadAnder());
PointerAnalysis::finalize();
}