Skip to content

Commit 6c4875b

Browse files
author
Martin Mory
committed
add another constant for __cxa_pure_virtual
1 parent a8f7b78 commit 6c4875b

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

include/phasar/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class LLVMTypeHierarchy
100100

101101
static const std::string TypeInfoPrefixDemang;
102102

103+
static const std::string PureVirtualCallName;
104+
103105
private:
104106
bidigraph_t TypeGraph;
105107
std::unordered_map<const llvm::StructType *, vertex_t> TypeVertexMap;

lib/PhasarLLVM/ControlFlow/Resolver/OTFResolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ auto OTFResolver::resolveVirtualCall(const llvm::CallBase *CallSite)
126126
}
127127
auto *Callee = VFs[VtableIndex];
128128
if (Callee == nullptr || !Callee->hasName() ||
129-
Callee->getName() == "__cxa_pure_virtual") {
129+
Callee->getName() == LLVMTypeHierarchy::PureVirtualCallName) {
130130
continue;
131131
}
132132
PossibleCallTargets.insert(Callee);

lib/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const std::string LLVMTypeHierarchy::TypeInfoPrefix = "_ZTI";
6161

6262
const std::string LLVMTypeHierarchy::TypeInfoPrefixDemang = "typeinfo for ";
6363

64+
const std::string LLVMTypeHierarchy::PureVirtualCallName = "__cxa_pure_virtual";
65+
6466
LLVMTypeHierarchy::VertexProperties::VertexProperties(
6567
const llvm::StructType *Type)
6668
: Type(Type), ReachableTypes({Type}) {}

0 commit comments

Comments
 (0)