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 740 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 367 of file CHGBuilder.cpp.
void CHGBuilder::buildCHG | ( | ) |
Definition at line 65 of file CHGBuilder.cpp.
Definition at line 136 of file CHGBuilder.cpp.
Definition at line 125 of file CHGBuilder.cpp.
void CHGBuilder::buildCHGNodes | ( | const GlobalValue * | V | ) |
Definition at line 95 of file CHGBuilder.cpp.
void CHGBuilder::buildClassNameToAncestorsDescendantsMap | ( | ) |
Definition at line 268 of file CHGBuilder.cpp.
void CHGBuilder::buildCSToCHAVtblsAndVfnsMap | ( | ) |
Definition at line 659 of file CHGBuilder.cpp.
void CHGBuilder::buildInternalMaps | ( | ) |
Definition at line 158 of file CHGBuilder.cpp.
void CHGBuilder::buildVirtualFunctionToIDMap | ( | ) |
Definition at line 560 of file CHGBuilder.cpp.
Definition at line 165 of file CHGBuilder.cpp.
Definition at line 193 of file CHGBuilder.cpp.
Definition at line 241 of file CHGBuilder.cpp.
const CHGraph::CHNodeSetTy & CHGBuilder::getCSClasses | ( | const CallBase * | cs | ) |
Definition at line 701 of file CHGBuilder.cpp.
const CHGraph::CHNodeSetTy & CHGBuilder::getInstancesAndDescendants | ( | const std::string & | className | ) |
Definition at line 301 of file CHGBuilder.cpp.
|
private |
Definition at line 60 of file CHGBuilder.cpp.
Definition at line 220 of file CHGBuilder.cpp.
|
private |
Definition at line 42 of file CHGBuilder.h.