Static Value-Flow Analysis
Classes | Namespaces | Typedefs | Functions | Variables
SVFUtil.h File Reference
#include "FastCluster/fastcluster.h"
#include "SVFIR/SVFValue.h"
#include "SVFIR/SVFModule.h"
#include "Util/ExtAPI.h"
#include "MemoryModel/PointsTo.h"
#include <time.h>

Go to the source code of this file.

Classes

struct  SVF::SVFUtil::equalPointsTo
 
struct  SVF::SVFUtil::equalNodeBS
 
struct  SVF::SVFUtil::make_void< Ts >
 void_t is not available until C++17. We define it here for C++11/14. More...
 
struct  SVF::SVFUtil::is_iterable< T, typename >
 Type trait that checks if a type is iterable (can be applied on a range-based for loop) More...
 
struct  SVF::SVFUtil::is_iterable< T, void_t< decltype(std::begin(std::declval< T & >()) !=std::end(std::declval< T & >()))> >
 
struct  SVF::SVFUtil::is_map< T >
 Type trait to check if a type is a map or unordered_map. More...
 
struct  SVF::SVFUtil::is_map< std::map< Ts... > >
 
struct  SVF::SVFUtil::is_map< std::unordered_map< Ts... > >
 
struct  SVF::SVFUtil::is_set< T >
 Type trait to check if a type is a set or unordered_set. More...
 
struct  SVF::SVFUtil::is_set< std::set< Ts... > >
 
struct  SVF::SVFUtil::is_set< std::unordered_set< Ts... > >
 
struct  SVF::SVFUtil::is_sequence_container< T >
 Type trait to check if a type is vector or list. More...
 
struct  SVF::SVFUtil::is_sequence_container< std::vector< Ts... > >
 
struct  SVF::SVFUtil::is_sequence_container< std::deque< Ts... > >
 
struct  SVF::SVFUtil::is_sequence_container< std::list< Ts... > >
 

Namespaces

 SVF
 for isBitcode
 
 SVF::SVFUtil
 

Typedefs

typedef struct SVF::SVFUtil::equalPointsTo SVF::SVFUtil::equalPointsTo
 
typedef struct SVF::SVFUtil::equalNodeBS SVF::SVFUtil::equalNodeBS
 
typedef OrderedSet< PointsTo, equalPointsTo > SVF::SVFUtil::PointsToList
 

Functions

std::ostream & SVF::SVFUtil::outs ()
 Overwrite llvm::outs() More...
 
std::ostream & SVF::SVFUtil::errs ()
 Overwrite llvm::errs() More...
 
void SVF::SVFUtil::dumpSet (NodeBS To, OutStream &O=SVFUtil::outs())
 Dump sparse bitvector set. More...
 
void SVF::SVFUtil::dumpSet (PointsTo To, OutStream &O=SVFUtil::outs())
 
void SVF::SVFUtil::dumpPointsToSet (unsigned node, NodeBS To)
 Dump points-to set. More...
 
void SVF::SVFUtil::dumpSparseSet (const NodeBS &To)
 
void SVF::SVFUtil::dumpAliasSet (unsigned node, NodeBS To)
 Dump alias set. More...
 
std::string SVF::SVFUtil::sucMsg (const std::string &msg)
 Returns successful message by converting a string into green string output. More...
 
std::string SVF::SVFUtil::wrnMsg (const std::string &msg)
 Returns warning message by converting a string into yellow string output. More...
 
void SVF::SVFUtil::writeWrnMsg (const std::string &msg)
 Writes a message run through wrnMsg. More...
 
std::string SVF::SVFUtil::errMsg (const std::string &msg)
 Print error message by converting a string into red string output. More...
 
std::string SVF::SVFUtil::bugMsg1 (const std::string &msg)
 
std::string SVF::SVFUtil::bugMsg2 (const std::string &msg)
 
std::string SVF::SVFUtil::bugMsg3 (const std::string &msg)
 
std::string SVF::SVFUtil::pasMsg (const std::string &msg)
 Print each pass/phase message by converting a string into blue string output. More...
 
void SVF::SVFUtil::reportMemoryUsageKB (const std::string &infor, OutStream &O=SVFUtil::outs())
 Print memory usage in KB. More...
 
bool SVF::SVFUtil::getMemoryUsageKB (u32_t *vmrss_kb, u32_t *vmsize_kb)
 Get memory usage from system file. Return TRUE if succeed. More...
 
void SVF::SVFUtil::increaseStackSize ()
 Increase the stack size limit. More...
 
bool SVF::SVFUtil::cmpPts (const PointsTo &lpts, const PointsTo &rpts)
 
bool SVF::SVFUtil::cmpNodeBS (const NodeBS &lpts, const NodeBS &rpts)
 
NodeBS SVF::SVFUtil::ptsToNodeBS (const PointsTo &pts)
 
void SVF::SVFUtil::dumpPointsToList (const PointsToList &ptl)
 
bool SVF::SVFUtil::isIntrinsicInst (const SVFInstruction *inst)
 Return true if it is an llvm intrinsic instruction. More...
 
bool SVF::SVFUtil::isIntrinsicInst (const ICFGNode *inst)
 
bool SVF::SVFUtil::isCallSite (const SVFValue *val)
 Whether an instruction is a call or invoke instruction. More...
 
bool SVF::SVFUtil::isCallSite (const ICFGNode *inst)
 
bool SVF::SVFUtil::isRetInstNode (const ICFGNode *node)
 
bool SVF::SVFUtil::isNonInstricCallSite (const ICFGNode *inst)
 Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls. More...
 
bool SVF::SVFUtil::matchArgs (const CallICFGNode *cs, const SVFFunction *callee)
 
std::vector< std::stringSVF::SVFUtil::split (const std::string &s, char separator)
 Split into two substrings around the first occurrence of a separator string. More...
 
template<typename Data >
void SVF::SVFUtil::mergePtsOccMaps (Map< Data, unsigned > &to, const Map< Data, unsigned > from)
 Given a map mapping points-to sets to a count, adds from into to. More...
 
std::string SVF::SVFUtil::hclustMethodToString (hclust_fast_methods method)
 Returns a string representation of a hclust method. More...
 
template<typename Key , typename KeySet >
void SVF::SVFUtil::insertKey (const Key &key, KeySet &keySet)
 Inserts an element into a Set/CondSet (with ::insert). More...
 
void SVF::SVFUtil::insertKey (const NodeID &key, NodeBS &keySet)
 Inserts a NodeID into a NodeBS. More...
 
template<typename Key , typename KeySet >
void SVF::SVFUtil::removeKey (const Key &key, KeySet &keySet)
 Removes an element from a Set/CondSet (or anything implementing ::erase). More...
 
void SVF::SVFUtil::removeKey (const NodeID &key, NodeBS &keySet)
 Removes a NodeID from a NodeBS. More...
 
void SVF::SVFUtil::timeLimitReached (int signum)
 Function to call when alarm for time limit hits. More...
 
bool SVF::SVFUtil::startAnalysisLimitTimer (unsigned timeLimit)
 
void SVF::SVFUtil::stopAnalysisLimitTimer (bool limitTimerSet)
 
bool SVF::SVFUtil::isExtCall (const SVFFunction *fun)
 
bool SVF::SVFUtil::isMemcpyExtFun (const SVFFunction *fun)
 
bool SVF::SVFUtil::isMemsetExtFun (const SVFFunction *fun)
 
bool SVF::SVFUtil::isHeapAllocExtFunViaRet (const SVFFunction *fun)
 Return true if the call is a heap allocator/reallocator. More...
 
bool SVF::SVFUtil::isHeapAllocExtFunViaArg (const SVFFunction *fun)
 
u32_t SVF::SVFUtil::getHeapAllocHoldingArgPosition (const SVFFunction *fun)
 Get the position of argument that holds an allocated heap object. More...
 
bool SVF::SVFUtil::isReallocExtFun (const SVFFunction *fun)
 Return true if the call is a heap reallocator. More...
 
bool SVF::SVFUtil::isProgEntryFunction (const SVFFunction *fun)
 Program entry function e.g. main. More...
 
const SVFFunctionSVF::SVFUtil::getProgFunction (const std::string &funName)
 Get program entry function from function name. More...
 
const SVFFunctionSVF::SVFUtil::getProgEntryFunction ()
 Get program entry function. More...
 
bool SVF::SVFUtil::isProgExitFunction (const SVFFunction *fun)
 Return true if this is a program exit function call. More...
 
bool SVF::SVFUtil::isArgOfUncalledFunction (const SVFValue *svfval)
 Return true if this argument belongs to an uncalled function. More...
 
const SVFVar * SVF::SVFUtil::getForkedFun (const CallICFGNode *inst)
 Return thread fork function. More...
 
bool SVF::SVFUtil::isExtCall (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isExtCall (const ICFGNode *node)
 
bool SVF::SVFUtil::isHeapAllocExtCallViaArg (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isHeapAllocExtCallViaRet (const CallICFGNode *cs)
 interfaces to be used externally More...
 
bool SVF::SVFUtil::isHeapAllocExtCall (const ICFGNode *cs)
 
u32_t SVF::SVFUtil::getHeapAllocHoldingArgPosition (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isReallocExtCall (const CallICFGNode *cs)
 

Variables

template<typename... Ts>
constexpr bool SVF::SVFUtil::is_sequence_container_v = is_sequence_container<Ts...>::value
 
template<typename... Ts>
constexpr bool SVF::SVFUtil::is_map_v = is_map<Ts...>::value
 
template<typename... Ts>
constexpr bool SVF::SVFUtil::is_set_v = is_set<Ts...>::value
 
template<typename... Ts>
using SVF::SVFUtil::void_t = typename make_void< Ts... >::type
 
template<typename T >
constexpr bool SVF::SVFUtil::is_iterable_v = is_iterable<T>::value
 
bool SVF::SVFUtil::isThreadForkCall (const CallICFGNode *inst)
 
bool SVF::SVFUtil::isThreadJoinCall (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isThreadExitCall (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isLockAquireCall (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isLockReleaseCall (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isBarrierWaitCall (const CallICFGNode *cs)
 Return true if this is a barrier wait call. More...
 
const SVFVar * SVF::SVFUtil::getActualParmAtForkSite (const CallICFGNode *cs)
 Return sole argument of the thread routine. More...
 
bool SVF::SVFUtil::isProgExitCall (const CallICFGNode *cs)
 
template<typename T >
constexpr std::remove_reference< T >::type && SVF::SVFUtil::move (T &&t) noexcept