Static Value-Flow Analysis
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
SVFUtil.h File Reference
#include <time.h>
#include "MemoryModel/PointsTo.h"
#include "Util/Casting.h"
#include "Util/ExtAPI.h"
#include "Util/GeneralType.h"
#include "Util/NodeIDAllocator.h"
#include "Util/ThreadAPI.h"

Go to the source code of this file.

Classes

struct  SVF::SVFUtil::equalPointsTo
 
struct  SVF::SVFUtil::equalNodeBS
 

Namespaces

namespace  SVF
 for isBitcode
 
namespace  SVF::SVFUtil
 

Macros

#define SVF_WEAK   __attribute__((weak))
 

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()
 
std::ostream & SVF::SVFUtil::errs ()
 Overwrite llvm::errs()
 
void SVF::SVFUtil::dumpSet (NodeBS To, OutStream &O=SVFUtil::outs())
 Dump sparse bitvector set.
 
void SVF::SVFUtil::dumpSet (PointsTo To, OutStream &O=SVFUtil::outs())
 
void SVF::SVFUtil::dumpPointsToSet (unsigned node, NodeBS To)
 Dump points-to set.
 
void SVF::SVFUtil::dumpSparseSet (const NodeBS &To)
 
void SVF::SVFUtil::dumpAliasSet (unsigned node, NodeBS To)
 Dump alias set.
 
std::string SVF::SVFUtil::sucMsg (const std::string &msg)
 Returns successful message by converting a string into green string output.
 
std::string SVF::SVFUtil::wrnMsg (const std::string &msg)
 Returns warning message by converting a string into yellow string output.
 
void SVF::SVFUtil::writeWrnMsg (const std::string &msg)
 Writes a message run through wrnMsg.
 
std::string SVF::SVFUtil::errMsg (const std::string &msg)
 Print error message by converting a string into red string output.
 
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.
 
void SVF::SVFUtil::reportMemoryUsageKB (const std::string &infor, OutStream &O=SVFUtil::outs())
 Print memory usage in KB.
 
bool SVF::SVFUtil::getMemoryUsageKB (u32_t *vmrss_kb, u32_t *vmsize_kb)
 Get memory usage from system file. Return TRUE if succeed.
 
void SVF::SVFUtil::increaseStackSize ()
 Increase the stack size limit.
 
bool SVF::SVFUtil::fileExists (const std::string &path)
 Check whether a file exists at the given path.
 
std::string SVF::SVFUtil::getStdoutFromCommand (const std::string &command)
 Execute a shell command and capture its stdout output.
 
std::string SVF::SVFUtil::getCurrentSOPath ()
 Return the absolute path of the current module/executable.
 
bool SVF::SVFUtil::cmpPts (const PointsTo &lpts, const PointsTo &rpts)
 
bool SVF::SVFUtil::cmpNodeBS (const NodeBS &lpts, const NodeBS &rpts)
 
void SVF::SVFUtil::dumpPointsToList (const PointsToList &ptl)
 
bool SVF::SVFUtil::isIntrinsicInst (const ICFGNode *inst)
 Return true if it is an llvm intrinsic instruction.
 
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.
 
bool SVF::SVFUtil::matchArgs (const CallICFGNode *cs, const FunObjVar *callee)
 
std::vector< std::string > SVF::SVFUtil::split (const std::string &s, char separator)
 Split into two substrings around the first occurrence of a separator string.
 
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.
 
std::string SVF::SVFUtil::hclustMethodToString (hclust_fast_methods method)
 Returns a string representation of a hclust method.
 
template<typename Key , typename KeySet >
void SVF::SVFUtil::insertKey (const Key &key, KeySet &keySet)
 Inserts an element into a Set/CondSet (with ::insert).
 
void SVF::SVFUtil::insertKey (const NodeID &key, NodeBS &keySet)
 Inserts a NodeID into a NodeBS.
 
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).
 
void SVF::SVFUtil::removeKey (const NodeID &key, NodeBS &keySet)
 Removes a NodeID from a NodeBS.
 
void SVF::SVFUtil::timeLimitReached (int signum)
 Function to call when alarm for time limit hits.
 
void SVF::SVFUtil::startAnalysisLimitTimer (unsigned timeLimit)
 Starts analysis timer. timeLimit must be non-0. Timer must not be already set.
 
void SVF::SVFUtil::stopAnalysisLimitTimer (void)
 Stops analysis timer.
 
bool SVF::SVFUtil::isExtCall (const FunObjVar *fun)
 
bool SVF::SVFUtil::isHeapAllocExtFunViaRet (const FunObjVar *fun)
 Return true if the call is a heap allocator/reallocator.
 
bool SVF::SVFUtil::isHeapAllocExtFunViaArg (const FunObjVar *fun)
 
u32_t SVF::SVFUtil::getHeapAllocHoldingArgPosition (const FunObjVar *fun)
 Get the position of argument that holds an allocated heap object.
 
bool SVF::SVFUtil::isReallocExtFun (const FunObjVar *fun)
 Return true if the call is a heap reallocator.
 
bool SVF::SVFUtil::isProgEntryFunction (const FunObjVar *)
 Program entry function e.g. main.
 
const FunObjVar * SVF::SVFUtil::getProgFunction (const std::string &funName)
 Get program entry function from function name.
 
const FunObjVar * SVF::SVFUtil::getProgEntryFunction ()
 Get program entry function.
 
bool SVF::SVFUtil::isProgExitFunction (const FunObjVar *fun)
 Return true if this is a program exit function call.
 
bool SVF::SVFUtil::isArgOfUncalledFunction (const SVFVar *svfvar)
 
const ObjVar * SVF::SVFUtil::getObjVarOfValVar (const ValVar *valVar)
 
const ValVar * SVF::SVFUtil::getForkedFun (const CallICFGNode *inst)
 Return thread fork function.
 
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
 
bool SVF::SVFUtil::isHeapAllocExtCall (const ICFGNode *cs)
 
u32_t SVF::SVFUtil::getHeapAllocHoldingArgPosition (const CallICFGNode *cs)
 
bool SVF::SVFUtil::isReallocExtCall (const CallICFGNode *cs)
 
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.
 
const ValVar * SVF::SVFUtil::getActualParmAtForkSite (const CallICFGNode *cs)
 Return sole argument of the thread routine.
 
bool SVF::SVFUtil::isProgExitCall (const CallICFGNode *cs)
 
template<typename T >
constexpr std::remove_reference< T >::type && SVF::SVFUtil::move (T &&t) noexcept
 

Macro Definition Documentation

◆ SVF_WEAK

#define SVF_WEAK   __attribute__((weak))

Definition at line 45 of file SVFUtil.h.