Skip to content
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

add simplify ICFG #1386

Merged
merged 22 commits into from
Mar 3, 2024
Merged

add simplify ICFG #1386

merged 22 commits into from
Mar 3, 2024

Conversation

bjjwwang
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 97.67442% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 67.83%. Comparing base (78d4f6e) to head (abc4950).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1386      +/-   ##
==========================================
+ Coverage   67.74%   67.83%   +0.08%     
==========================================
  Files         249      250       +1     
  Lines       27561    27632      +71     
==========================================
+ Hits        18672    18743      +71     
  Misses       8889     8889              
Files Coverage Δ
svf-llvm/tools/AE/ae.cpp 100.00% <100.00%> (ø)
svf/include/AE/Svfexe/AbstractExecution.h 100.00% <ø> (ø)
svf/include/Graphs/ICFG.h 95.38% <100.00%> (+1.04%) ⬆️
svf/lib/AE/Svfexe/ICFGSimplification.cpp 100.00% <100.00%> (ø)
svf/lib/Graphs/ICFG.cpp 81.78% <100.00%> (+0.14%) ⬆️
svf/lib/AE/Svfexe/AbstractExecution.cpp 84.01% <92.30%> (+0.04%) ⬆️
svf/lib/AE/Svfexe/BufOverflowChecker.cpp 77.83% <50.00%> (ø)

@@ -251,6 +258,7 @@ static void simplify(ICFG* _icfg)
edge->getSrcNode()->removeOutgoingEdge(edge);
}
}
_icfg->dump("cICFG");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this under option "-dump-icfg" and change "cICFG" => "ICFG.simplified"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why using static method for void simplify(ICFG* _icfg)?

#include <exception>
#include <string>
#include "AE/Core/ICFGWTO.h"
#include "AE/Svfexe/ICFGSimplification.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this header?

@@ -27,15 +27,13 @@
//
// Created by Jiawei Wang on 2024/1/10.
//
#include <exception>
#include <string>
#include "AE/Core/ICFGWTO.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we put this header and these two #include "Util/WorkList.h" #include "WPA/Andersen.h" into cpp if their methods are not explicitly used in this header?

pag->getICFG()->updateCallGraph(callgraph);
if (Options::SimplifyICFG()) {
ICFGSimplification::simplify(pag->getICFG());
if (Options::DumpSimplifiedICFG())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this option and use -dump-icfg as the name of the output icfg.simplify.dot is different from original icfg.dot

}

virtual void addRepNode(const ICFGNode* key, const ICFGNode* value) {
_repNode[key] = value;
void addRepNode(const ICFGNode* rep, const ICFGNode* sub) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addRepNode =>updateRepNode


virtual ~ICFGSimplification() = default;

static void mergeAdjacentNodes(ICFG* icfg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this implementation to cpp

@@ -148,27 +152,27 @@ class ICFG : public GenericICFGTy
}

protected:
/// Remove a SVFG edge
/// Add control-flow edges for top level pointers
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this comment to:

Add intraprocedural and interprocedural control-flow edges.

@yuleisui yuleisui merged commit 9aa7d45 into SVF-tools:master Mar 3, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants