Skip to content

Commit 7d44b97

Browse files
committed
Remove some LLVM dependencies.
1 parent ac8d64d commit 7d44b97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+275
-359
lines changed

include/DDA/DDAPass.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace SVF
2121
* Demand-Driven Pointer Analysis.
2222
* This class performs various pointer analysis on the given module.
2323
*/
24-
class DDAPass: public ModulePass
24+
class DDAPass
2525
{
2626

2727
public:
@@ -31,21 +31,9 @@ class DDAPass: public ModulePass
3131
typedef OrderedSet<const SVFGEdge*> SVFGEdgeSet;
3232
typedef std::vector<PointerAnalysis*> PTAVector;
3333

34-
DDAPass() : ModulePass(ID), _pta(nullptr), _client(nullptr) {}
34+
DDAPass() : _pta(nullptr), _client(nullptr) {}
3535
~DDAPass();
3636

37-
virtual inline void getAnalysisUsage(AnalysisUsage &au) const
38-
{
39-
// declare your dependencies here.
40-
/// do not intend to change the IR in this pass,
41-
au.setPreservesAll();
42-
}
43-
44-
virtual inline void* getAdjustedAnalysisPointer(AnalysisID)
45-
{
46-
return this;
47-
}
48-
4937
/// Interface expose to users of our pointer analysis, given Location infos
5038
virtual inline AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
5139
{

include/Graphs/GraphPrinter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GraphPrinter
5454
* Write the graph into dot file for debugging purpose
5555
*/
5656
template<class GraphType>
57-
static void WriteGraphToFile(llvm::raw_ostream &O,
57+
static void WriteGraphToFile(SVF::OutStream &O,
5858
const std::string &GraphName, const GraphType &GT, bool simple = false)
5959
{
6060
// Filename of the output dot file
@@ -83,7 +83,7 @@ class GraphPrinter
8383
* Print the graph to command line
8484
*/
8585
template<class GraphType>
86-
static void PrintGraph(llvm::raw_ostream &O, const std::string &GraphName,
86+
static void PrintGraph(SVF::OutStream &O, const std::string &GraphName,
8787
const GraphType &GT)
8888
{
8989
///Define the GTraits and node iterator for printing

include/Graphs/ICFGEdge.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ICFGEdge : public GenericICFGEdgeTy
9696

9797
/// Overloading operator << for dumping ICFG node ID
9898
//@{
99-
friend raw_ostream& operator<< (raw_ostream &o, const ICFGEdge &edge)
99+
friend OutStream& operator<< (OutStream &o, const ICFGEdge &edge)
100100
{
101101
o << edge.toString();
102102
return o;

include/Graphs/ICFGNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ICFGNode : public GenericICFGNodeTy
9191

9292
/// Overloading operator << for dumping ICFG node ID
9393
//@{
94-
friend raw_ostream &operator<<(raw_ostream &o, const ICFGNode &node)
94+
friend OutStream &operator<<(OutStream &o, const ICFGNode &node)
9595
{
9696
o << node.toString();
9797
return o;

include/Graphs/ICFGStat.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,16 @@ class ICFGStat : public PTAStat
145145
void printStat(string statname)
146146
{
147147

148-
std::cout << "\n************ " << statname << " ***************\n";
149-
std::cout.flags(std::ios::left);
148+
SVFUtil::outs() << "\n************ " << statname << " ***************\n";
149+
SVFUtil::outs().flags(std::ios::left);
150150
unsigned field_width = 20;
151151
for(NUMStatMap::iterator it = PTNumStatMap.begin(), eit = PTNumStatMap.end(); it!=eit; ++it)
152152
{
153153
// format out put with width 20 space
154-
std::cout << std::setw(field_width) << it->first << it->second << "\n";
154+
SVFUtil::outs() << std::setw(field_width) << it->first << it->second << "\n";
155155
}
156156
PTNumStatMap.clear();
157-
std::cout.flush();
157+
SVFUtil::outs().flush();
158158
}
159159
};
160160

include/Graphs/PTACallGraph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class PTACallGraphEdge : public GenericCallGraphEdgeTy
154154

155155
/// Overloading operator << for dumping ICFG node ID
156156
//@{
157-
friend raw_ostream& operator<< (raw_ostream &o, const PTACallGraphEdge &edge)
157+
friend OutStream& operator<< (OutStream &o, const PTACallGraphEdge &edge)
158158
{
159159
o << edge.toString();
160160
return o;
@@ -201,7 +201,7 @@ class PTACallGraphNode : public GenericCallGraphNodeTy
201201

202202
/// Overloading operator << for dumping ICFG node ID
203203
//@{
204-
friend raw_ostream& operator<< (raw_ostream &o, const PTACallGraphNode &node)
204+
friend OutStream& operator<< (OutStream &o, const PTACallGraphNode &node)
205205
{
206206
o << node.toString();
207207
return o;

include/Graphs/VFG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ class VFG : public GenericVFGTy
555555
/// we will set this phi node's def later
556556
/// Ideally, every function uniqueFunRet should be a PhiNode (SVFIRBuilder.cpp), unless it does not have ret instruction
557557
if (!pag->isPhiNode(uniqueFunRet)){
558-
std::string warn = fun->getName().str();
558+
std::string warn = fun->getName();
559559
SVFUtil::writeWrnMsg(warn + " does not have any ret instruction!");
560560
setDef(uniqueFunRet, sNode);
561561
}

include/Graphs/VFGEdge.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class VFGEdge : public GenericVFGEdgeTy
124124

125125
/// Overloading operator << for dumping ICFG node ID
126126
//@{
127-
friend raw_ostream& operator<< (raw_ostream &o, const VFGEdge &edge)
127+
friend OutStream& operator<< (OutStream &o, const VFGEdge &edge)
128128
{
129129
o << edge.toString();
130130
return o;

include/Graphs/VFGNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class VFGNode : public GenericVFGNodeTy
9494

9595
/// Overloading operator << for dumping ICFG node ID
9696
//@{
97-
friend raw_ostream& operator<< (raw_ostream &o, const VFGNode &node)
97+
friend OutStream& operator<< (OutStream &o, const VFGNode &node)
9898
{
9999
o << node.toString();
100100
return o;

include/MSSA/MemSSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ class MemSSA
451451
//@}
452452

453453
/// Print Memory SSA
454-
void dumpMSSA(raw_ostream & Out = SVFUtil::outs());
454+
void dumpMSSA(OutStream & Out = SVFUtil::outs());
455455
};
456456

457457
} // End namespace SVF

0 commit comments

Comments
 (0)