Skip to content

Commit 52f853f

Browse files
committed
minor refactoring to clean up Util/BasicTypes.h
1 parent 1c9a1dd commit 52f853f

File tree

7 files changed

+14
-34
lines changed

7 files changed

+14
-34
lines changed

include/MemoryModel/PointerAnalysis.h

-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class PointerAnalysis
9999

100100
/// Indirect call edges type, map a callsite to a set of callees
101101
//@{
102-
typedef llvm::AliasAnalysis AliasAnalysis;
103102
typedef Set<const CallICFGNode*> CallSiteSet;
104103
typedef SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap;
105104
typedef Set<const SVFFunction*> FunctionSet;

include/SVF-FE/BasicTypes.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@
2727

2828
#include <llvm/Support/SourceMgr.h>
2929

30-
#include "llvm/Analysis/LoopInfo.h"
30+
#include <llvm/Bitcode/BitcodeWriter.h> // for WriteBitcodeToFile
31+
#include <llvm/Bitcode/BitcodeReader.h> /// for isBitcode
32+
#include <llvm/IRReader/IRReader.h> // IR reader for bit file
33+
#include <llvm/IR/InstVisitor.h> // for instruction visitor
34+
#include <llvm/IR/InstIterator.h> // for inst iteration
35+
36+
#include <llvm/Analysis/LoopInfo.h>
3137

3238
namespace SVF
3339
{

include/Util/BasicTypes.h

+1-22
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,16 @@
3333
#include "Util/SVFBasicTypes.h"
3434
#include "Graphs/GraphPrinter.h"
3535
#include "Util/Casting.h"
36-
#include <llvm/ADT/SparseBitVector.h>
3736
#include <llvm/IR/Instructions.h>
38-
#include <llvm/IR/InstVisitor.h> // for instruction visitor
39-
#include <llvm/IR/InstIterator.h> // for inst iteration
4037
#include <llvm/IR/GetElementPtrTypeIterator.h> //for gep iterator
41-
#include <llvm/ADT/StringExtras.h> // for utostr_32
42-
#include <llvm/Analysis/AliasAnalysis.h>
43-
#include <llvm/Analysis/CallGraph.h> // call graph
4438
#include <llvm/IR/GlobalVariable.h> // for GlobalVariable
39+
#include <llvm/IR/BasicBlock.h>
4540

46-
#include <llvm/Bitcode/BitcodeWriter.h> // for WriteBitcodeToFile
47-
#include <llvm/Bitcode/BitcodeReader.h> /// for isBitcode
48-
#include <llvm/IRReader/IRReader.h> // IR reader for bit file
49-
#include <llvm/Analysis/DominanceFrontier.h>
50-
#include <llvm/Analysis/PostDominators.h>
51-
#include <llvm/ADT/GraphTraits.h> // for Graphtraits
52-
#include <llvm/Transforms/Utils/Local.h> // for FindDbgAddrUses
53-
54-
#if (LLVM_VERSION_MAJOR >= 14)
55-
#include <llvm/BinaryFormat/Dwarf.h>
56-
#endif
57-
58-
#include "llvm/IR/CFG.h"
5941
#include "llvm/BinaryFormat/Dwarf.h"
6042

6143
namespace SVF
6244
{
6345

64-
class BddCond;
65-
66-
6746
/// LLVM Basic classes
6847
typedef llvm::Type Type;
6948
typedef llvm::Function Function;

include/Util/Casting.h

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <cassert>
2929
#include <memory>
3030
#include <type_traits>
31+
#include <llvm/IR/BasicBlock.h>
3132

3233
namespace SVF
3334
{

include/Util/SVFBasicTypes.h

-5
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#ifndef INCLUDE_UTIL_SVFBASICTYPES_H_
3232
#define INCLUDE_UTIL_SVFBASICTYPES_H_
3333

34-
// TODO: these are just for SmallBBVector.
35-
#include <llvm/IR/BasicBlock.h>
36-
#include <llvm/ADT/SmallVector.h>
37-
3834
#include <llvm/Support/CommandLine.h> // for command line options
3935

4036
#include <Util/SparseBitVector.h>
@@ -116,7 +112,6 @@ template<typename Key, typename Value, typename Hash = Hash<Key>,
116112
typename Allocator = std::allocator<std::pair<const Key, Value>>>
117113
using OrderedMap = std::map<Key, Value, Compare, Allocator>;
118114

119-
typedef llvm::SmallVector<llvm::BasicBlock*, 8> SmallBBVector;
120115
typedef std::pair<NodeID, NodeID> NodePair;
121116
typedef OrderedSet<NodeID> OrderedNodeSet;
122117
typedef Set<NodeID> NodeSet;

lib/MTA/MHP.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ void MHP::handleJoin(const CxtThreadStmt& cts, NodeID rootTid)
267267
{
268268
if(const Loop* joinLoop = fja->getJoinLoop(call))
269269
{
270-
SmallBBVector exitbbs;
270+
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
271271
joinLoop->getExitBlocks(exitbbs);
272272
while(!exitbbs.empty())
273273
{
@@ -290,7 +290,7 @@ void MHP::handleJoin(const CxtThreadStmt& cts, NodeID rootTid)
290290
{
291291
if(const Loop* joinLoop = fja->getJoinLoop(call))
292292
{
293-
SmallBBVector exitbbs;
293+
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
294294
joinLoop->getExitBlocks(exitbbs);
295295
while(!exitbbs.empty())
296296
{
@@ -853,7 +853,7 @@ void ForkJoinAnalysis::handleJoin(const CxtStmt& cts, NodeID rootTid)
853853
{
854854
if(const Loop* joinLoop = getJoinLoop(joinSite))
855855
{
856-
SmallBBVector exitbbs;
856+
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
857857
joinLoop->getExitBlocks(exitbbs);
858858
while(!exitbbs.empty())
859859
{
@@ -882,7 +882,7 @@ void ForkJoinAnalysis::handleJoin(const CxtStmt& cts, NodeID rootTid)
882882
{
883883
if(const Loop* joinLoop = getJoinLoop(joinSite))
884884
{
885-
SmallBBVector exitbbs;
885+
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
886886
joinLoop->getExitBlocks(exitbbs);
887887
while(!exitbbs.empty())
888888
{

lib/MTA/TCT.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ bool TCT::isLoopExitOfJoinLoop(const BasicBlock* bb)
353353
{
354354
for(InstToLoopMap::const_iterator it = joinSiteToLoopMap.begin(), eit = joinSiteToLoopMap.end(); it!=eit; ++it)
355355
{
356-
SmallBBVector exitbbs;
356+
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
357357
it->second->getExitBlocks(exitbbs);
358358
while(!exitbbs.empty())
359359
{

0 commit comments

Comments
 (0)