summaryrefslogtreecommitdiff
path: root/src/passes/SpillPointers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/SpillPointers.cpp')
-rw-r--r--src/passes/SpillPointers.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/passes/SpillPointers.cpp b/src/passes/SpillPointers.cpp
index 75fa72652..6c194eb60 100644
--- a/src/passes/SpillPointers.cpp
+++ b/src/passes/SpillPointers.cpp
@@ -50,8 +50,9 @@ struct SpillPointers
// note calls in basic blocks
template<typename T> void visitSpillable(T* curr) {
// if in unreachable code, ignore
- if (!currBasicBlock)
+ if (!currBasicBlock) {
return;
+ }
auto* pointer = getCurrentPointer();
currBasicBlock->contents.actions.emplace_back(pointer);
// starts out as correct, may change later
@@ -85,8 +86,9 @@ struct SpillPointers
bool spilled = false;
Index spillLocal = -1;
for (auto& curr : basicBlocks) {
- if (liveBlocks.count(curr.get()) == 0)
+ if (liveBlocks.count(curr.get()) == 0) {
continue; // ignore dead blocks
+ }
auto& liveness = curr->contents;
auto& actions = liveness.actions;
Index lastCall = -1;
@@ -96,8 +98,9 @@ struct SpillPointers
lastCall = i;
}
}
- if (lastCall == Index(-1))
+ if (lastCall == Index(-1)) {
continue; // nothing to see here
+ }
// scan through the block, spilling around the calls
// TODO: we can filter on pointerMap everywhere
LocalSet live = liveness.end;
@@ -149,8 +152,9 @@ struct SpillPointers
Function* func,
Module* module) {
auto* call = *origin;
- if (call->type == unreachable)
+ if (call->type == unreachable) {
return; // the call is never reached anyhow, ignore
+ }
Builder builder(*module);
auto* block = builder.makeBlock();
// move the operands into locals, as we must spill after they are executed