Skip to content

Commit 8007f90

Browse files
authored
Fix VTA call-graph invocation from HelperAnalyses (#805)
1 parent ad8ff29 commit 8007f90

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ log/*
3333
# MS VS Code
3434
.vscode/
3535

36+
.devcontainer/
37+
3638
# Eclipse
3739
.cproject
3840
.project

include/phasar/ControlFlow/CallGraphAnalysisType.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ enum class CallGraphAnalysisType {
2222
Invalid
2323
};
2424

25+
[[nodiscard]] constexpr bool
26+
needsAliasInfo(CallGraphAnalysisType CGTy) noexcept {
27+
return CGTy == CallGraphAnalysisType::OTF ||
28+
CGTy == CallGraphAnalysisType::VTA;
29+
}
30+
2531
std::string toString(CallGraphAnalysisType CGA);
2632

2733
CallGraphAnalysisType toCallGraphAnalysisType(llvm::StringRef S);

lib/PhasarLLVM/HelperAnalyses.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ LLVMBasedICFG &HelperAnalyses::getICFG() {
9494
} else {
9595
ICF = std::make_unique<LLVMBasedICFG>(
9696
&getProjectIRDB(), CGTy, std::move(EntryPoints), &getTypeHierarchy(),
97-
CGTy == CallGraphAnalysisType::OTF ? &getAliasInfo() : nullptr,
98-
SoundnessLevel, AutoGlobalSupport);
97+
needsAliasInfo(CGTy) ? &getAliasInfo() : nullptr, SoundnessLevel,
98+
AutoGlobalSupport);
9999
}
100100
}
101101

0 commit comments

Comments
 (0)