|
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 741 of file CHGBuilder.cpp.
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 369 of file CHGBuilder.cpp.
| void CHGBuilder::buildCHG | ( | ) |
Definition at line 64 of file CHGBuilder.cpp.
Definition at line 135 of file CHGBuilder.cpp.
Definition at line 124 of file CHGBuilder.cpp.
| void CHGBuilder::buildCHGNodes | ( | const GlobalValue * | V | ) |
Definition at line 94 of file CHGBuilder.cpp.
| void CHGBuilder::buildClassNameToAncestorsDescendantsMap | ( | ) |
Definition at line 270 of file CHGBuilder.cpp.
| void CHGBuilder::buildCSToCHAVtblsAndVfnsMap | ( | ) |
Definition at line 660 of file CHGBuilder.cpp.
| void CHGBuilder::buildInternalMaps | ( | ) |
Definition at line 157 of file CHGBuilder.cpp.
| void CHGBuilder::buildVirtualFunctionToIDMap | ( | ) |
Definition at line 561 of file CHGBuilder.cpp.
Definition at line 164 of file CHGBuilder.cpp.
Definition at line 195 of file CHGBuilder.cpp.
Definition at line 243 of file CHGBuilder.cpp.
| const CHGraph::CHNodeSetTy & CHGBuilder::getCSClasses | ( | const CallBase * | cs | ) |
Definition at line 702 of file CHGBuilder.cpp.
| const CHGraph::CHNodeSetTy & CHGBuilder::getInstancesAndDescendants | ( | const std::string & | className | ) |
Definition at line 303 of file CHGBuilder.cpp.
|
private |
Definition at line 59 of file CHGBuilder.cpp.
Definition at line 222 of file CHGBuilder.cpp.
|
private |
Definition at line 42 of file CHGBuilder.h.