Static Value-Flow Analysis
|
#include <LLVMModule.h>
Static Public Member Functions | |
static LLVMModuleSet * | getLLVMModuleSet () |
static void | releaseLLVMModuleSet () |
static SVFModule * | buildSVFModule (Module &mod) |
static SVFModule * | 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 |
Definition at line 44 of file LLVMModule.h.
Definition at line 69 of file LLVMModule.h.
Definition at line 70 of file LLVMModule.h.
typedef Map<std::string, std::vector<std::string> > SVF::LLVMModuleSet::Fun2AnnoMap |
Definition at line 67 of file LLVMModule.h.
typedef std::vector<const Function*> SVF::LLVMModuleSet::FunctionSetType |
Definition at line 51 of file LLVMModule.h.
Definition at line 52 of file LLVMModule.h.
Definition at line 53 of file LLVMModule.h.
Definition at line 72 of file LLVMModule.h.
Definition at line 73 of file LLVMModule.h.
Definition at line 54 of file LLVMModule.h.
Definition at line 71 of file LLVMModule.h.
Definition at line 60 of file LLVMModule.h.
Definition at line 58 of file LLVMModule.h.
Definition at line 61 of file LLVMModule.h.
Definition at line 57 of file LLVMModule.h.
Definition at line 56 of file LLVMModule.h.
Definition at line 59 of file LLVMModule.h.
Definition at line 65 of file LLVMModule.h.
Definition at line 62 of file LLVMModule.h.
Definition at line 64 of file LLVMModule.h.
Definition at line 63 of file LLVMModule.h.
Definition at line 66 of file LLVMModule.h.
|
private |
Constructor.
Definition at line 80 of file LLVMModule.cpp.
LLVMModuleSet::~LLVMModuleSet | ( | ) |
Definition at line 86 of file LLVMModule.cpp.
|
inline |
Definition at line 206 of file LLVMModule.h.
|
inline |
Definition at line 180 of file LLVMModule.h.
|
inline |
Definition at line 221 of file LLVMModule.h.
void LLVMModuleSet::addFunctionMap | ( | const Function * | func, |
CallGraphNode * | svfFunc | ||
) |
Definition at line 1223 of file LLVMModule.cpp.
|
inline |
Definition at line 172 of file LLVMModule.h.
|
inline |
Definition at line 211 of file LLVMModule.h.
|
inline |
Definition at line 190 of file LLVMModule.h.
|
inline |
Definition at line 200 of file LLVMModule.h.
|
inline |
Definition at line 195 of file LLVMModule.h.
|
inline |
Definition at line 185 of file LLVMModule.h.
|
inline |
Definition at line 226 of file LLVMModule.h.
|
inline |
Definition at line 231 of file LLVMModule.h.
|
private |
Definition at line 724 of file LLVMModule.cpp.
Create SVFTypes.
Definition at line 1500 of file LLVMModule.cpp.
|
private |
Definition at line 1257 of file LLVMModule.cpp.
|
private |
Definition at line 168 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 886 of file LLVMModule.cpp.
|
private |
Definition at line 1155 of file LLVMModule.cpp.
|
static |
Definition at line 128 of file LLVMModule.cpp.
Definition at line 111 of file LLVMModule.cpp.
|
private |
building symbol table
Definition at line 153 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 1562 of file LLVMModule.cpp.
Non-opaque pointer
Opaque pointer
Definition at line 818 of file LLVMModule.cpp.
Collect simple type (non-aggregate) info.
Collect simple type (non-aggregate) info
Only one field
Definition at line 1682 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 1625 of file LLVMModule.cpp.
Collect a type info.
Definition at line 1468 of file LLVMModule.cpp.
|
private |
Function
then traverse candidate sets
GlobalVariable
GlobalAlias
GlobalIFunc
Definition at line 202 of file LLVMModule.cpp.
Definition at line 275 of file LLVMModule.cpp.
void LLVMModuleSet::dumpModulesToFile | ( | const std::string & | suffix | ) |
Definition at line 1198 of file LLVMModule.cpp.
|
inline |
Definition at line 385 of file LLVMModule.h.
|
inlineprivate |
|
inline |
Definition at line 253 of file LLVMModule.h.
CallICFGNode * LLVMModuleSet::getCallICFGNode | ( | const Instruction * | cs | ) |
get a call node
Definition at line 1443 of file LLVMModule.cpp.
|
inline |
Definition at line 379 of file LLVMModule.h.
DominatorTree & LLVMModuleSet::getDomTree | ( | const Function * | fun | ) |
Definition at line 102 of file LLVMModule.cpp.
|
inlineprivate |
Get/Add a function entry node.
Definition at line 464 of file LLVMModule.h.
|
inline |
Add a function entry node.
Definition at line 335 of file LLVMModule.h.
|
inlineprivate |
Get/Add a function exit node.
Definition at line 473 of file LLVMModule.h.
|
inline |
Add a function exit node.
Definition at line 342 of file LLVMModule.h.
|
inline |
Definition at line 357 of file LLVMModule.h.
|
inline |
Definition at line 397 of file LLVMModule.h.
ICFGNode * LLVMModuleSet::getICFGNode | ( | const Instruction * | inst | ) |
Get a basic block ICFGNode.
Definition at line 1416 of file LLVMModule.cpp.
|
inlineprivate |
Definition at line 455 of file LLVMModule.h.
IntraICFGNode * LLVMModuleSet::getIntraICFGNode | ( | const Instruction * | inst | ) |
get a intra node
Definition at line 1461 of file LLVMModule.cpp.
|
private |
Definition at line 635 of file LLVMModule.cpp.
|
inline |
Definition at line 153 of file LLVMModule.h.
|
inlinestatic |
Definition at line 122 of file LLVMModule.h.
Get LLVM Type.
Definition at line 1387 of file LLVMModule.cpp.
|
inline |
Definition at line 246 of file LLVMModule.h.
Definition at line 239 of file LLVMModule.h.
|
inline |
Definition at line 364 of file LLVMModule.h.
Definition at line 158 of file LLVMModule.h.
|
inline |
Definition at line 148 of file LLVMModule.h.
Definition at line 163 of file LLVMModule.h.
SVFConstant * LLVMModuleSet::getOtherSVFConstant | ( | const Constant * | oc | ) |
Definition at line 1329 of file LLVMModule.cpp.
|
inlineprivate |
RetICFGNode * LLVMModuleSet::getRetICFGNode | ( | const Instruction * | cs | ) |
get a return node
Definition at line 1452 of file LLVMModule.cpp.
|
inline |
Definition at line 281 of file LLVMModule.h.
|
inline |
Definition at line 267 of file LLVMModule.h.
SVFConstantData * LLVMModuleSet::getSVFConstantData | ( | const ConstantData * | cd | ) |
bitwidth == 1 : cint has value from getZExtValue() because bool true
will be translated to -1 using sign extension (i.e., getSExtValue). bitwidth <=64 1 : cint has value from getSExtValue() bitwidth >64 1 : cint has value 0 because it represents an invalid int
Definition at line 1264 of file LLVMModule.cpp.
|
inline |
Definition at line 260 of file LLVMModule.h.
|
inline |
Get the corresponding Function based on its name.
Definition at line 307 of file LLVMModule.h.
|
inline |
Definition at line 288 of file LLVMModule.h.
|
inline |
Definition at line 274 of file LLVMModule.h.
|
inline |
Definition at line 141 of file LLVMModule.h.
SVFOtherValue * LLVMModuleSet::getSVFOtherValue | ( | const Value * | ov | ) |
Definition at line 1345 of file LLVMModule.cpp.
Get or create SVFType and typeinfo.
Get or create SVFType and typeinfo
Definition at line 1401 of file LLVMModule.cpp.
Definition at line 1364 of file LLVMModule.cpp.
ObjTypeInference * LLVMModuleSet::getTypeInference | ( | ) |
Definition at line 97 of file LLVMModule.cpp.
|
inline |
bool LLVMModuleSet::hasICFGNode | ( | const Instruction * | inst | ) |
Definition at line 1430 of file LLVMModule.cpp.
|
private |
Definition at line 414 of file LLVMModule.cpp.
set exit block: exit basic block must have no successors and have a return instruction
Definition at line 346 of file LLVMModule.cpp.
|
private |
Function
Definition at line 328 of file LLVMModule.cpp.
|
private |
Definition at line 596 of file LLVMModule.cpp.
|
private |
Definition at line 531 of file LLVMModule.cpp.
|
private |
Invoke llvm passes to modify module.
Invoke llvm passes to modify module
BreakConstantGEPs Pass
MergeFunctionRets Pass
Definition at line 486 of file LLVMModule.cpp.
|
static |
Definition at line 510 of file LLVMModule.cpp.
|
inlinestatic |
Definition at line 129 of file LLVMModule.h.
Definition at line 1229 of file LLVMModule.cpp.
|
friend |
Definition at line 47 of file LLVMModule.h.
|
friend |
Definition at line 46 of file LLVMModule.h.
|
private |
Definition at line 110 of file LLVMModule.h.
|
private |
map a callsite to its CallICFGNode
Definition at line 105 of file LLVMModule.h.
|
private |
map a callsite to its RetICFGNode
Definition at line 106 of file LLVMModule.h.
|
private |
Record annotations of function in extapi.bc.
Definition at line 88 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 86 of file LLVMModule.h.
|
private |
Definition at line 112 of file LLVMModule.h.
|
private |
map a function to its FunExitICFGNode
Definition at line 108 of file LLVMModule.h.
|
private |
map a function to its FunEntryICFGNode
Definition at line 109 of file LLVMModule.h.
|
private |
Global definition to a rep definition map.
Definition at line 90 of file LLVMModule.h.
|
private |
Definition at line 80 of file LLVMModule.h.
|
private |
map a basic block to its ICFGNode
Definition at line 107 of file LLVMModule.h.
|
private |
Definition at line 96 of file LLVMModule.h.
|
private |
Definition at line 94 of file LLVMModule.h.
|
private |
Definition at line 97 of file LLVMModule.h.
|
private |
Map an LLVM Function to an CallGraph Node.
Definition at line 93 of file LLVMModule.h.
|
private |
Map an LLVM Function to an SVF Function.
Definition at line 92 of file LLVMModule.h.
|
private |
Definition at line 95 of file LLVMModule.h.
|
staticprivate |
Definition at line 76 of file LLVMModule.h.
|
private |
Definition at line 100 of file LLVMModule.h.
|
private |
Definition at line 98 of file LLVMModule.h.
|
private |
Definition at line 83 of file LLVMModule.h.
|
private |
Definition at line 81 of file LLVMModule.h.
|
private |
Definition at line 82 of file LLVMModule.h.
Definition at line 77 of file LLVMModule.h.
|
private |
Definition at line 104 of file LLVMModule.h.
|
private |
Borrowed from singleton SVFModule::svfModule.
Definition at line 79 of file LLVMModule.h.
|
private |
Definition at line 99 of file LLVMModule.h.
|
private |
Definition at line 78 of file LLVMModule.h.
|
private |
Definition at line 101 of file LLVMModule.h.
|
private |
Definition at line 102 of file LLVMModule.h.