[be] Fix unused vars in BuildHIR
Lauren Tan committed
Feb 27, 2023 at 17:12 UTC
8bc8d67aeea876d50bc2e546fa01d9c21b8272a9
1 file changed
+9
-12
compiler/forget/src/HIR/BuildHIR.ts
+9
-12
@@ -202,7 +202,7 @@ function lowerStatement(
202
// Block for code following the if
203
const continuationBlock = builder.reserve("block");
204
// Block for the consequent (if the test is truthy)
205
- const consequentBlock = builder.enter("block", (blockId) => {
205
+ const consequentBlock = builder.enter("block", (_blockId) => {
206
lowerStatement(builder, stmt.get("consequent"));
207
return {
208
kind: "goto",
@@ -215,7 +215,7 @@ function lowerStatement(
215
let alternateBlock: BlockId;
216
const alternate = stmt.get("alternate");
217
if (alternate.node != null) {
218
- alternateBlock = builder.enter("block", (blockId) => {
218
+ alternateBlock = builder.enter("block", (_blockId) => {
219
lowerStatement(builder, alternate as NodePath<t.Statement>);
220
return {
221
kind: "goto",
@@ -280,7 +280,7 @@ function lowerStatement(
280
// Block for code following the loop
281
const continuationBlock = builder.reserve("block");
282
283
- const initBlock = builder.enter("loop", (blockId) => {
283
+ const initBlock = builder.enter("loop", (_blockId) => {
284
const init = stmt.get("init");
285
if (!init.isVariableDeclaration()) {
286
builder.errors.push({
@@ -300,7 +300,7 @@ function lowerStatement(
300
};
301
});
302
303
- const updateBlock = builder.enter("loop", (blockId) => {
303
+ const updateBlock = builder.enter("loop", (_blockId) => {
304
const update = stmt.get("update");
305
if (update.node == null) {
306
builder.errors.push({
@@ -319,7 +319,7 @@ function lowerStatement(
319
};
320
});
321
322
- const bodyBlock = builder.enter("block", (blockId) => {
322
+ const bodyBlock = builder.enter("block", (_blockId) => {
323
return builder.loop(label, updateBlock, continuationBlock.id, () => {
324
lowerStatement(builder, stmt.get("body"));
325
return {
@@ -376,7 +376,7 @@ function lowerStatement(
376
// Block for code following the loop
377
const continuationBlock = builder.reserve("block");
378
// Loop body
379
- const loopBlock = builder.enter("block", (blockId) => {
379
+ const loopBlock = builder.enter("block", (_blockId) => {
380
return builder.loop(
381
label,
382
conditionalBlock.id,
@@ -864,10 +864,7 @@ function lowerExpression(
864
return { kind: "UnsupportedNode", node: exprNode, loc: exprLoc };
865
}
866
if (calleePath.isMemberExpression()) {
867
- const { object, property, value } = lowerMemberExpression(
868
- builder,
869
- calleePath
870
- );
867
+ const { object, property } = lowerMemberExpression(builder, calleePath);
868
let args: Place[] = [];
869
for (const argPath of expr.get("arguments")) {
870
if (!argPath.isExpression()) {
@@ -973,7 +970,7 @@ function lowerExpression(
970
const place = buildTemporaryPlace(builder, exprLoc);
971
972
// Block for the consequent (if the test is truthy)
976
- const consequentBlock = builder.enter("value", (blockId) => {
973
+ const consequentBlock = builder.enter("value", (_blockId) => {
974
builder.push({
975
id: makeInstructionId(0),
976
lvalue: { kind: InstructionKind.Reassign, place: { ...place } },
@@ -988,7 +985,7 @@ function lowerExpression(
985
};
986
});
987
// Block for the alternate (if the test is not truthy)
991
- const alternateBlock = builder.enter("value", (blockId) => {
988
+ const alternateBlock = builder.enter("value", (_blockId) => {
989
builder.push({
990
id: makeInstructionId(0),
991
lvalue: { kind: InstructionKind.Reassign, place: { ...place } },