HomePhabricator

[ScopBuilder] Simplify main statement flag in buildEqivClassBlockStmts. NFC.

Description

[ScopBuilder] Simplify main statement flag in buildEqivClassBlockStmts. NFC.

When reading code in ScopBuilder::buildEqivClassBlockStmts, I think the
main statement flag computation can be simplified, here is the patch.
It's based on two simple facts that:

  1. Instruction won't be removed once it's inserted into UnionFind.
  2. Main statement must be set if there is non-trivial statement besides the last one.

The patch also saves std::find call.

Patch by bin.narwal <bin.narwal@gmail.com>

Differential Revision: https://reviews.llvm.org/D66477

Details

Committed
MeinersburAug 26 2019, 2:31 PM
Differential Revision
D66477: Simplify main statement flag in ScopBuilder::buildEqivClassBlockStmts
Parents
rL369971: Revert r369843 "[Testing] Unbreak r369830"
Branches
Unknown
Tags
Unknown