Commit 68346eb3 authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[compiler] Fix -Wshadow in raw-machine-assembler.cc

Bug: v8:12244,v8:12245
Change-Id: Ib2e00ec2164b4f19508731d7aadf50114c6cd06a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3200403Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77224}
parent 98a903df
......@@ -190,12 +190,12 @@ void RawMachineAssembler::OptimizeControlFlow(Schedule* schedule, Graph* graph,
false_block->ClearPredecessors();
size_t arity = block->PredecessorCount();
for (size_t i = 0; i < arity; ++i) {
BasicBlock* predecessor = block->PredecessorAt(i);
for (size_t j = 0; j < arity; ++j) {
BasicBlock* predecessor = block->PredecessorAt(j);
predecessor->ClearSuccessors();
if (block->deferred()) predecessor->set_deferred(true);
Node* branch_clone = graph->CloneNode(branch);
int phi_input = static_cast<int>(i);
int phi_input = static_cast<int>(j);
NodeProperties::ReplaceValueInput(
branch_clone, NodeProperties::GetValueInput(phi, phi_input), 0);
BasicBlock* new_true_block = schedule->NewBasicBlock();
......@@ -571,14 +571,14 @@ void RawMachineAssembler::Switch(Node* index, RawMachineLabel* default_label,
size_t succ_count = case_count + 1;
Node* switch_node = MakeNode(common()->Switch(succ_count), 1, &index);
BasicBlock** succ_blocks = zone()->NewArray<BasicBlock*>(succ_count);
for (size_t index = 0; index < case_count; ++index) {
int32_t case_value = case_values[index];
for (size_t i = 0; i < case_count; ++i) {
int32_t case_value = case_values[i];
BasicBlock* case_block = schedule()->NewBasicBlock();
Node* case_node =
graph()->NewNode(common()->IfValue(case_value), switch_node);
schedule()->AddNode(case_block, case_node);
schedule()->AddGoto(case_block, Use(case_labels[index]));
succ_blocks[index] = case_block;
schedule()->AddGoto(case_block, Use(case_labels[i]));
succ_blocks[i] = case_block;
}
BasicBlock* default_block = schedule()->NewBasicBlock();
Node* default_node = graph()->NewNode(common()->IfDefault(), switch_node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment