Skip to content

Commit

Permalink
minor refactoring to clean up Util/BasicTypes.h
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Nov 9, 2022
1 parent 1c9a1dd commit 52f853f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 34 deletions.
1 change: 0 additions & 1 deletion include/MemoryModel/PointerAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class PointerAnalysis

/// Indirect call edges type, map a callsite to a set of callees
//@{
typedef llvm::AliasAnalysis AliasAnalysis;
typedef Set<const CallICFGNode*> CallSiteSet;
typedef SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap;
typedef Set<const SVFFunction*> FunctionSet;
Expand Down
8 changes: 7 additions & 1 deletion include/SVF-FE/BasicTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@

#include <llvm/Support/SourceMgr.h>

#include "llvm/Analysis/LoopInfo.h"
#include <llvm/Bitcode/BitcodeWriter.h> // for WriteBitcodeToFile
#include <llvm/Bitcode/BitcodeReader.h> /// for isBitcode
#include <llvm/IRReader/IRReader.h> // IR reader for bit file
#include <llvm/IR/InstVisitor.h> // for instruction visitor
#include <llvm/IR/InstIterator.h> // for inst iteration

#include <llvm/Analysis/LoopInfo.h>

namespace SVF
{
Expand Down
23 changes: 1 addition & 22 deletions include/Util/BasicTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,16 @@
#include "Util/SVFBasicTypes.h"
#include "Graphs/GraphPrinter.h"
#include "Util/Casting.h"
#include <llvm/ADT/SparseBitVector.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/InstVisitor.h> // for instruction visitor
#include <llvm/IR/InstIterator.h> // for inst iteration
#include <llvm/IR/GetElementPtrTypeIterator.h> //for gep iterator
#include <llvm/ADT/StringExtras.h> // for utostr_32
#include <llvm/Analysis/AliasAnalysis.h>
#include <llvm/Analysis/CallGraph.h> // call graph
#include <llvm/IR/GlobalVariable.h> // for GlobalVariable
#include <llvm/IR/BasicBlock.h>

#include <llvm/Bitcode/BitcodeWriter.h> // for WriteBitcodeToFile
#include <llvm/Bitcode/BitcodeReader.h> /// for isBitcode
#include <llvm/IRReader/IRReader.h> // IR reader for bit file
#include <llvm/Analysis/DominanceFrontier.h>
#include <llvm/Analysis/PostDominators.h>
#include <llvm/ADT/GraphTraits.h> // for Graphtraits
#include <llvm/Transforms/Utils/Local.h> // for FindDbgAddrUses

#if (LLVM_VERSION_MAJOR >= 14)
#include <llvm/BinaryFormat/Dwarf.h>
#endif

#include "llvm/IR/CFG.h"
#include "llvm/BinaryFormat/Dwarf.h"

namespace SVF
{

class BddCond;


/// LLVM Basic classes
typedef llvm::Type Type;
typedef llvm::Function Function;
Expand Down
1 change: 1 addition & 0 deletions include/Util/Casting.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <cassert>
#include <memory>
#include <type_traits>
#include <llvm/IR/BasicBlock.h>

namespace SVF
{
Expand Down
5 changes: 0 additions & 5 deletions include/Util/SVFBasicTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#ifndef INCLUDE_UTIL_SVFBASICTYPES_H_
#define INCLUDE_UTIL_SVFBASICTYPES_H_

// TODO: these are just for SmallBBVector.
#include <llvm/IR/BasicBlock.h>
#include <llvm/ADT/SmallVector.h>

#include <llvm/Support/CommandLine.h> // for command line options

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

typedef llvm::SmallVector<llvm::BasicBlock*, 8> SmallBBVector;
typedef std::pair<NodeID, NodeID> NodePair;
typedef OrderedSet<NodeID> OrderedNodeSet;
typedef Set<NodeID> NodeSet;
Expand Down
8 changes: 4 additions & 4 deletions lib/MTA/MHP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void MHP::handleJoin(const CxtThreadStmt& cts, NodeID rootTid)
{
if(const Loop* joinLoop = fja->getJoinLoop(call))
{
SmallBBVector exitbbs;
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
joinLoop->getExitBlocks(exitbbs);
while(!exitbbs.empty())
{
Expand All @@ -290,7 +290,7 @@ void MHP::handleJoin(const CxtThreadStmt& cts, NodeID rootTid)
{
if(const Loop* joinLoop = fja->getJoinLoop(call))
{
SmallBBVector exitbbs;
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
joinLoop->getExitBlocks(exitbbs);
while(!exitbbs.empty())
{
Expand Down Expand Up @@ -853,7 +853,7 @@ void ForkJoinAnalysis::handleJoin(const CxtStmt& cts, NodeID rootTid)
{
if(const Loop* joinLoop = getJoinLoop(joinSite))
{
SmallBBVector exitbbs;
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
joinLoop->getExitBlocks(exitbbs);
while(!exitbbs.empty())
{
Expand Down Expand Up @@ -882,7 +882,7 @@ void ForkJoinAnalysis::handleJoin(const CxtStmt& cts, NodeID rootTid)
{
if(const Loop* joinLoop = getJoinLoop(joinSite))
{
SmallBBVector exitbbs;
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
joinLoop->getExitBlocks(exitbbs);
while(!exitbbs.empty())
{
Expand Down
2 changes: 1 addition & 1 deletion lib/MTA/TCT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ bool TCT::isLoopExitOfJoinLoop(const BasicBlock* bb)
{
for(InstToLoopMap::const_iterator it = joinSiteToLoopMap.begin(), eit = joinSiteToLoopMap.end(); it!=eit; ++it)
{
SmallBBVector exitbbs;
llvm::SmallVector<llvm::BasicBlock*, 8> exitbbs;
it->second->getExitBlocks(exitbbs);
while(!exitbbs.empty())
{
Expand Down

0 comments on commit 52f853f

Please sign in to comment.