Skip to content

Commit a81b6c6

Browse files
authored
[DFAJumpThreading][NFC] Replace with const reference (llvm#162238)
1 parent 18edd41 commit a81b6c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,14 +993,14 @@ struct TransformDFA {
993993
SmallPtrSet<BasicBlock *, 16> BlocksToClean;
994994
BlocksToClean.insert_range(successors(SwitchBlock));
995995

996-
for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths()) {
996+
for (const ThreadingPath &TPath : SwitchPaths->getThreadingPaths()) {
997997
createExitPath(NewDefs, TPath, DuplicateMap, BlocksToClean, &DTU);
998998
NumPaths++;
999999
}
10001000

10011001
// After all paths are cloned, now update the last successor of the cloned
10021002
// path so it skips over the switch statement
1003-
for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths())
1003+
for (const ThreadingPath &TPath : SwitchPaths->getThreadingPaths())
10041004
updateLastSuccessor(TPath, DuplicateMap, &DTU);
10051005

10061006
// For each instruction that was cloned and used outside, update its uses
@@ -1017,7 +1017,7 @@ struct TransformDFA {
10171017
/// To remember the correct destination, we have to duplicate blocks
10181018
/// corresponding to each state. Also update the terminating instruction of
10191019
/// the predecessors, and phis in the successor blocks.
1020-
void createExitPath(DefMap &NewDefs, ThreadingPath &Path,
1020+
void createExitPath(DefMap &NewDefs, const ThreadingPath &Path,
10211021
DuplicateBlockMap &DuplicateMap,
10221022
SmallPtrSet<BasicBlock *, 16> &BlocksToClean,
10231023
DomTreeUpdater *DTU) {
@@ -1263,7 +1263,7 @@ struct TransformDFA {
12631263
///
12641264
/// Note that this is an optional step and would have been done in later
12651265
/// optimizations, but it makes the CFG significantly easier to work with.
1266-
void updateLastSuccessor(ThreadingPath &TPath,
1266+
void updateLastSuccessor(const ThreadingPath &TPath,
12671267
DuplicateBlockMap &DuplicateMap,
12681268
DomTreeUpdater *DTU) {
12691269
APInt NextState = TPath.getExitValue();

0 commit comments

Comments
 (0)