47using namespace SVFUtil;
48using namespace LLVMUtil;
83 std::vector<const FunObjVar*>
funset;
98 for (Module::const_iterator F =
M.begin(),
E =
M.end(); F !=
E; ++F)
103 if(!fun.isDeclaration())
110 if (fun.doesNotReturn() ==
false &&
111 fun.getReturnType()->isVoidTy() ==
false)
119 for (Function::const_arg_iterator I = fun.arg_begin(),
E = fun.arg_end();
134 for (Function::const_iterator bit = fun.begin(),
ebit = fun.end();
138 for (BasicBlock::const_iterator
it = bb.begin(),
eit = bb.end();
176 assert(
false &&
"please implement SVFIRWriter::writeJsonToPath");
216 for (Function::const_iterator bit =
func->begin(),
ebit =
func->end(); bit !=
ebit; ++bit)
232 if (
svfbb->getSuccessors().empty())
237 SVFUtil::isa<ReturnInst>(bb->back())) &&
238 "last inst must be return inst");
245 if (
svfFun->hasBasicBlock() &&
svfFun->exitBlock ==
nullptr)
249 SVFUtil::isa<ReturnInst>(&
func->back().back())) &&
250 "last inst must be return inst");
258 if (fun->isDeclaration())
279 std::vector<const SVFBasicBlock*> reachableBBs;
281 ld->setReachableBBs(reachableBBs);
283 for (Function::const_iterator bit = fun->begin(),
beit = fun->end(); bit!=
beit; ++bit)
326 std::vector<FunObjVar*>
funset;
339 funset.push_back(funObjVar);
343 SVFUtil::cast<SVFFunctionType>(
llvmModuleSet()->getSVFType(fun->getFunctionType())),
356 for (
auto& bb: *funObjVar->
bbGraph)
358 bb.second->setFun(funObjVar);
369 for (LLVMModuleSet::ValueToIDMapTy::iterator
iter =
391 if (SVFUtil::dyn_cast<Function>(
llvmValue))
417 else if (SVFUtil::isa<ConstantPointerNull>(
llvmValue))
422 else if (SVFUtil::isa<GlobalValue>(
llvmValue))
427 else if (SVFUtil::isa<ConstantData, MetadataAsValue, BlockAddress>(
llvmValue))
432 else if (SVFUtil::isa<ConstantAggregate>(
llvmValue))
451 for (LLVMModuleSet::ValueToIDMapTy::iterator
iter =
465 SVFUtil::dyn_cast<Instruction>(
llvmValue))
495 else if (SVFUtil::isa<ConstantPointerNull>(
llvmValue))
499 else if (SVFUtil::isa<GlobalValue>(
llvmValue))
504 else if (SVFUtil::isa<ConstantData, MetadataAsValue, BlockAddress>(
llvmValue))
508 else if (SVFUtil::isa<ConstantAggregate>(
llvmValue))
539 for (LLVMModuleSet::FunToIDMapTy::iterator
iter =
559 for (LLVMModuleSet::FunToIDMapTy::iterator
iter =
581 for (LLVMModuleSet::ValueToIDMapTy::iterator
iter =
598 &&
"not all node have been initialized!!!");
636 const llvm::GEPOperator *
gepOp = SVFUtil::dyn_cast<const llvm::GEPOperator>(
V);
654 "Expect no more than one gep operand to be of a pointer type");
675 assert(
op &&
"non-const offset accessing a struct");
681 else if (
gepTy->isSingleValueType())
686 if(!
op &&
gepTy->isPointerTy() &&
gepOp->getSourceElementType()->isSingleValueType())
715 auto &
GEPOp = llvm::cast<llvm::GEPOperator>(*
gepce);
809 else if (SVFUtil::isa<ConstantAggregate>(
ref))
813 else if (SVFUtil::isa<BlockAddress>(
ref))
826 if(SVFUtil::isa<ConstantExpr>(
val))
827 assert(
false &&
"we don't handle all other constant expression for now!");
840 if (
offset == 0 &&
gvar->getInitializer()->getType()->isSingleValueType())
867 if (
C->getType()->isSingleValueType())
874 if (SVFUtil::isa<GlobalVariable, Function>(
C))
879 else if (SVFUtil::isa<ConstantExpr>(
C))
886 else if (SVFUtil::isa<BlockAddress>(
C))
899 if (
C->getType()->isPtrOrPtrVectorTy() && src !=
pag->
getNullPtr())
903 else if (SVFUtil::isa<ConstantArray, ConstantStruct>(
C))
907 for (
u32_t i = 0, e =
C->getNumOperands();
i != e;
i++)
913 else if(
ConstantData* data = SVFUtil::dyn_cast<ConstantData>(
C))
928 assert((SVFUtil::isa<ConstantAggregateZero, UndefValue>(data)) &&
"Single value type data should have been handled!");
947 for (Module::global_iterator I =
M.global_begin(),
E =
M.global_end(); I !=
E; ++I)
956 if (
gvar->hasInitializer())
966 for (Module::const_iterator I =
M.begin(),
E =
M.end(); I !=
E; ++I)
972 DBOUT(
DPAGBuild,
outs() <<
"add global function node " << fun->getName().str() <<
"\n");
978 for (Module::alias_iterator I =
M.alias_begin(),
E =
M.alias_end(); I !=
E; I++)
998 assert(SVFUtil::isa<PointerType>(inst.getType()));
1019 for (
u32_t i = 0;
i < inst.getNumIncomingValues(); ++
i)
1021 const Value*
val = inst.getIncomingValue(
i);
1054 assert(!SVFUtil::isa<PointerType>(inst.getType()));
1075 if(SVFUtil::isa<VectorType>(inst.getType()))
1081 assert(SVFUtil::isa<PointerType>(inst.getType()));
1112 assert(inst.getNumOperands() == 2 &&
"not two operands for BinaryOperator?");
1117 u32_t opcode = inst.getOpcode();
1127 assert(inst.getNumOperands() == 1 &&
"not one operand for Unary instruction?");
1130 u32_t opcode = inst.getOpcode();
1140 assert(inst.getNumOperands() == 2 &&
"not two operands for compare instruction?");
1145 u32_t predicate = inst.getPredicate();
1192 outs() <<
"process callsite " <<
svfcall->valueOnlyToString() <<
"\n");
1201 for (
u32_t i = 0;
i < cs->arg_size();
i++)
1206 if(!cs->getType()->isVoidTy())
1239 assert(!SVFUtil::isa<PointerType>(inst.getType()));
1243 if(
Value* src = inst.getReturnValue())
1292 if (inst.isConditional())
1297 assert(inst.getNumSuccessors() <= 2 &&
"if/else has more than two branches?");
1300 std::vector<const Instruction*>
nextInsts;
1307 successors.push_back(std::make_pair(icfgNode, 1-
branchID));
1312 if (inst.isConditional())
1376 std::vector<const Instruction*>
nextInsts;
1387 successors.push_back(std::make_pair(icfgNode,
val));
1421 for (
u32_t i = 0;
i < inst.getNumOperands();
i++)
1445 if (!cs->getType()->isVoidTy())
1453 Function::const_arg_iterator
itF = F->arg_begin(),
ieF = F->arg_end();
1530 assert(value &&
"null ptr?");
1536 if(
const ConstantInt*
op = SVFUtil::dyn_cast<ConstantInt>(
gi.getOperand()))
1539 if(
totalidx == 0 && !SVFUtil::isa<StructType>(value->getType()))
1540 value =
gep->getPointerOperand();
1542 else if (
const LoadInst* load = SVFUtil::dyn_cast<LoadInst>(value))
1544 const Value*
loadP = load->getPointerOperand();
1550 if(
const ConstantInt*
op = SVFUtil::dyn_cast<ConstantInt>(
gi.getOperand()))
1556 if (
glob->hasInitializer())
1597 CallGraph::CallEdgeMap::const_iterator
iter = callgraph->
getIndCallMap().begin();
1603 assert(
callBlock->isIndirectCall() &&
"this is not an indirect call?");
1662 assert(((
int)
UINT_MAX)==-1 &&
"maximum limit of unsigned int is not -1?");
1672 (SVFUtil::isa<Instruction>(
curVal) || SVFUtil::isa<GlobalVariable>(
curVal)) &&
"curVal not an instruction or a globalvariable?");
1725 if(
srcFun!=
nullptr && !SVFUtil::isa<RetPE>(
edge) && !SVFUtil::isa<FunValVar>(
edge->getSrcNode()) && !SVFUtil::isa<FunObjVar>(
edge->getSrcNode()))
1729 if(
dstFun!=
nullptr && !SVFUtil::isa<CallPE>(
edge) && !SVFUtil::isa<RetValPN>(
edge->getDstNode()))
1735 if (!(SVFUtil::isa<GepStmt>(
edge) && SVFUtil::isa<GepValVar>(
edge->getDstNode())))
1736 assert(
curBB &&
"instruction does not have a basic block??");
1739 if(SVFUtil::isa<ReturnInst>(
curInst))
1745 if(SVFUtil::isa<RetPE>(
edge))
1746 icfgNode =
llvmMS->getRetICFGNode(SVFUtil::cast<Instruction>(
curInst));
1748 icfgNode =
llvmMS->getICFGNode(SVFUtil::cast<Instruction>(
curInst));
1757 else if (SVFUtil::isa<Constant>(
curVal) ||
1758 SVFUtil::isa<Function>(
curVal) ||
1759 SVFUtil::isa<MetadataAsValue>(
curVal))
1770 assert(
false &&
"what else value can we have?");
1780 SVFUtil::cast<CallCFGEdge>(
edge)->addCallPE(
callPE);
1782 else if(
const RetPE* retPE = SVFUtil::dyn_cast<RetPE>(
edge))
1787 SVFUtil::cast<RetCFGEdge>(
edge)->addRetPE(retPE);
1806 assert(
geps.size()==1 &&
"one node can only be connected by at most one gep edge!");
1809 if(
gepEdge->isVariantFieldGep())
1812 return gepEdge->getAccessPath();
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
bool addOffsetVarAndGepTypePair(const SVFVar *var, const SVFType *gepIterType)
APOffset getConstantStructFldIdx() const
Get methods.
void setFldIdx(APOffset idx)
std::vector< std::pair< const ICFGNode *, s32_t > > SuccAndCondPairVec
CallEdgeMap & getIndCallMap()
Get callees from an indirect callsite.
Set< const FunObjVar * > FunctionSet
bool isVirtualCall() const
void setVtablePtr(SVFVar *v)
static ExtAPI * getExtAPI()
void setExtFuncAnnotations(const FunObjVar *fun, const std::vector< std::string > &funcAnnotations)
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
const SVFBasicBlock * getEntryBlock() const
void setBasicBlockGraph(BasicBlockGraph *graph)
void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft, SVFLoopAndDomInfo *ld, const FunObjVar *real, BasicBlockGraph *bbg, const std::vector< const ArgValVar * > &allarg, const SVFBasicBlock *exit)
BasicBlockGraph * bbGraph
the definition of a function across multiple modules
iterator begin()
Iterators.
u32_t getTotalNodeNum() const
Get total number of node/edge.
IDToNodeMapTy::iterator iterator
Node Iterators.
NodeType * getGNode(NodeID id) const
Get a node.
GEdgeSetTy::iterator iterator
const GEdgeSetTy & getOutEdges() const
void addSVFStmt(const SVFStmt *edge)
FunExitICFGNode * getFunExitICFGNode(const FunObjVar *fun)
Add a function exit node.
ICFGEdge * hasInterICFGEdge(ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind)
void dump(const std::string &file, bool simple=false)
Dump graph into dot file.
FunEntryICFGNode * getFunEntryICFGNode(const FunObjVar *fun)
Add a function entry node.
GlobalICFGNode * getGlobalICFGNode() const
NodeID constantSymID() const
u32_t getFlattenedElemIdx(const SVFType *T, u32_t origId)
Flattened element idx of an array or struct by considering stride.
u32_t getNodeNumAfterPAGBuild() const
void dump(std::string name)
Dump SVFIR.
NodeID blkPtrSymID() const
NodeID getNullPtr() const
NodeID nullPtrSymID() const
u32_t getTotalSymNum() const
Statistics.
FunObjVarToIDMapTy varargFunObjSymMap
vararg map
NodeID getReturnNode(const FunObjVar *func) const
GetReturnNode - Return the unique node representing the return value of a function.
void setNodeNumAfterPAGBuild(u32_t num)
NodeID blackholeSymID() const
ObjTypeInfo * getObjTypeInfo(NodeID id) const
NodeID getConstantNode() const
FunObjVarToIDMapTy returnFunObjSymMap
return map
virtual void build(ICFG *icfg)
Start from here.
NodeID getValueNode(const Value *V)
ValueToIDMapTy & valSyms()
const FunObjVar * getFunObjVar(const Function *fun) const
SVFBasicBlock * getSVFBasicBlock(const BasicBlock *bb)
DominatorTree & getDomTree(const Function *fun)
void addToSVFVar2LLVMValueMap(const Value *val, SVFValue *svfBaseNode)
LLVMFun2FunObjVarMap LLVMFun2FunObjVar
Map an LLVM Function to an SVF Funobjvar.
SVFType * getSVFType(const Type *T)
Get or create SVFType and typeinfo.
bool hasICFGNode(const Instruction *inst)
ICFGNode * getICFGNode(const Instruction *inst)
Get a basic block ICFGNode.
CallICFGNode * getCallICFGNode(const Instruction *cs)
get a call node
Fun2AnnoMap ExtFun2Annotations
Record annotations of function in extapi.bc.
NodeID getObjectNode(const Value *V)
RetICFGNode * getRetICFGNode(const Instruction *cs)
get a return node
const std::vector< std::reference_wrapper< Module > > & getLLVMModules() const
const Function * getRealDefFun(const Function *fun) const
ValueToIDMapTy & objSyms()
void addBasicBlock(FunObjVar *fun, const BasicBlock *bb)
FunToIDMapTy & varargSyms()
const FunctionSet & getFunctionSet() const
static NodeIDAllocator * get(void)
Return (singleton) allocator.
static const Option< bool > PAGDotGraph
static const Option< std::string > DumpJson
static Option< bool > ModelConsts
static const Option< bool > PAGPrint
static const Option< bool > VtableInSVFIR
static const Option< bool > LoopAnalysis
static const Option< bool > DumpICFG
const FunObjVar * getParent() const
void addPredBasicBlock(const SVFBasicBlock *pred2)
void addSuccBasicBlock(const SVFBasicBlock *succ2)
const ICFGNode * front() const
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator *gepOp, DataLayout *dl, AccessPath &ap, APOffset idx)
Infer field index from byteoffset.
CopyStmt::CopyKind getCopyKind(const Value *val)
void sanityCheck()
Sanity check for SVFIR.
SVFIR * getPAG() const
Return SVFIR.
void setCurrentLocation(const Value *val, const BasicBlock *bb)
Set current basic block in order to keep track of control flow information.
NodeID addNullPtrNode()
Add NullPtr PAGNode.
void visitLoadInst(LoadInst &I)
NodeID getVarargNode(const FunObjVar *func)
getVarargNode - Return the node representing the unique variadic argument of a function.
void addPhiStmt(NodeID res, NodeID opnd, const ICFGNode *pred)
Add Copy edge.
void updateCallGraph(CallGraph *callgraph)
connect PAG edges based on callgraph
void initSVFBasicBlock(const Function *func)
void addStoreEdge(NodeID src, NodeID dst)
Add Store edge.
AddrStmt * addAddrEdge(NodeID src, NodeID dst)
Add Address edge.
void visitInvokeInst(InvokeInst &II)
void handleDirectCall(CallBase *cs, const Function *F)
Handle direct call.
void addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
Add Copy edge.
void visitCallInst(CallInst &I)
void addLoadEdge(NodeID src, NodeID dst)
Add Load edge.
virtual void handleExtCall(const CallBase *cs, const Function *callee)
void visitGetElementPtrInst(GetElementPtrInst &I)
void visitBranchInst(BranchInst &I)
virtual void visitAllocaInst(AllocaInst &AI)
Our visit overrides.
void addGepEdge(NodeID src, NodeID dst, const AccessPath &ap, bool constGep)
Add Gep edge.
void addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
Add Copy edge.
LLVMModuleSet * llvmModuleSet()
void visitStoreInst(StoreInst &I)
NodeID getReturnNode(const FunObjVar *func)
getReturnNode - Return the node representing the unique return value of a function.
NodeID getObjectNode(const Value *V)
GetObject - Return the object node (stack/global/heap/function) according to a LLVM Value.
void visitCallSite(CallBase *cs)
void processCE(const Value *val)
Process constant expression.
void handleIndCall(CallBase *cs)
Handle indirect call.
const Value * curVal
Current Value during SVFIR construction when visiting the module.
void addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
Add SelectStmt.
void addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec &succs)
Add Branch statement.
virtual SVFIR * build()
Start building SVFIR here.
void visitCallBrInst(CallBrInst &I)
void visitExtractValueInst(ExtractValueInst &EVI)
AccessPath getAccessPathFromBaseNode(NodeID nodeId)
const SVFBasicBlock * curBB
Current basic block during SVFIR construction when visiting the module.
void visitSwitchInst(SwitchInst &I)
The following implementation follows ICFGBuilder::processFunBody.
void visitFreezeInst(FreezeInst &I)
const Value * getBaseValueForExtArg(const Value *V)
Get the base value of (i8* src and i8* dst) for external argument (e.g. memcpy(i8* dst,...
void initDomTree(FunObjVar *func, const Function *f)
void addRetEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunExitICFGNode *exit)
Add Return edge.
void addBlackHoleAddrEdge(NodeID node)
void visitGlobal()
Handle globals including (global variable and functions)
void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
Add Unary edge.
const SVFBasicBlock * getCurrentBB() const
void visitPHINode(PHINode &I)
CopyStmt * addCopyEdge(NodeID src, NodeID dst, CopyStmt::CopyKind kind)
void addCallEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Call edge.
void setCurrentBBAndValueForPAGEdge(PAGEdge *edge)
void visitSelectInst(SelectInst &I)
void visitVAArgInst(VAArgInst &)
void visitCmpInst(CmpInst &I)
void visitExtractElementInst(ExtractElementInst &I)
bool computeGepOffset(const User *V, AccessPath &ap)
Compute offset of a gep instruction or gep constant expression.
void visitReturnInst(ReturnInst &I)
const Value * getCurrentValue() const
NodeID getValueNode(const Value *V)
Get different kinds of node.
void visitCastInst(CastInst &I)
AddrStmt * addAddrWithStackArraySz(NodeID src, NodeID dst, llvm::AllocaInst &inst)
Add Address edge from allocinst with arraysize like "%4 = alloca i8, i64 3".
NodeID getGepValVar(const Value *val, const AccessPath &ap, const SVFType *elementType)
void initialiseBaseObjVars()
void InitialGlobal(const GlobalVariable *gvar, Constant *C, u32_t offset)
void visitUnaryOperator(UnaryOperator &I)
void visitBinaryOperator(BinaryOperator &I)
void initialiseNodes()
Initialize nodes and edges.
NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset, SVFType *tpy)
NodeID addGlobalValNode(const NodeID i, const ICFGNode *icfgNode, const SVFType *svfType)
NodeID getGepValVar(NodeID curInst, NodeID base, const AccessPath &ap) const
Due to constraint expression, curInst is used to distinguish different instructions (e....
NodeID addConstantAggObjNode(const NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
NodeID addBlackholePtrNode()
NodeID addBlackholeObjNode()
NodeID addGlobalObjNode(const NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
void addFunArgs(const FunObjVar *fun, const SVFVar *arg)
Get/set method for function/callsite arguments and returns.
NodeID addGepValNode(NodeID curInst, const ValVar *base, const AccessPath &ap, NodeID i, const SVFType *type, const ICFGNode *node)
Add a temp field value node, this method can only invoked by getGepValVar.
NodeID addConstantDataObjNode(const NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
NodeID addConstantFPObjNode(NodeID i, ObjTypeInfo *ti, double dval, const ICFGNode *node)
void addFunRet(const FunObjVar *fun, const SVFVar *ret)
Add function returns.
NodeID addObjNode(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
Add a memory obj node.
NodeID addConstantNullPtrValNode(const NodeID i, const ICFGNode *icfgNode, const SVFType *type)
NodeID addHeapObjNode(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
static bool pagReadFromTXT()
CallGraph * callGraph
all the callsites of a program
void addToSVFStmtList(ICFGNode *inst, SVFStmt *edge)
Add a SVFStmt into instruction map.
NodeID addConstantNullPtrObjNode(const NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
void addCallSiteRets(RetICFGNode *retBlockNode, const SVFVar *arg)
Add callsite returns.
NodeID addConstantDataValNode(const NodeID i, const ICFGNode *icfgNode, const SVFType *type)
void addCallSiteArgs(CallICFGNode *callBlockNode, const ValVar *arg)
Add callsite arguments.
NodeID addStackObjNode(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
NodeID addConstantIntValNode(NodeID i, const std::pair< s64_t, u64_t > &intValue, const ICFGNode *icfgNode, const SVFType *type)
NodeID addFunValNode(NodeID i, const ICFGNode *icfgNode, const FunObjVar *funObjVar, const SVFType *type)
NodeID addConstantFPValNode(const NodeID i, double dval, const ICFGNode *icfgNode, const SVFType *type)
NodeID addConstantAggValNode(const NodeID i, const ICFGNode *icfgNode, const SVFType *svfType)
void addCallSite(const CallICFGNode *call)
Add callsites.
NodeID addValNode(NodeID i, const SVFType *type, const ICFGNode *icfgNode)
add node into SVFIR
NodeID addVarargNode(NodeID i, const FunObjVar *val, const SVFType *type, const ICFGNode *n)
Add a unique vararg node for a procedure.
void setCHG(CommonCHGraph *c)
Set/Get CHG.
NodeID addFunObjNode(NodeID id, ObjTypeInfo *ti, const ICFGNode *node)
NodeID addConstantIntObjNode(NodeID i, ObjTypeInfo *ti, const std::pair< s64_t, u64_t > &intValue, const ICFGNode *node)
void addGlobalPAGEdge(const SVFStmt *edge)
Add global PAGEdges (not in a procedure)
void addIndirectCallsites(const CallICFGNode *cs, NodeID funPtr)
Add indirect callsites.
void initialiseCandidatePointers()
Initialize candidate pointers.
NodeID addRetNode(NodeID i, const FunObjVar *callGraphNode, const SVFType *type, const ICFGNode *icn)
Add a unique return node for a procedure.
NodeID addArgValNode(NodeID i, u32_t argNo, const ICFGNode *icfgNode, const FunObjVar *callGraphNode, const SVFType *type)
NodeID addConstantObjNode()
const Map< const SVFBasicBlock *, BBSet > & getDomFrontierMap() const
Set< const SVFBasicBlock * > BBSet
static double getClk(bool mark=false)
static double timeOfBuildingSVFIR
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
virtual void setName(const std::string &nameInfo)
SVFStmt::SVFStmtSetTy & getIncomingEdges(SVFStmt::PEDGEK kind)
Edge accessors and checkers.
bool isIntrinsicInst(const Instruction *inst)
Return true if it is an intrinsic instruction.
const ConstantExpr * isBinaryConstantExpr(const Value *val)
bool isUncalledFunction(const Function *fun)
whether this is a function without any possible caller?
double getDoubleValue(const ConstantFP *fpValue)
bool isConstantObjSym(const Value *val)
Check whether this value points-to a constant object.
const Value * stripAllCasts(const Value *val)
Strip off the all casts.
const ConstantExpr * isInt2PtrConstantExpr(const Value *val)
const ConstantExpr * isSelectConstantExpr(const Value *val)
bool isIntrinsicFun(const Function *func)
bool functionDoesNotRet(const Function *fun)
const ConstantExpr * isTruncConstantExpr(const Value *val)
std::pair< s64_t, u64_t > getIntegerValue(const ConstantInt *intValue)
void getNextInsts(const Instruction *curInst, std::vector< const Instruction * > &instList)
Get the next instructions following control flow.
const ConstantExpr * isPtr2IntConstantExpr(const Value *val)
bool isHeapObj(const Value *val)
const ConstantExpr * isUnaryConstantExpr(const Value *val)
void getFunReachableBBs(const Function *svfFun, std::vector< const SVFBasicBlock * > &bbs)
Get reachable basic block from function entry.
const ConstantExpr * isCastConstantExpr(const Value *val)
bool isExtCall(const Function *fun)
bool basicBlockHasRetInst(const BasicBlock *bb)
Return true if the function has a return instruction.
bool isStackObj(const Value *val)
const ConstantExpr * isGepConstantExpr(const Value *val)
Return corresponding constant expression, otherwise return nullptr.
static DataLayout * getDataLayout(Module *mod)
const Function * getCallee(const CallBase *cs)
const FunObjVar * getFunObjVar(const std::string &name)
std::string dumpValue(const Value *val)
const ConstantExpr * isCmpConstantExpr(const Value *val)
std::string pasMsg(const std::string &msg)
Print each pass/phase message by converting a string into blue string output.
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
std::ostream & outs()
Overwrite llvm::outs()
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
const Value * getVCallVtblPtr(const CallBase *cs)
bool isValVtbl(const Value *val)
llvm::DataLayout DataLayout
llvm::GlobalVariable GlobalVariable
llvm::GlobalAlias GlobalAlias
llvm::ArrayType ArrayType
llvm::BasicBlock BasicBlock
llvm::UnaryOperator UnaryOperator
llvm::ConstantStruct ConstantStruct
llvm::StructType StructType
LLVM types.
llvm::succ_const_iterator succ_const_iterator
LLVM Iterators.
llvm::AllocaInst AllocaInst
llvm::SwitchInst SwitchInst
llvm::InvokeInst InvokeInst
llvm::const_pred_iterator const_pred_iterator
llvm::ConstantData ConstantData
llvm::Instruction Instruction
llvm::DomTreeNode DomTreeNode
llvm::ConstantDataSequential ConstantDataSequential
llvm::Value Value
LLVM Basic classes.
llvm::ConstantExpr ConstantExpr
llvm::IRBuilder IRBuilder
llvm::FreezeInst FreezeInst
llvm::BinaryOperator BinaryOperator
llvm::PostDominatorTree PostDominatorTree
llvm::DominanceFrontier DominanceFrontier
llvm::StoreInst StoreInst
llvm::SelectInst SelectInst
llvm::VAArgInst VAArgInst
llvm::Loop Loop
LLVM Loop.
llvm::GetElementPtrInst GetElementPtrInst
llvm::CallBrInst CallBrInst
llvm::ReturnInst ReturnInst
llvm::BranchInst BranchInst
llvm::ExtractValueInst ExtractValueInst
llvm::ConstantInt ConstantInt
llvm::DominatorTree DominatorTree
LLVM Dominators.
llvm::ExtractElementInst ExtractElementInst