Skip to content

Commit f8e0996

Browse files
MMoryvulder
andauthored
Apply @vulder suggestions from code review
Co-authored-by: Florian Sattler <vuld3r@gmail.com>
1 parent 107e2e2 commit f8e0996

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/PhasarLLVM/ControlFlow/LLVMBasedBackwardICFG.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,18 @@ LLVMBasedBackwardsICFG::getPredsOf(const llvm::Instruction *Stmt) const {
116116
}
117117
auto ExitPoints =
118118
LLVMBasedBackwardCFG::getExitPointsOf(BackwardRetIt->second);
119-
std::vector<const llvm::Instruction *> Result(ExitPoints.begin(),
120-
ExitPoints.end());
121-
return Result;
119+
return {ExitPoints.begin(), ExitPoints.end()};
122120
}
123121

124122
std::vector<const llvm::Instruction *>
125123
LLVMBasedBackwardsICFG::getSuccsOf(const llvm::Instruction *Stmt) const {
126-
if (Stmt->getParent() == nullptr && BackwardRetToFunction.count(Stmt) > 0) {
124+
if (isExitInst(Stmt)) {
127125
return {};
128126
}
129127
std::vector<const llvm::Instruction *> Succs =
130128
LLVMBasedBackwardCFG::getSuccsOf(Stmt);
131129
if (Succs.size() == 0) {
130+
assert(Stmt->getParent()->getParent() && "Could not find parent of stmt's parent ");
132131
Succs.push_back(
133132
BackwardRets.at(Stmt->getParent()->getParent()).getInstance());
134133
}

0 commit comments

Comments
 (0)