Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFIRBuilder.h
Go to the documentation of this file.
1//===- SVFIRBuilder.h -- Building SVFIR-------------------------------------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-2017> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * SVFIRBuilder.h
25 *
26 * Created on: Nov 1, 2013
27 * Author: Yulei Sui
28 * Refactored on: Jan 25, 2024
29 * Author: Xiao Cheng, Yulei Sui
30 */
31
32#ifndef PAGBUILDER_H_
33#define PAGBUILDER_H_
34
35#include "SVFIR/SVFIR.h"
36#include "SVF-LLVM/BasicTypes.h"
38#include "SVF-LLVM/LLVMModule.h"
39#include "SVF-LLVM/LLVMUtil.h"
40
41#include <optional>
42
43namespace SVF
44{
45
49class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
50{
51 friend class GraphDBSVFIRBuilder;
52
53private:
56 const Value* curVal;
57
58
62 using AggregateField = std::vector<unsigned>;
64 using AggregateFieldKey = std::pair<const Value*, AggregateField>;
67
69 std::vector<AggregateFieldKey>& operands);
70 bool getAggregateFieldNode(const Value* aggregate, const AggregateField& indices,
71 NodeID& node);
73 static std::optional<AggregateFieldKey>
74 getExtractedField(const Instruction& inst);
76
136
140
144 const std::set<AggregateField>& fields,
145 const SVFType* pointerType);
146 void createAggregateCallSlots(const Function* fun,
147 const SVFType* pointerType);
148 void addAggregateCallFields(const CallInst* call);
150
151public:
153 SVFIRBuilder(): pag(SVFIR::getPAG()), curBB(nullptr),curVal(nullptr)
154 {
155 }
156
158 {
159 }
160
162 virtual SVFIR* build();
163
165 SVFIR* getPAG() const
166 {
167 return pag;
168 }
169
170 void createFunObjVars();
171 void initFunObjVar();
172
174
175 void initialiseNodes();
177 void initialiseValVars();
178
179 void initSVFBasicBlock(const Function* func);
180
181 void initDomTree(FunObjVar* func, const Function* f);
182
184 APOffset offset = 0, Instruction* cs = nullptr);
185 // @}
186
188 void sanityCheck();
189
191
192 // GetValNode - Return the value node according to a LLVM Value.
194 {
195 // first handle gep edge if val if a constant expression
196 processCE(V);
197
198 // strip off the constant cast and return the value node
199 return llvmModuleSet()->getValueNode(V);
200 }
201
203 inline NodeID getObjectNode(const Value* V)
204 {
205 return llvmModuleSet()->getObjectNode(V);
206 }
207
209 inline NodeID getReturnNode(const FunObjVar *func)
210 {
211 return pag->getReturnNode(func);
212 }
213
215 inline NodeID getVarargNode(const FunObjVar *func)
216 {
217 return pag->getVarargNode(func);
218 }
219
220
221
223
224 // Instructions that cannot be folded away.
225 virtual void visitAllocaInst(AllocaInst &AI);
226 void visitPHINode(PHINode &I);
227 void visitStoreInst(StoreInst &I);
228 void visitLoadInst(LoadInst &I);
230 void visitCallInst(CallInst &I);
231 void visitInvokeInst(InvokeInst &II);
233 void visitCallSite(CallBase* cs);
235 void visitCastInst(CastInst &I);
247 // TerminatorInst and UnwindInst have been removed since llvm-8.0.0
248 // void visitTerminatorInst(TerminatorInst &TI) {}
249 // void visitUnwindInst(UnwindInst &I) { /*returns void*/}
250
253 void visitCmpInst(CmpInst &I);
254
261
266
268
284
286 void visitResumeInst(ResumeInst&) /*returns void*/
287 {
288 }
289 void visitUnreachableInst(UnreachableInst&) /*returns void*/
290 {
291 }
292 void visitFenceInst(FenceInst &I) /*returns void*/
293 {
295 }
304
307 {
308 // If a new instruction is added to LLVM that we don't handle.
309 // TODO: ignore here:
310 }
311 //}@
312
314 void updateCallGraph(CallGraph* callgraph);
315
316protected:
318
319 void visitGlobal();
320 void InitialGlobal(const GlobalVariable *gvar, Constant *C,
321 u32_t offset);
324
326 void processCE(const Value* val);
327
329 u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, AccessPath& ap, APOffset idx);
330
332 bool computeGepOffset(const User *V, AccessPath& ap);
333
335 const Value* getBaseValueForExtArg(const Value* V);
336
338 void handleDirectCall(CallBase* cs, const Function *F);
339
341 void handleIndCall(CallBase* cs);
342
344
345 virtual const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<AccessPath> &fields, const Value* szValue);
346 virtual void addComplexConsForExt(Value *D, Value *S, const Value* sz);
347 virtual void handleNondetArgStoreAtExtCall(const CallBase* cs, const CallICFGNode* callICFGNode);
348 virtual void handleExtCall(const CallBase* cs, const Function* callee);
350
352 inline void setCurrentLocation(const Value* val, const BasicBlock* bb)
353 {
354 curBB = (bb == nullptr? nullptr : llvmModuleSet()->getSVFBasicBlock(bb));
355 curVal = (val == nullptr ? nullptr: val);
356 }
357 inline void setCurrentLocation(const Value* val, const SVFBasicBlock* bb)
358 {
359 curBB = bb;
360 curVal = val;
361 }
362 inline const Value* getCurrentValue() const
363 {
364 return curVal;
365 }
366 inline const SVFBasicBlock* getCurrentBB() const
367 {
368 return curBB;
369 }
370
372 void addGlobalBlackHoleAddrEdge(NodeID node, const ConstantExpr *int2Ptrce)
373 {
374 const Value* cval = getCurrentValue();
375 const SVFBasicBlock* cbb = getCurrentBB();
376 setCurrentLocation(int2Ptrce,(SVFBasicBlock*) nullptr);
378 setCurrentLocation(cval,cbb);
379 }
380
383 {
385 ConstantPointerNull* constNull = ConstantPointerNull::get(PointerType::getUnqual(cxt));
386 NodeID nullPtr = pag->addConstantNullPtrValNode(pag->getNullPtr(), nullptr, llvmModuleSet()->getSVFType(constNull->getType()));
387 llvmModuleSet()->addToSVFVar2LLVMValueMap(constNull, pag->getGNode(pag->getNullPtr()));
388 setCurrentLocation(constNull, (SVFBasicBlock*) nullptr);
389 addBlackHoleAddrEdge(pag->getBlkPtr());
390 return nullPtr;
391 }
392
393 NodeID getGepValVar(const Value* val, const AccessPath& ap, const SVFType* elementType);
394
395 NodeID getDirectAccessFieldZeroValVar(const Value* ptr, const Type* accessTy);
396
398
399 inline void addBlackHoleAddrEdge(NodeID node)
400 {
401 if(PAGEdge *edge = pag->addBlackHoleAddrStmt(node))
403 }
404
407 {
408 if(AddrStmt *edge = pag->addAddrStmt(src, dst))
409 {
411 return edge;
412 }
413 return nullptr;
414 }
415
417 inline AddrStmt* addAddrWithStackArraySz(NodeID src, NodeID dst, llvm::AllocaInst& inst)
418 {
419 AddrStmt* edge = addAddrEdge(src, dst);
420 if (inst.getArraySize())
421 {
422 edge->addArrSize(pag->getGNode(getValueNode(inst.getArraySize())));
423 }
424 return edge;
425 }
426
428 inline AddrStmt* addAddrWithHeapSz(NodeID src, NodeID dst, const CallBase* cs)
429 {
430 // get name of called function
431 AddrStmt* edge = addAddrEdge(src, dst);
432
433 llvm::Function* calledFunc = cs->getCalledFunction();
434 std::string functionName;
435 if (calledFunc)
436 {
437 functionName = calledFunc->getName().str();
438 }
439 else
440 {
441 SVFUtil::writeWrnMsg("not support indirect call to add AddrStmt.\n");
442 }
443 if (functionName == "malloc")
444 {
445 if (cs->arg_size() > 0)
446 {
447 const llvm::Value* val = cs->getArgOperand(0);
448 edge->addArrSize(pag->getGNode(getValueNode(val)));
449 }
450 }
451 // Check if the function called is 'calloc' and process its arguments.
452 // e.g. "%5 = call i8* @calloc(1, 8)", edge should add two SVFValue (1 and 8)
453 else if (functionName == "calloc")
454 {
455 if (cs->arg_size() > 1)
456 {
457 edge->addArrSize(
458 pag->getGNode(getValueNode(cs->getArgOperand(0))));
459 edge->addArrSize(
460 pag->getGNode(getValueNode(cs->getArgOperand(1))));
461 }
462 }
463 else
464 {
465 if (cs->arg_size() > 0)
466 {
467 const llvm::Value* val = cs->getArgOperand(0);
468 edge->addArrSize(pag->getGNode(getValueNode(val)));
469 }
470 }
471 return edge;
472 }
473
475 {
476 if(CopyStmt *edge = pag->addCopyStmt(src, dst, kind))
477 {
479 return edge;
480 }
481 return nullptr;
482 }
483
485 {
486 // COPYVAL, ZEXT, SEXT, BITCAST, FPTRUNC, FPTOUI, FPTOSI, UITOFP, SITOFP, INTTOPTR, PTRTOINT
487 if (const Instruction* inst = SVFUtil::dyn_cast<Instruction>(val))
488 {
489 switch (inst->getOpcode())
490 {
491 case Instruction::ZExt:
492 return CopyStmt::ZEXT;
493 case Instruction::SExt:
494 return CopyStmt::SEXT;
495 case Instruction::BitCast:
496 return CopyStmt::BITCAST;
497 case Instruction ::Trunc:
498 return CopyStmt::TRUNC;
499 case Instruction::FPTrunc:
500 return CopyStmt::FPTRUNC;
501 case Instruction::FPToUI:
502 return CopyStmt::FPTOUI;
503 case Instruction::FPToSI:
504 return CopyStmt::FPTOSI;
505 case Instruction::UIToFP:
506 return CopyStmt::UITOFP;
507 case Instruction::SIToFP:
508 return CopyStmt::SITOFP;
509 case Instruction::IntToPtr:
510 return CopyStmt::INTTOPTR;
511 case Instruction::PtrToInt:
512 return CopyStmt::PTRTOINT;
513 default:
514 return CopyStmt::COPYVAL;
515 }
516 }
517 assert (false && "Unknown cast inst!");
518 abort();
519 }
520
522 inline void addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred)
523 {
525 if(PhiStmt *edge = pag->addPhiStmt(res,opnd,pred))
527 }
528
529 inline void addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
530 {
531 if(SelectStmt *edge = pag->addSelectStmt(res,op1,op2,cond))
533 }
534
535 inline void addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
536 {
537 if(CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, predict))
539 }
540
541 inline void addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
542 {
543 if(BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode))
545 }
546
547 inline void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
548 {
549 if(UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode))
551 }
552
553 inline void addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs)
554 {
555 if(BranchStmt *edge = pag->addBranchStmt(br, cond, succs))
557 }
558
559 inline void addLoadEdge(NodeID src, NodeID dst)
560 {
561 if(LoadStmt *edge = pag->addLoadStmt(src, dst))
563 }
564
565 inline void addStoreEdge(NodeID src, NodeID dst)
566 {
567 ICFGNode* node;
569 node = llvmModuleSet()->getICFGNode(
571 else
572 node = nullptr;
573 if (StoreStmt* edge = pag->addStoreStmt(src, dst, node))
575 }
576
577 inline void addCallEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
578 {
579 if (CallPE* edge = pag->addCallPE(src, dst, cs, entry))
581 }
582
583 inline void addRetEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
584 {
585 if (RetPE* edge = pag->addRetPE(src, dst, cs, exit))
587 }
588
589 inline void addGepEdge(NodeID src, NodeID dst, const AccessPath& ap, bool constGep)
590 {
591 if (GepStmt* edge = pag->addGepStmt(src, dst, ap, constGep))
593 }
594
595 inline void addNormalGepEdge(NodeID src, NodeID dst, const AccessPath& ap)
596 {
597 if (GepStmt* edge = pag->addNormalGepStmt(src, dst, ap))
599 }
600
601 inline void addVariantGepEdge(NodeID src, NodeID dst, const AccessPath& ap)
602 {
603 if (GepStmt* edge = pag->addVariantGepStmt(src, dst, ap))
605 }
606
607 inline void addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
608 {
609 if (TDForkPE* edge = pag->addThreadForkPE(src, dst, cs, entry))
611 }
612
613 inline void addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
614 {
615 if (TDJoinPE* edge = pag->addThreadJoinPE(src, dst, cs, exit))
617 }
618
619
621
622private:
627};
628
629} // End namespace SVF
630
631#endif /* PAGBUILDER_H_ */
buffer offset
Definition cJSON.cpp:1113
void addArrSize(SVFVar *size)
get array size of the allocated memory
std::vector< std::pair< const ICFGNode *, s64_t > > SuccAndCondPairVec
NodeID getValueNode(const Value *V)
static LLVMModuleSet * getLLVMModuleSet()
Definition LLVMModule.h:137
SVFBasicBlock * getSVFBasicBlock(const BasicBlock *bb)
Definition LLVMModule.h:305
void addToSVFVar2LLVMValueMap(const Value *val, SVFValue *svfBaseNode)
ICFGNode * getICFGNode(const Instruction *inst)
Get a basic block ICFGNode.
NodeID getObjectNode(const Value *V)
LLVMContext & getContext() const
Definition LLVMModule.h:393
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.
void visitLandingPadInst(LandingPadInst &I)
SVFIR * getPAG() const
Return SVFIR.
Map< AggregateFieldKey, NodeID > aggregateFieldNodes
Reuse the same scalar SVFIR node for repeated requests for a field.
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)
void addAggregateCallFields(const CallInst *call)
std::vector< unsigned > AggregateField
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.
void visitInsertValueInst(InsertValueInst &I)
AddrStmt * addAddrWithHeapSz(NodeID src, NodeID dst, const CallBase *cs)
Add Address edge from ext call with args like "%5 = call i8* @malloc(i64 noundef 5)".
LLVMModuleSet * llvmModuleSet()
void visitStoreInst(StoreInst &I)
void visitVAStartInst(VAStartInst &)
void addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Thread fork edge for parameter passing.
void addGlobalBlackHoleAddrEdge(NodeID node, const ConstantExpr *int2Ptrce)
Add global black hole Address edge.
NodeID getReturnNode(const FunObjVar *func)
getReturnNode - Return the node representing the unique return value of a function.
virtual ~SVFIRBuilder()
Destructor.
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)
Map< const CallInst *, std::map< AggregateField, NodeID > > aggregateCallArgs
friend class GraphDBSVFIRBuilder
std::pair< const Value *, AggregateField > AggregateFieldKey
Identify a field by its LLVM value and path, rather than by its type alone.
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)
Preserve LLVM switch destinations and case values in BranchStmt.
static std::optional< AggregateFieldKey > getExtractedField(const Instruction &inst)
Decode a pointer extraction; unsupported instructions have no field.
void visitFreezeInst(FreezeInst &I)
void visitFenceInst(FenceInst &I)
void addAggregateReturnStores(ReturnInst &inst)
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)
SVFIRBuilder()
Constructor.
virtual void handleNondetArgStoreAtExtCall(const CallBase *cs, const CallICFGNode *callICFGNode)
void visitInstruction(Instruction &)
Provide base case for our instruction visit.
NodeID getDirectAccessFieldZeroValVar(const Value *ptr, const Type *accessTy)
void addNormalGepEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Offset(Gep) edge.
void visitResumeInst(ResumeInst &)
Instruction not that often.
void visitGlobal()
Handle globals including (global variable and functions).
void visitInsertElementInst(InsertElementInst &I)
void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
Add Unary edge.
void visitVAEndInst(VAEndInst &)
void initialiseAggregateReturns()
const SVFBasicBlock * getCurrentBB() const
virtual const Type * getBaseTypeAndFlattenedFields(const Value *V, std::vector< AccessPath > &fields, const Value *szValue)
Handle external call.
void createAggregateCallSlots(const Function *fun, const SVFType *pointerType)
void visitPHINode(PHINode &I)
CopyStmt * addCopyEdge(NodeID src, NodeID dst, CopyStmt::CopyKind kind)
bool getAggregateFieldOperands(const AggregateFieldKey &field, std::vector< AggregateFieldKey > &operands)
Describe one field definition without emitting any SVFIR statements.
bool getAggregateFieldNode(const Value *aggregate, const AggregateField &indices, NodeID &node)
void addExtractedFieldCopy(Instruction &inst)
void addCallEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunEntryICFGNode *entry)
Add Call edge.
void setCurrentBBAndValueForPAGEdge(PAGEdge *edge)
void visitSelectInst(SelectInst &I)
AggregateReturnFields discoverAggregateReturnFields()
void visitVAArgInst(VAArgInst &)
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &I)
void addEdge(NodeID src, NodeID dst, SVFStmt::PEDGEK kind, APOffset offset=0, Instruction *cs=nullptr)
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
void visitShuffleVectorInst(ShuffleVectorInst &I)
NodeID getValueNode(const Value *V)
Get different kinds of node.
void visitCastInst(CastInst &I)
Map< const Function *, std::map< AggregateField, NodeID > > aggregateReturnParams
Output parameters of each modeled callee, in field-path order.
virtual void addComplexConsForExt(Value *D, Value *S, const Value *sz)
void setCurrentLocation(const Value *val, const SVFBasicBlock *bb)
AddrStmt * addAddrWithStackArraySz(NodeID src, NodeID dst, llvm::AllocaInst &inst)
Add Address edge from allocinst with arraysize like "%4 = alloca i8, i64 3".
Map< const Function *, std::set< AggregateField > > AggregateReturnFields
Field paths extracted from each callee's returned aggregate.
void visitAtomicRMWInst(AtomicRMWInst &I)
NodeID getGepValVar(const Value *val, const AccessPath &ap, const SVFType *elementType)
void visitUnreachableInst(UnreachableInst &)
void InitialGlobal(const GlobalVariable *gvar, Constant *C, u32_t offset)
void visitUnaryOperator(UnaryOperator &I)
void visitBinaryOperator(BinaryOperator &I)
void addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode *cs, const FunExitICFGNode *exit)
Add Thread join edge for parameter passing.
void createAggregateReturnParams(const Function *fun, const std::set< AggregateField > &fields, const SVFType *pointerType)
void initialiseNodes()
Initialize nodes and edges.
NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset, SVFType *tpy)
void addVariantGepEdge(NodeID src, NodeID dst, const AccessPath &ap)
Add Variant(Gep) edge.
void visitVACopyInst(VACopyInst &)
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
Definition Casting.h:360
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
Definition SVFUtil.cpp:88
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
Definition Casting.h:405
for isBitcode
Definition BasicTypes.h:70
llvm::DataLayout DataLayout
Definition BasicTypes.h:106
llvm::GlobalVariable GlobalVariable
Definition BasicTypes.h:131
llvm::VACopyInst VACopyInst
Definition BasicTypes.h:177
llvm::Type Type
Definition BasicTypes.h:81
llvm::CallBase CallBase
Definition BasicTypes.h:147
llvm::BasicBlock BasicBlock
Definition BasicTypes.h:84
llvm::UnaryOperator UnaryOperator
Definition BasicTypes.h:181
llvm::AllocaInst AllocaInst
Definition BasicTypes.h:151
llvm::SwitchInst SwitchInst
Definition BasicTypes.h:156
u32_t NodeID
Definition GeneralType.h:76
llvm::AtomicRMWInst AtomicRMWInst
Definition BasicTypes.h:153
llvm::InsertValueInst InsertValueInst
Definition BasicTypes.h:168
llvm::InvokeInst InvokeInst
Definition BasicTypes.h:164
llvm::AtomicCmpXchgInst AtomicCmpXchgInst
Definition BasicTypes.h:152
llvm::LoadInst LoadInst
Definition BasicTypes.h:150
s64_t APOffset
Definition GeneralType.h:80
llvm::CmpInst CmpInst
Definition BasicTypes.h:160
llvm::Function Function
Definition BasicTypes.h:83
llvm::FenceInst FenceInst
Definition BasicTypes.h:169
llvm::ShuffleVectorInst ShuffleVectorInst
Definition BasicTypes.h:165
llvm::InsertElementInst InsertElementInst
Definition BasicTypes.h:172
llvm::Instruction Instruction
Definition BasicTypes.h:85
llvm::Constant Constant
Definition BasicTypes.h:122
llvm::UnreachableInst UnreachableInst
Definition BasicTypes.h:171
llvm::ResumeInst ResumeInst
Definition BasicTypes.h:174
llvm::Value Value
LLVM Basic classes.
Definition BasicTypes.h:80
llvm::ConstantPointerNull ConstantPointerNull
Definition BasicTypes.h:125
llvm::ConstantExpr ConstantExpr
Definition BasicTypes.h:118
llvm::CastInst CastInst
Definition BasicTypes.h:159
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
Definition GeneralType.h:56
llvm::FreezeInst FreezeInst
Definition BasicTypes.h:170
llvm::BinaryOperator BinaryOperator
Definition BasicTypes.h:180
llvm::StoreInst StoreInst
Definition BasicTypes.h:149
llvm::SelectInst SelectInst
Definition BasicTypes.h:175
llvm::VAArgInst VAArgInst
Definition BasicTypes.h:176
llvm::GetElementPtrInst GetElementPtrInst
Definition BasicTypes.h:163
llvm::CallBrInst CallBrInst
Definition BasicTypes.h:157
llvm::ReturnInst ReturnInst
Definition BasicTypes.h:158
llvm::PHINode PHINode
Definition BasicTypes.h:166
llvm::BranchInst BranchInst
Definition BasicTypes.h:155
llvm::ExtractValueInst ExtractValueInst
Definition BasicTypes.h:161
unsigned u32_t
Definition GeneralType.h:67
llvm::VAStartInst VAStartInst
Definition BasicTypes.h:179
llvm::VAEndInst VAEndInst
Definition BasicTypes.h:178
llvm::CallInst CallInst
Definition BasicTypes.h:148
SVFStmt PAGEdge
Definition IRGraph.h:41
llvm::LandingPadInst LandingPadInst
Definition BasicTypes.h:173
llvm::ExtractElementInst ExtractElementInst
Definition BasicTypes.h:162
llvm::User User
Definition BasicTypes.h:143
llvm::LLVMContext LLVMContext
Definition BasicTypes.h:72