Skip to content

Commit

Permalink
[clang][dataflow] Include terminator statements in buildStmtToBasicBl…
Browse files Browse the repository at this point in the history
…ockMap

This will be necessary later when we add support for evaluating logic
expressions such as && and ||.

This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D119447
  • Loading branch information
sgatev committed Feb 11, 2022
1 parent ef4d111 commit 87c32be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp
Expand Up @@ -38,6 +38,8 @@ buildStmtToBasicBlockMap(const CFG &Cfg) {

StmtToBlock[Stmt.getValue().getStmt()] = Block;
}
if (const Stmt *TerminatorStmt = Block->getTerminatorStmt())
StmtToBlock[TerminatorStmt] = Block;
}
return StmtToBlock;
}
Expand Down

0 comments on commit 87c32be

Please sign in to comment.