summaryrefslogtreecommitdiff
path: root/src/passes/GlobalRefining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/GlobalRefining.cpp')
-rw-r--r--src/passes/GlobalRefining.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/passes/GlobalRefining.cpp b/src/passes/GlobalRefining.cpp
index 0576e3285..67a186f92 100644
--- a/src/passes/GlobalRefining.cpp
+++ b/src/passes/GlobalRefining.cpp
@@ -59,7 +59,7 @@ struct GlobalRefining : public Pass {
// Combine all the information we gathered and compute lubs.
for (auto& [func, info] : analysis.map) {
for (auto* set : info.sets) {
- lubs[set->name].noteUpdatableExpression(set->value);
+ lubs[set->name].note(set->value->type);
}
}
@@ -73,7 +73,7 @@ struct GlobalRefining : public Pass {
auto& lub = lubs[global->name];
// Note the initial value.
- lub.noteUpdatableExpression(global->init);
+ lub.note(global->init->type);
// The initial value cannot be unreachable, but it might be null, and all
// other values might be too. In that case, we've noted nothing useful
@@ -83,12 +83,11 @@ struct GlobalRefining : public Pass {
}
auto oldType = global->type;
- auto newType = lub.getBestPossible();
+ auto newType = lub.getLUB();
if (newType != oldType) {
// We found an improvement!
assert(Type::isSubType(newType, oldType));
global->type = newType;
- lub.updateNulls();
optimized = true;
}
}