Static Value-Flow Analysis
|
Typedefs | |
typedef struct SVF::SVFUtil::equalPointsTo | equalPointsTo |
typedef struct SVF::SVFUtil::equalNodeBS | equalNodeBS |
typedef OrderedSet< PointsTo, equalPointsTo > | PointsToList |
Functions | |
template<class X , class Y > | |
LLVM_NODISCARD bool | isa (const Y &Val) |
template<typename First , typename Second , typename... Rest, typename Y > | |
LLVM_NODISCARD bool | isa (const Y &Val) |
template<class X , class Y > | |
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > | cast (const Y &Val) |
template<class X , class Y > | |
cast_retty< X, Y >::ret_type | cast (Y &Val) |
template<class X , class Y > | |
cast_retty< X, Y * >::ret_type | cast (Y *Val) |
template<class X , class Y > | |
cast_retty< X, std::unique_ptr< Y > >::ret_type | cast (std::unique_ptr< Y > &&Val) |
template<class X , class Y > | |
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > | dyn_cast (const Y &Val) |
template<class X , class Y > | |
LLVM_NODISCARD cast_retty< X, Y >::ret_type | dyn_cast (Y &Val) |
template<class X , class Y > | |
LLVM_NODISCARD cast_retty< X, Y * >::ret_type | dyn_cast (Y *Val) |
std::ostream & | outs () |
Overwrite llvm::outs() More... | |
std::ostream & | errs () |
Overwrite llvm::errs() More... | |
void | dumpSet (NodeBS To, OutStream &O=SVFUtil::outs()) |
Dump sparse bitvector set. More... | |
void | dumpSet (PointsTo To, OutStream &O=SVFUtil::outs()) |
void | dumpPointsToSet (unsigned node, NodeBS To) |
Dump points-to set. More... | |
void | dumpSparseSet (const NodeBS &To) |
void | dumpAliasSet (unsigned node, NodeBS To) |
Dump alias set. More... | |
std::string | sucMsg (const std::string &msg) |
Returns successful message by converting a string into green string output. More... | |
std::string | wrnMsg (const std::string &msg) |
Returns warning message by converting a string into yellow string output. More... | |
void | writeWrnMsg (const std::string &msg) |
Writes a message run through wrnMsg. More... | |
std::string | errMsg (const std::string &msg) |
Print error message by converting a string into red string output. More... | |
std::string | bugMsg1 (const std::string &msg) |
std::string | bugMsg2 (const std::string &msg) |
std::string | bugMsg3 (const std::string &msg) |
std::string | pasMsg (const std::string &msg) |
Print each pass/phase message by converting a string into blue string output. More... | |
void | reportMemoryUsageKB (const std::string &infor, OutStream &O=SVFUtil::outs()) |
Print memory usage in KB. More... | |
bool | getMemoryUsageKB (u32_t *vmrss_kb, u32_t *vmsize_kb) |
Get memory usage from system file. Return TRUE if succeed. More... | |
void | increaseStackSize () |
Increase the stack size limit. More... | |
bool | cmpPts (const PointsTo &lpts, const PointsTo &rpts) |
bool | cmpNodeBS (const NodeBS &lpts, const NodeBS &rpts) |
NodeBS | ptsToNodeBS (const PointsTo &pts) |
void | dumpPointsToList (const PointsToList &ptl) |
bool | isIntrinsicInst (const SVFInstruction *inst) |
Return true if it is an llvm intrinsic instruction. More... | |
bool | isIntrinsicInst (const ICFGNode *inst) |
bool | isCallSite (const SVFValue *val) |
Whether an instruction is a call or invoke instruction. More... | |
bool | isCallSite (const ICFGNode *inst) |
bool | isRetInstNode (const ICFGNode *node) |
bool | isNonInstricCallSite (const ICFGNode *inst) |
Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls. More... | |
bool | matchArgs (const CallICFGNode *cs, const SVFFunction *callee) |
std::vector< std::string > | split (const std::string &s, char separator) |
Split into two substrings around the first occurrence of a separator string. More... | |
template<typename Data > | |
void | 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 | hclustMethodToString (hclust_fast_methods method) |
Returns a string representation of a hclust method. More... | |
template<typename Key , typename KeySet > | |
void | insertKey (const Key &key, KeySet &keySet) |
Inserts an element into a Set/CondSet (with ::insert). More... | |
void | insertKey (const NodeID &key, NodeBS &keySet) |
Inserts a NodeID into a NodeBS. More... | |
template<typename Key , typename KeySet > | |
void | removeKey (const Key &key, KeySet &keySet) |
Removes an element from a Set/CondSet (or anything implementing ::erase). More... | |
void | removeKey (const NodeID &key, NodeBS &keySet) |
Removes a NodeID from a NodeBS. More... | |
void | timeLimitReached (int signum) |
Function to call when alarm for time limit hits. More... | |
bool | startAnalysisLimitTimer (unsigned timeLimit) |
void | stopAnalysisLimitTimer (bool limitTimerSet) |
bool | isExtCall (const SVFFunction *fun) |
bool | isMemcpyExtFun (const SVFFunction *fun) |
bool | isMemsetExtFun (const SVFFunction *fun) |
bool | isHeapAllocExtFunViaRet (const SVFFunction *fun) |
Return true if the call is a heap allocator/reallocator. More... | |
bool | isHeapAllocExtFunViaArg (const SVFFunction *fun) |
u32_t | getHeapAllocHoldingArgPosition (const SVFFunction *fun) |
Get the position of argument that holds an allocated heap object. More... | |
bool | isReallocExtFun (const SVFFunction *fun) |
Return true if the call is a heap reallocator. More... | |
bool | isProgEntryFunction (const SVFFunction *fun) |
Program entry function e.g. main. More... | |
const SVFFunction * | getProgFunction (const std::string &funName) |
Get program entry function from function name. More... | |
const SVFFunction * | getProgEntryFunction () |
Get program entry function. More... | |
bool | isProgExitFunction (const SVFFunction *fun) |
Return true if this is a program exit function call. More... | |
bool | isArgOfUncalledFunction (const SVFValue *svfval) |
Return true if this argument belongs to an uncalled function. More... | |
const SVFVar * | getForkedFun (const CallICFGNode *inst) |
Return thread fork function. More... | |
bool | isExtCall (const CallICFGNode *cs) |
bool | isExtCall (const ICFGNode *node) |
bool | isHeapAllocExtCallViaArg (const CallICFGNode *cs) |
bool | isHeapAllocExtCallViaRet (const CallICFGNode *cs) |
interfaces to be used externally More... | |
bool | isHeapAllocExtCall (const ICFGNode *cs) |
u32_t | getHeapAllocHoldingArgPosition (const CallICFGNode *cs) |
bool | isReallocExtCall (const CallICFGNode *cs) |
Variables | |
template<typename... Ts> | |
constexpr bool | is_sequence_container_v = is_sequence_container<Ts...>::value |
template<typename... Ts> | |
constexpr bool | is_map_v = is_map<Ts...>::value |
template<typename... Ts> | |
constexpr bool | is_set_v = is_set<Ts...>::value |
template<typename... Ts> | |
using | void_t = typename make_void< Ts... >::type |
template<typename T > | |
constexpr bool | is_iterable_v = is_iterable<T>::value |
bool | isThreadForkCall (const CallICFGNode *inst) |
bool | isThreadJoinCall (const CallICFGNode *cs) |
bool | isThreadExitCall (const CallICFGNode *cs) |
bool | isLockAquireCall (const CallICFGNode *cs) |
bool | isLockReleaseCall (const CallICFGNode *cs) |
bool | isBarrierWaitCall (const CallICFGNode *cs) |
Return true if this is a barrier wait call. More... | |
const SVFVar * | getActualParmAtForkSite (const CallICFGNode *cs) |
Return sole argument of the thread routine. More... | |
bool | isProgExitCall (const CallICFGNode *cs) |
template<typename T > | |
constexpr std::remove_reference< T >::type && | move (T &&t) noexcept |
typedef struct SVF::SVFUtil::equalNodeBS SVF::SVFUtil::equalNodeBS |
typedef struct SVF::SVFUtil::equalPointsTo SVF::SVFUtil::equalPointsTo |
using SVF::SVFUtil::void_t = typedef typename make_void<Ts...>::type |
std::string SVF::SVFUtil::bugMsg1 | ( | const std::string & | msg | ) |
Definition at line 81 of file SVFUtil.cpp.
std::string SVF::SVFUtil::bugMsg2 | ( | const std::string & | msg | ) |
Definition at line 86 of file SVFUtil.cpp.
std::string SVF::SVFUtil::bugMsg3 | ( | const std::string & | msg | ) |
Definition at line 91 of file SVFUtil.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
void SVF::SVFUtil::dumpAliasSet | ( | unsigned | node, |
NodeBS | bs | ||
) |
Dump alias set.
Dump alias set
Definition at line 137 of file SVFUtil.cpp.
void SVF::SVFUtil::dumpPointsToList | ( | const PointsToList & | ptl | ) |
Definition at line 122 of file SVFUtil.cpp.
void SVF::SVFUtil::dumpPointsToSet | ( | unsigned | node, |
NodeBS | bs | ||
) |
void SVF::SVFUtil::dumpSet | ( | NodeBS | bs, |
OutStream & | O = SVFUtil::outs() |
||
) |
void SVF::SVFUtil::dumpSet | ( | PointsTo | To, |
OutStream & | O = SVFUtil::outs() |
||
) |
Definition at line 156 of file SVFUtil.cpp.
void SVF::SVFUtil::dumpSparseSet | ( | const NodeBS & | To | ) |
Definition at line 115 of file SVFUtil.cpp.
|
inline |
|
inline |
|
inline |
std::string SVF::SVFUtil::errMsg | ( | const std::string & | msg | ) |
Print error message by converting a string into red string output.
print error message by converting a string into red string output
Definition at line 76 of file SVFUtil.cpp.
|
inline |
|
inline |
|
inline |
u32_t SVF::SVFUtil::getHeapAllocHoldingArgPosition | ( | const CallICFGNode * | cs | ) |
Definition at line 357 of file SVFUtil.cpp.
|
inline |
Get memory usage from system file. Return TRUE if succeed.
Get memory usage
Definition at line 177 of file SVFUtil.cpp.
const SVFFunction * SVF::SVFUtil::getProgEntryFunction | ( | ) |
Get program entry function.
Get program entry function from module.
Definition at line 415 of file SVFUtil.cpp.
const SVFFunction * SVF::SVFUtil::getProgFunction | ( | const std::string & | funName | ) |
Get program entry function from function name.
Get program entry function from module.
Definition at line 402 of file SVFUtil.cpp.
std::string SVF::SVFUtil::hclustMethodToString | ( | hclust_fast_methods | method | ) |
void SVF::SVFUtil::increaseStackSize | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool SVF::SVFUtil::isCallSite | ( | const ICFGNode * | inst | ) |
Definition at line 328 of file SVFUtil.cpp.
|
inline |
bool SVF::SVFUtil::isExtCall | ( | const CallICFGNode * | cs | ) |
Definition at line 346 of file SVFUtil.cpp.
bool SVF::SVFUtil::isExtCall | ( | const ICFGNode * | node | ) |
Definition at line 363 of file SVFUtil.cpp.
|
inline |
Return true if the call is an external call (external library in function summary table) If the library function is redefined in the application code (e.g., memcpy), it will return false and will not be treated as an external call.
bool SVF::SVFUtil::isHeapAllocExtCall | ( | const ICFGNode * | cs | ) |
Definition at line 369 of file SVFUtil.cpp.
bool SVF::SVFUtil::isHeapAllocExtCallViaArg | ( | const CallICFGNode * | cs | ) |
Definition at line 351 of file SVFUtil.cpp.
bool SVF::SVFUtil::isHeapAllocExtCallViaRet | ( | const CallICFGNode * | cs | ) |
interfaces to be used externally
Definition at line 375 of file SVFUtil.cpp.
|
inline |
|
inline |
bool SVF::SVFUtil::isIntrinsicInst | ( | const ICFGNode * | inst | ) |
Definition at line 333 of file SVFUtil.cpp.
bool SVF::SVFUtil::isIntrinsicInst | ( | const SVFInstruction * | inst | ) |
Return true if it is an llvm intrinsic instruction.
Return true if it is an llvm intrinsic instruction
Definition at line 247 of file SVFUtil.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool SVF::SVFUtil::isProgExitCall | ( | const CallICFGNode * | cs | ) |
Definition at line 396 of file SVFUtil.cpp.
|
inline |
bool SVF::SVFUtil::isReallocExtCall | ( | const CallICFGNode * | cs | ) |
Definition at line 381 of file SVFUtil.cpp.
|
inline |
bool SVF::SVFUtil::isRetInstNode | ( | const ICFGNode * | node | ) |
Definition at line 388 of file SVFUtil.cpp.
|
inline |
|
inline |
|
inline |
bool SVF::SVFUtil::matchArgs | ( | const CallICFGNode * | call, |
const SVFFunction * | callee | ||
) |
Match arguments for callsite at caller and callee if the arg size does not match then we do not need to connect this parameter unless the callee is a variadic function (the first parameter of variadic function is its parameter number)
Match arguments for callsite at caller and callee if the arg size does not match then we do not need to connect this parameter unless the callee is a variadic function (the first parameter of variadic function is its parameter number) e.g., void variadicFoo(int num, ...); variadicFoo(5, 1,2,3,4,5) for variadic function, callsite arg size must be greater than or equal to callee arg size
Definition at line 320 of file SVFUtil.cpp.
|
constexprnoexcept |
Definition at line 447 of file SVFUtil.h.
|
inline |
std::string SVF::SVFUtil::pasMsg | ( | const std::string & | msg | ) |
Print each pass/phase message by converting a string into blue string output.
print each pass/phase message by converting a string into blue string output
Definition at line 99 of file SVFUtil.cpp.
|
inline |
void SVF::SVFUtil::reportMemoryUsageKB | ( | const std::string & | infor, |
OutStream & | O = SVFUtil::outs() |
||
) |
Print memory usage in KB.
Print memory usage
Definition at line 167 of file SVFUtil.cpp.
|
inline |
bool SVF::SVFUtil::startAnalysisLimitTimer | ( | unsigned | timeLimit | ) |
Starts an analysis timer. If timeLimit is 0, sets no timer. If an alarm has already been set, does not set another. Returns whether we set a timer or not.
Definition at line 289 of file SVFUtil.cpp.
void SVF::SVFUtil::stopAnalysisLimitTimer | ( | bool | limitTimerSet | ) |
Stops an analysis timer. limitTimerSet indicates whether the caller set the timer or not (return value of startLimitTimer).
Definition at line 310 of file SVFUtil.cpp.
std::string SVF::SVFUtil::sucMsg | ( | const std::string & | msg | ) |
Returns successful message by converting a string into green string output.
print successful message by converting a string into green string output
Definition at line 53 of file SVFUtil.cpp.
void SVF::SVFUtil::timeLimitReached | ( | int | signum | ) |
void SVF::SVFUtil::writeWrnMsg | ( | const std::string & | msg | ) |
Writes a message run through wrnMsg.
Definition at line 66 of file SVFUtil.cpp.
std::string SVF::SVFUtil::wrnMsg | ( | const std::string & | msg | ) |
Returns warning message by converting a string into yellow string output.
print warning message by converting a string into yellow string output
Definition at line 61 of file SVFUtil.cpp.
|
constexpr |
|
constexpr |
|
constexpr |