|
Static Value-Flow Analysis
|
#include <LLVMModule.h>
Static Public Member Functions | |
| static LLVMModuleSet * | getLLVMModuleSet () |
| static void | releaseLLVMModuleSet () |
| static void | buildSVFModule (Module &mod) |
| static void | buildSVFModule (const std::vector< std::string > &moduleNameVec) |
| static void | preProcessBCs (std::vector< std::string > &moduleNameVec) |
Static Private Attributes | |
| static LLVMModuleSet * | llvmModuleSet = nullptr |
| static bool | preProcessed = false |
Friends | |
| class | SVFIRBuilder |
| class | ICFGBuilder |
| class | SymbolTableBuilder |
Definition at line 46 of file LLVMModule.h.
Definition at line 66 of file LLVMModule.h.
Definition at line 67 of file LLVMModule.h.
| typedef Map<std::string, std::vector<std::string> > SVF::LLVMModuleSet::Fun2AnnoMap |
Definition at line 64 of file LLVMModule.h.
| typedef std::vector<const Function*> SVF::LLVMModuleSet::FunctionSet |
Definition at line 78 of file LLVMModule.h.
| typedef std::vector<const Function*> SVF::LLVMModuleSet::FunctionSetType |
Definition at line 54 of file LLVMModule.h.
Definition at line 55 of file LLVMModule.h.
Definition at line 56 of file LLVMModule.h.
Definition at line 79 of file LLVMModule.h.
Definition at line 69 of file LLVMModule.h.
Definition at line 70 of file LLVMModule.h.
Definition at line 76 of file LLVMModule.h.
Definition at line 80 of file LLVMModule.h.
Definition at line 57 of file LLVMModule.h.
Definition at line 68 of file LLVMModule.h.
Definition at line 60 of file LLVMModule.h.
Definition at line 59 of file LLVMModule.h.
Definition at line 62 of file LLVMModule.h.
Definition at line 61 of file LLVMModule.h.
Definition at line 63 of file LLVMModule.h.
llvm value to sym id map local (%) and global (@) identifiers are pointer types which have a value node id.
Definition at line 74 of file LLVMModule.h.
|
private |
Constructor.
Definition at line 85 of file LLVMModule.cpp.
| LLVMModuleSet::~LLVMModuleSet | ( | ) |
Definition at line 90 of file LLVMModule.cpp.
|
inline |
Definition at line 235 of file LLVMModule.h.
Definition at line 443 of file LLVMModule.h.
|
inline |
Definition at line 242 of file LLVMModule.h.
|
inline |
Definition at line 252 of file LLVMModule.h.
|
inline |
Definition at line 247 of file LLVMModule.h.
|
private |
Definition at line 509 of file LLVMModule.cpp.
Create SVFTypes.
Definition at line 1296 of file LLVMModule.cpp.
Definition at line 1158 of file LLVMModule.cpp.
|
private |
Definition at line 165 of file LLVMModule.cpp.
|
private |
Keep svf_main() function and all the functions called in svf_main()
app functions
App Func decl -> SVF extern Func def
Overwrite App Func def -> SVF extern Func def
Definition at line 676 of file LLVMModule.cpp.
|
private |
Definition at line 1012 of file LLVMModule.cpp.
|
static |
Definition at line 127 of file LLVMModule.cpp.
|
static |
|
private |
building symbol table
Definition at line 150 of file LLVMModule.cpp.
Collect the array info.
Fill in StInfo for an array type.
array without any element (this is not true in C/C++ arrays) we assume there is an empty dummy element
Array's flatten field infor is the same as its element's flatten infor.
Flatten arrays, map each array element index i to flattened index (i * nfE * totalElemNum)/outArrayElemNum nfE>1 if the array element is a struct with more than one field.
Definition at line 1373 of file LLVMModule.cpp.
Non-opaque pointer
Opaque pointer
Definition at line 608 of file LLVMModule.cpp.
Collect simple type (non-aggregate) info.
Collect simple type (non-aggregate) info
Only one field
Definition at line 1493 of file LLVMModule.cpp.
|
private |
Collect the struct info and set the number of fields after flattening.
Fill in struct_info for T. Given a Struct type, we recursively extend and record its fields and types.
The struct info should not be processed before
Definition at line 1436 of file LLVMModule.cpp.
Collect a type info.
Definition at line 1264 of file LLVMModule.cpp.
|
private |
Function
set exit block: exit basic block must have no successors and have a return instruction
Definition at line 180 of file LLVMModule.cpp.
| void LLVMModuleSet::dumpModulesToFile | ( | const std::string & | suffix | ) |
Definition at line 1055 of file LLVMModule.cpp.
| void LLVMModuleSet::dumpSymTable | ( | ) |
Definition at line 1111 of file LLVMModule.cpp.
|
inline |
Definition at line 390 of file LLVMModule.h.
Definition at line 1577 of file LLVMModule.cpp.
|
inlineprivate |
| CallICFGNode * LLVMModuleSet::getCallICFGNode | ( | const Instruction * | cs | ) |
get a call node
Definition at line 1239 of file LLVMModule.cpp.
|
inline |
Definition at line 384 of file LLVMModule.h.
| DominatorTree & LLVMModuleSet::getDomTree | ( | const Function * | fun | ) |
Definition at line 103 of file LLVMModule.cpp.
| std::string LLVMModuleSet::getExtFuncAnnotation | ( | const Function * | fun, |
| const std::string & | funcAnnotation | ||
| ) |
Definition at line 1526 of file LLVMModule.cpp.
Definition at line 1539 of file LLVMModule.cpp.
Get the corresponding Function based on its name.
Definition at line 309 of file LLVMModule.h.
|
inline |
Definition at line 195 of file LLVMModule.h.
|
inlineprivate |
Get/Add a function entry node.
Definition at line 512 of file LLVMModule.h.
|
inline |
Add a function entry node.
Definition at line 340 of file LLVMModule.h.
|
inline |
Definition at line 181 of file LLVMModule.h.
|
inlineprivate |
Get/Add a function exit node.
Definition at line 521 of file LLVMModule.h.
|
inline |
Add a function exit node.
Definition at line 347 of file LLVMModule.h.
Definition at line 270 of file LLVMModule.h.
Get the corresponding Function based on its name.
Definition at line 1166 of file LLVMModule.cpp.
|
inline |
Definition at line 362 of file LLVMModule.h.
| ICFGNode * LLVMModuleSet::getICFGNode | ( | const Instruction * | inst | ) |
Get a basic block ICFGNode.
Definition at line 1212 of file LLVMModule.cpp.
|
inlineprivate |
Definition at line 503 of file LLVMModule.h.
| IntraICFGNode * LLVMModuleSet::getIntraICFGNode | ( | const Instruction * | inst | ) |
get a intra node
Definition at line 1257 of file LLVMModule.cpp.
|
private |
Definition at line 421 of file LLVMModule.cpp.
|
inline |
Definition at line 160 of file LLVMModule.h.
|
inlinestatic |
Definition at line 133 of file LLVMModule.h.
Get LLVM Type.
Definition at line 1183 of file LLVMModule.cpp.
Definition at line 263 of file LLVMModule.h.
|
inline |
Definition at line 369 of file LLVMModule.h.
Definition at line 165 of file LLVMModule.h.
|
inline |
Definition at line 155 of file LLVMModule.h.
Definition at line 170 of file LLVMModule.h.
getObject - Return the obj node id refer to the memory object for the specified global, heap or alloca instruction according to llvm value.
Definition at line 1101 of file LLVMModule.cpp.
|
inline |
Definition at line 205 of file LLVMModule.h.
Definition at line 188 of file LLVMModule.h.
|
inlineprivate |
| RetICFGNode * LLVMModuleSet::getRetICFGNode | ( | const Instruction * | cs | ) |
get a return node
Definition at line 1248 of file LLVMModule.cpp.
Definition at line 287 of file LLVMModule.h.
|
inline |
Definition at line 301 of file LLVMModule.h.
Get or create SVFType and typeinfo.
Get or create SVFType and typeinfo
Definition at line 1197 of file LLVMModule.cpp.
| ObjTypeInference * LLVMModuleSet::getTypeInference | ( | ) |
Definition at line 98 of file LLVMModule.cpp.
Get SVFIR Node according to LLVM value getNode - Return the node corresponding to the specified pointer.
Definition at line 1080 of file LLVMModule.cpp.
|
inline |
Definition at line 200 of file LLVMModule.h.
Definition at line 294 of file LLVMModule.h.
| bool LLVMModuleSet::hasExtFuncAnnotation | ( | const Function * | fun, |
| const std::string & | funcAnnotation | ||
| ) |
Definition at line 1513 of file LLVMModule.cpp.
|
inline |
| bool LLVMModuleSet::hasICFGNode | ( | const Instruction * | inst | ) |
Definition at line 1226 of file LLVMModule.cpp.
Definition at line 258 of file LLVMModule.h.
Definition at line 1560 of file LLVMModule.cpp.
Definition at line 1571 of file LLVMModule.cpp.
Definition at line 1566 of file LLVMModule.cpp.
Definition at line 1601 of file LLVMModule.cpp.
Definition at line 1548 of file LLVMModule.cpp.
Definition at line 1555 of file LLVMModule.cpp.
Definition at line 1593 of file LLVMModule.cpp.
|
private |
Definition at line 382 of file LLVMModule.cpp.
|
private |
Definition at line 316 of file LLVMModule.cpp.
|
inline |
Definition at line 215 of file LLVMModule.h.
|
private |
Invoke llvm passes to modify module.
Invoke llvm passes to modify module
BreakConstantGEPs Pass
MergeFunctionRets Pass
Definition at line 255 of file LLVMModule.cpp.
|
static |
Definition at line 295 of file LLVMModule.cpp.
|
inlinestatic |
Definition at line 140 of file LLVMModule.h.
|
inline |
Definition at line 277 of file LLVMModule.h.
| void LLVMModuleSet::setExtFuncAnnotations | ( | const Function * | fun, |
| const std::vector< std::string > & | funcAnnotations | ||
| ) |
Definition at line 1507 of file LLVMModule.cpp.
|
inlineprivate |
Definition at line 448 of file LLVMModule.h.
|
inlineprivate |
Definition at line 453 of file LLVMModule.h.
|
inline |
Definition at line 210 of file LLVMModule.h.
|
inline |
Definition at line 282 of file LLVMModule.h.
|
friend |
Definition at line 49 of file LLVMModule.h.
|
friend |
Definition at line 48 of file LLVMModule.h.
|
friend |
Definition at line 50 of file LLVMModule.h.
|
private |
map a callsite to its CallICFGNode
Definition at line 108 of file LLVMModule.h.
|
private |
map a callsite to its RetICFGNode
Definition at line 109 of file LLVMModule.h.
|
private |
Record annotations of function in extapi.bc.
Definition at line 93 of file LLVMModule.h.
|
private |
Record some "sse_" function declarations used in other ext function definition, e.g., svf_ext_foo(), and svf_ext_foo() used in app functions.
Definition at line 91 of file LLVMModule.h.
Definition at line 96 of file LLVMModule.h.
|
private |
Definition at line 121 of file LLVMModule.h.
|
private |
Definition at line 114 of file LLVMModule.h.
|
private |
Definition at line 122 of file LLVMModule.h.
|
private |
map a function to its FunExitICFGNode
Definition at line 111 of file LLVMModule.h.
|
private |
map a function to its FunEntryICFGNode
Definition at line 112 of file LLVMModule.h.
|
private |
Definition at line 123 of file LLVMModule.h.
|
private |
Global definition to a rep definition map.
Definition at line 99 of file LLVMModule.h.
|
private |
map a basic block to its ICFGNode
Definition at line 110 of file LLVMModule.h.
|
private |
Definition at line 102 of file LLVMModule.h.
|
private |
Map an LLVM Function to an SVF Funobjvar.
Definition at line 101 of file LLVMModule.h.
|
staticprivate |
Definition at line 83 of file LLVMModule.h.
|
private |
Definition at line 103 of file LLVMModule.h.
|
private |
Definition at line 88 of file LLVMModule.h.
|
private |
map a obj reference to its sym id
Definition at line 117 of file LLVMModule.h.
|
private |
Definition at line 86 of file LLVMModule.h.
|
private |
Definition at line 87 of file LLVMModule.h.
Definition at line 84 of file LLVMModule.h.
|
private |
return map
Definition at line 118 of file LLVMModule.h.
|
private |
Definition at line 107 of file LLVMModule.h.
|
private |
Definition at line 85 of file LLVMModule.h.
|
private |
Definition at line 104 of file LLVMModule.h.
|
private |
Definition at line 105 of file LLVMModule.h.
|
private |
map a value to its sym id
Definition at line 116 of file LLVMModule.h.
|
private |
vararg map
Definition at line 119 of file LLVMModule.h.