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 44 of file LLVMModule.h.
Definition at line 64 of file LLVMModule.h.
Definition at line 65 of file LLVMModule.h.
typedef Map<std::string, std::vector<std::string> > SVF::LLVMModuleSet::Fun2AnnoMap |
Definition at line 62 of file LLVMModule.h.
typedef std::vector<const Function*> SVF::LLVMModuleSet::FunctionSet |
Definition at line 76 of file LLVMModule.h.
typedef std::vector<const Function*> SVF::LLVMModuleSet::FunctionSetType |
Definition at line 52 of file LLVMModule.h.
Definition at line 53 of file LLVMModule.h.
Definition at line 54 of file LLVMModule.h.
Definition at line 77 of file LLVMModule.h.
Definition at line 67 of file LLVMModule.h.
Definition at line 68 of file LLVMModule.h.
Definition at line 74 of file LLVMModule.h.
Definition at line 78 of file LLVMModule.h.
Definition at line 55 of file LLVMModule.h.
Definition at line 66 of file LLVMModule.h.
Definition at line 58 of file LLVMModule.h.
Definition at line 57 of file LLVMModule.h.
Definition at line 60 of file LLVMModule.h.
Definition at line 59 of file LLVMModule.h.
Definition at line 61 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 72 of file LLVMModule.h.
|
private |
Constructor.
Definition at line 81 of file LLVMModule.cpp.
LLVMModuleSet::~LLVMModuleSet | ( | ) |
Definition at line 86 of file LLVMModule.cpp.
|
inline |
Definition at line 232 of file LLVMModule.h.
Definition at line 440 of file LLVMModule.h.
|
inline |
Definition at line 239 of file LLVMModule.h.
|
inline |
Definition at line 249 of file LLVMModule.h.
|
inline |
Definition at line 244 of file LLVMModule.h.
|
private |
Definition at line 489 of file LLVMModule.cpp.
Create SVFTypes.
Definition at line 1265 of file LLVMModule.cpp.
Definition at line 1127 of file LLVMModule.cpp.
|
private |
Definition at line 161 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 651 of file LLVMModule.cpp.
|
private |
Definition at line 981 of file LLVMModule.cpp.
|
static |
Definition at line 123 of file LLVMModule.cpp.
|
static |
|
private |
building symbol table
Definition at line 146 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 1342 of file LLVMModule.cpp.
Non-opaque pointer
Opaque pointer
Definition at line 583 of file LLVMModule.cpp.
Collect simple type (non-aggregate) info.
Collect simple type (non-aggregate) info
Only one field
Definition at line 1462 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 1405 of file LLVMModule.cpp.
Collect a type info.
Definition at line 1233 of file LLVMModule.cpp.
|
private |
Function
set exit block: exit basic block must have no successors and have a return instruction
Definition at line 176 of file LLVMModule.cpp.
void LLVMModuleSet::dumpModulesToFile | ( | const std::string & | suffix | ) |
Definition at line 1024 of file LLVMModule.cpp.
void LLVMModuleSet::dumpSymTable | ( | ) |
Definition at line 1080 of file LLVMModule.cpp.
|
inline |
Definition at line 387 of file LLVMModule.h.
Definition at line 1546 of file LLVMModule.cpp.
|
inlineprivate |
CallICFGNode * LLVMModuleSet::getCallICFGNode | ( | const Instruction * | cs | ) |
get a call node
Definition at line 1208 of file LLVMModule.cpp.
|
inline |
Definition at line 381 of file LLVMModule.h.
DominatorTree & LLVMModuleSet::getDomTree | ( | const Function * | fun | ) |
Definition at line 99 of file LLVMModule.cpp.
std::string LLVMModuleSet::getExtFuncAnnotation | ( | const Function * | fun, |
const std::string & | funcAnnotation | ||
) |
Definition at line 1495 of file LLVMModule.cpp.
Definition at line 1508 of file LLVMModule.cpp.
Get the corresponding Function based on its name.
Definition at line 306 of file LLVMModule.h.
|
inline |
Definition at line 192 of file LLVMModule.h.
|
inlineprivate |
Get/Add a function entry node.
Definition at line 509 of file LLVMModule.h.
|
inline |
Add a function entry node.
Definition at line 337 of file LLVMModule.h.
|
inline |
Definition at line 178 of file LLVMModule.h.
|
inlineprivate |
Get/Add a function exit node.
Definition at line 518 of file LLVMModule.h.
|
inline |
Add a function exit node.
Definition at line 344 of file LLVMModule.h.
Definition at line 267 of file LLVMModule.h.
Get the corresponding Function based on its name.
Definition at line 1135 of file LLVMModule.cpp.
|
inline |
Definition at line 359 of file LLVMModule.h.
ICFGNode * LLVMModuleSet::getICFGNode | ( | const Instruction * | inst | ) |
Get a basic block ICFGNode.
Definition at line 1181 of file LLVMModule.cpp.
|
inlineprivate |
Definition at line 500 of file LLVMModule.h.
IntraICFGNode * LLVMModuleSet::getIntraICFGNode | ( | const Instruction * | inst | ) |
get a intra node
Definition at line 1226 of file LLVMModule.cpp.
|
private |
Definition at line 401 of file LLVMModule.cpp.
|
inline |
Definition at line 157 of file LLVMModule.h.
|
inlinestatic |
Definition at line 131 of file LLVMModule.h.
Get LLVM Type.
Definition at line 1152 of file LLVMModule.cpp.
Definition at line 260 of file LLVMModule.h.
|
inline |
Definition at line 366 of file LLVMModule.h.
Definition at line 162 of file LLVMModule.h.
|
inline |
Definition at line 152 of file LLVMModule.h.
Definition at line 167 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 1070 of file LLVMModule.cpp.
|
inline |
Definition at line 202 of file LLVMModule.h.
Definition at line 185 of file LLVMModule.h.
|
inlineprivate |
RetICFGNode * LLVMModuleSet::getRetICFGNode | ( | const Instruction * | cs | ) |
get a return node
Definition at line 1217 of file LLVMModule.cpp.
Definition at line 284 of file LLVMModule.h.
|
inline |
Definition at line 298 of file LLVMModule.h.
Get or create SVFType and typeinfo.
Get or create SVFType and typeinfo
Definition at line 1166 of file LLVMModule.cpp.
ObjTypeInference * LLVMModuleSet::getTypeInference | ( | ) |
Definition at line 94 of file LLVMModule.cpp.
Get SVFIR Node according to LLVM value getNode - Return the node corresponding to the specified pointer.
Definition at line 1049 of file LLVMModule.cpp.
|
inline |
Definition at line 197 of file LLVMModule.h.
Definition at line 291 of file LLVMModule.h.
bool LLVMModuleSet::hasExtFuncAnnotation | ( | const Function * | fun, |
const std::string & | funcAnnotation | ||
) |
Definition at line 1482 of file LLVMModule.cpp.
|
inline |
bool LLVMModuleSet::hasICFGNode | ( | const Instruction * | inst | ) |
Definition at line 1195 of file LLVMModule.cpp.
Definition at line 255 of file LLVMModule.h.
Definition at line 1529 of file LLVMModule.cpp.
Definition at line 1540 of file LLVMModule.cpp.
Definition at line 1535 of file LLVMModule.cpp.
Definition at line 1570 of file LLVMModule.cpp.
Definition at line 1517 of file LLVMModule.cpp.
Definition at line 1524 of file LLVMModule.cpp.
Definition at line 1562 of file LLVMModule.cpp.
|
private |
Definition at line 362 of file LLVMModule.cpp.
|
private |
Definition at line 296 of file LLVMModule.cpp.
|
inline |
Definition at line 212 of file LLVMModule.h.
|
private |
Invoke llvm passes to modify module.
Invoke llvm passes to modify module
BreakConstantGEPs Pass
MergeFunctionRets Pass
Definition at line 251 of file LLVMModule.cpp.
|
static |
Definition at line 275 of file LLVMModule.cpp.
|
inlinestatic |
Definition at line 138 of file LLVMModule.h.
|
inline |
Definition at line 274 of file LLVMModule.h.
void LLVMModuleSet::setExtFuncAnnotations | ( | const Function * | fun, |
const std::vector< std::string > & | funcAnnotations | ||
) |
Definition at line 1476 of file LLVMModule.cpp.
|
inlineprivate |
Definition at line 445 of file LLVMModule.h.
|
inlineprivate |
Definition at line 450 of file LLVMModule.h.
|
inline |
Definition at line 207 of file LLVMModule.h.
|
inline |
Definition at line 279 of file LLVMModule.h.
|
friend |
Definition at line 47 of file LLVMModule.h.
|
friend |
Definition at line 46 of file LLVMModule.h.
|
friend |
Definition at line 48 of file LLVMModule.h.
|
private |
map a callsite to its CallICFGNode
Definition at line 106 of file LLVMModule.h.
|
private |
map a callsite to its RetICFGNode
Definition at line 107 of file LLVMModule.h.
|
private |
Record annotations of function in extapi.bc.
Definition at line 91 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 89 of file LLVMModule.h.
Definition at line 94 of file LLVMModule.h.
|
private |
Definition at line 119 of file LLVMModule.h.
|
private |
Definition at line 112 of file LLVMModule.h.
|
private |
Definition at line 120 of file LLVMModule.h.
|
private |
map a function to its FunExitICFGNode
Definition at line 109 of file LLVMModule.h.
|
private |
map a function to its FunEntryICFGNode
Definition at line 110 of file LLVMModule.h.
|
private |
Definition at line 121 of file LLVMModule.h.
|
private |
Global definition to a rep definition map.
Definition at line 97 of file LLVMModule.h.
|
private |
map a basic block to its ICFGNode
Definition at line 108 of file LLVMModule.h.
|
private |
Definition at line 100 of file LLVMModule.h.
|
private |
Map an LLVM Function to an SVF Funobjvar.
Definition at line 99 of file LLVMModule.h.
|
staticprivate |
Definition at line 81 of file LLVMModule.h.
|
private |
Definition at line 101 of file LLVMModule.h.
|
private |
Definition at line 86 of file LLVMModule.h.
|
private |
map a obj reference to its sym id
Definition at line 115 of file LLVMModule.h.
|
private |
Definition at line 84 of file LLVMModule.h.
|
private |
Definition at line 85 of file LLVMModule.h.
Definition at line 82 of file LLVMModule.h.
|
private |
return map
Definition at line 116 of file LLVMModule.h.
|
private |
Definition at line 105 of file LLVMModule.h.
|
private |
Definition at line 83 of file LLVMModule.h.
|
private |
Definition at line 102 of file LLVMModule.h.
|
private |
Definition at line 103 of file LLVMModule.h.
|
private |
map a value to its sym id
Definition at line 114 of file LLVMModule.h.
|
private |
vararg map
Definition at line 117 of file LLVMModule.h.