|
Static Value-Flow Analysis
|
#include <CHGBuilder.h>
Public Types | |
| typedef CHGraph::CHNodeSetTy | CHNodeSetTy |
| typedef CHGraph::WorkList | WorkList |
Public Member Functions | |
| CHGBuilder (CHGraph *c) | |
| void | buildCHG () |
| void | buildCHGNodes (const GlobalValue *V) |
| void | buildCHGNodes (const Function *F) |
| void | buildCHGEdges (const Function *F) |
| void | buildInternalMaps () |
| void | readInheritanceMetadataFromModule (const Module &M) |
| CHNode * | createNode (const std::string &name) |
| void | connectInheritEdgeViaCall (const Function *caller, const CallBase *cs) |
| void | connectInheritEdgeViaStore (const Function *caller, const StoreInst *store) |
| void | buildClassNameToAncestorsDescendantsMap () |
| const CHGraph::CHNodeSetTy & | getInstancesAndDescendants (const std::string &className) |
| void | analyzeVTables (const Module &M) |
| void | buildVirtualFunctionToIDMap () |
| void | buildCSToCHAVtblsAndVfnsMap () |
| const CHNodeSetTy & | getCSClasses (const CallBase *cs) |
| void | addFuncToFuncVector (CHNode::FuncVector &v, const Function *f) |
Private Member Functions | |
| LLVMModuleSet * | llvmModuleSet () |
Private Attributes | |
| CHGraph * | chg |
Definition at line 38 of file CHGBuilder.h.
Definition at line 45 of file CHGBuilder.h.
Definition at line 46 of file CHGBuilder.h.
|
inline |
Definition at line 48 of file CHGBuilder.h.
| void CHGBuilder::addFuncToFuncVector | ( | CHNode::FuncVector & | v, |
| const Function * | f ) |
Definition at line 751 of file CHGBuilder.cpp.
| void CHGBuilder::analyzeVTables | ( | const Module & | M | ) |
vtable in llvm 16 does not have bitcast: e.g., @_ZTV1B = linkonce_odr dso_local unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr @_ZTI1B, ptr @_ZN1B1fEPi, ptr @_ZN1B1gEPi] }, comdat, align 8 compared to its llvm 13 version: @_ZTV1B = linkonce_odr dso_local unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1B to i8*), i8* bitcast (void (class.B*, i32*)* @_ZN1B1fEPi to i8*), i8* bitcast (void (class.B*, i32*)* @_ZN1B1gEPi to i8*)] }, comdat, align 8
For llvm 13, we need to cast the operand into a constant expr and then process the first operand of that constant expr For llvm 16, things get simpler. We can directly process each operand
for inttoptr in llvm 16, the handling method is the same as before
Definition at line 373 of file CHGBuilder.cpp.
| void CHGBuilder::buildCHG | ( | ) |
Definition at line 62 of file CHGBuilder.cpp.
| void CHGBuilder::buildCHGEdges | ( | const Function * | F | ) |
Definition at line 139 of file CHGBuilder.cpp.
| void CHGBuilder::buildCHGNodes | ( | const Function * | F | ) |
Definition at line 128 of file CHGBuilder.cpp.
| void CHGBuilder::buildCHGNodes | ( | const GlobalValue * | V | ) |
Definition at line 92 of file CHGBuilder.cpp.
| void CHGBuilder::buildClassNameToAncestorsDescendantsMap | ( | ) |
Definition at line 274 of file CHGBuilder.cpp.
| void CHGBuilder::buildCSToCHAVtblsAndVfnsMap | ( | ) |
Definition at line 670 of file CHGBuilder.cpp.
| void CHGBuilder::buildInternalMaps | ( | ) |
Definition at line 161 of file CHGBuilder.cpp.
| void CHGBuilder::buildVirtualFunctionToIDMap | ( | ) |
Definition at line 571 of file CHGBuilder.cpp.
Definition at line 168 of file CHGBuilder.cpp.
Definition at line 199 of file CHGBuilder.cpp.
| CHNode * CHGBuilder::createNode | ( | const std::string & | name | ) |
Definition at line 247 of file CHGBuilder.cpp.
| const CHGraph::CHNodeSetTy & CHGBuilder::getCSClasses | ( | const CallBase * | cs | ) |
Definition at line 712 of file CHGBuilder.cpp.
| const CHGraph::CHNodeSetTy & CHGBuilder::getInstancesAndDescendants | ( | const std::string & | className | ) |
Definition at line 307 of file CHGBuilder.cpp.
|
private |
Definition at line 57 of file CHGBuilder.cpp.
| void CHGBuilder::readInheritanceMetadataFromModule | ( | const Module & | M | ) |
Definition at line 226 of file CHGBuilder.cpp.
|
private |
Definition at line 42 of file CHGBuilder.h.