@@ -993,14 +993,14 @@ struct TransformDFA {
993
993
SmallPtrSet<BasicBlock *, 16 > BlocksToClean;
994
994
BlocksToClean.insert_range (successors (SwitchBlock));
995
995
996
- for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ()) {
996
+ for (const ThreadingPath &TPath : SwitchPaths->getThreadingPaths ()) {
997
997
createExitPath (NewDefs, TPath, DuplicateMap, BlocksToClean, &DTU);
998
998
NumPaths++;
999
999
}
1000
1000
1001
1001
// After all paths are cloned, now update the last successor of the cloned
1002
1002
// path so it skips over the switch statement
1003
- for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ())
1003
+ for (const ThreadingPath &TPath : SwitchPaths->getThreadingPaths ())
1004
1004
updateLastSuccessor (TPath, DuplicateMap, &DTU);
1005
1005
1006
1006
// For each instruction that was cloned and used outside, update its uses
@@ -1017,7 +1017,7 @@ struct TransformDFA {
1017
1017
// / To remember the correct destination, we have to duplicate blocks
1018
1018
// / corresponding to each state. Also update the terminating instruction of
1019
1019
// / the predecessors, and phis in the successor blocks.
1020
- void createExitPath (DefMap &NewDefs, ThreadingPath &Path,
1020
+ void createExitPath (DefMap &NewDefs, const ThreadingPath &Path,
1021
1021
DuplicateBlockMap &DuplicateMap,
1022
1022
SmallPtrSet<BasicBlock *, 16 > &BlocksToClean,
1023
1023
DomTreeUpdater *DTU) {
@@ -1263,7 +1263,7 @@ struct TransformDFA {
1263
1263
// /
1264
1264
// / Note that this is an optional step and would have been done in later
1265
1265
// / optimizations, but it makes the CFG significantly easier to work with.
1266
- void updateLastSuccessor (ThreadingPath &TPath,
1266
+ void updateLastSuccessor (const ThreadingPath &TPath,
1267
1267
DuplicateBlockMap &DuplicateMap,
1268
1268
DomTreeUpdater *DTU) {
1269
1269
APInt NextState = TPath.getExitValue ();
0 commit comments