Delete old CompilerError module
This was a carryover from the old architecture; we can remove it now to get rid of the indirection.
Lauren Tan committed
Jan 12, 2023 at 19:35 UTC
325987d744ed992a7147dba78a89d8ea80e0e85d
12 files changed
+12
-32
compiler/forget/src/HIR/BuildHIR.ts
+1
-1
@@ -7,7 +7,7 @@
7
8
import { NodePath, Scope } from "@babel/traverse";
9
import * as t from "@babel/types";
10
-import { invariant } from "../Utils/CompilerError";
10
+import invariant from "invariant";
11
import todo, { todoInvariant } from "../Utils/todo";
12
import { assertExhaustive } from "../Utils/utils";
13
import {
compiler/forget/src/HIR/HIR.ts
+1
-1
@@ -6,7 +6,7 @@
6
*/
7
8
import * as t from "@babel/types";
9
-import { invariant } from "../Utils/CompilerError";
9
+import invariant from "invariant";
10
11
// *******************************************************************************************
12
// *******************************************************************************************
compiler/forget/src/HIR/HIRBuilder.ts
+1
-1
@@ -6,7 +6,7 @@
6
*/
7
8
import * as t from "@babel/types";
9
-import { invariant } from "../Utils/CompilerError";
9
+import invariant from "invariant";
10
import { logHIR } from "../Utils/logger";
11
import { assertExhaustive } from "../Utils/utils";
12
import {
compiler/forget/src/HIR/MergeConsecutiveBlocks.ts
+1
-1
@@ -5,7 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
-import { invariant } from "../Utils/CompilerError";
8
+import invariant from "invariant";
9
import {
10
BlockId,
11
Effect,
compiler/forget/src/Inference/InferReferenceEffects.ts
+2
-2
@@ -5,8 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
-import { invariant } from "../Utils/CompilerError";
9
-import { assertExhaustive } from "../Utils/utils";
8
+import invariant from "invariant";
9
import {
10
BasicBlock,
11
BlockId,
@@ -29,6 +28,7 @@ import {
28
eachTerminalOperand,
29
eachTerminalSuccessor,
30
} from "../HIR/visitors";
31
+import { assertExhaustive } from "../Utils/utils";
32
33
/**
34
* For every usage of a value in the given function, infers the effect or action
compiler/forget/src/ReactiveScopes/AlignReactiveScopesToBlockScopes.ts
+1
-1
@@ -5,6 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
+import invariant from "invariant";
9
import {
10
InstructionId,
11
makeInstructionId,
@@ -14,7 +15,6 @@ import {
15
ReactiveValueBlock,
16
ScopeId,
17
} from "../HIR/HIR";
17
-import { invariant } from "../Utils/CompilerError";
18
import { getInstructionScope, getPlaceScope } from "./BuildReactiveBlocks";
19
import { eachTerminalBlock, eachTerminalOperand } from "./visitors";
20
compiler/forget/src/ReactiveScopes/MergeOverlappingReactiveScopes.ts
+1
-1
@@ -5,6 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
+import invariant from "invariant";
9
import {
10
InstructionId,
11
InstructionValue,
@@ -17,7 +18,6 @@ import {
18
ScopeId,
19
} from "../HIR";
20
import { eachInstructionValueOperand } from "../HIR/visitors";
20
-import { invariant } from "../Utils/CompilerError";
21
import DisjointSet from "../Utils/DisjointSet";
22
import { retainWhere } from "../Utils/utils";
23
import { getPlaceScope } from "./BuildReactiveBlocks";
compiler/forget/src/ReactiveScopes/PrintReactiveFunction.ts
+1
-1
@@ -5,6 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
+import invariant from "invariant";
9
import {
10
ReactiveFunction,
11
ReactiveScopeBlock,
@@ -19,7 +20,6 @@ import {
20
printInstructionValue,
21
printPlace,
22
} from "../HIR/PrintHIR";
22
-import { invariant } from "../Utils/CompilerError";
23
import { assertExhaustive } from "../Utils/utils";
24
25
export function printReactiveFunction(fn: ReactiveFunction): string {
compiler/forget/src/ReactiveScopes/RenameVariables.ts
+1
-1
@@ -5,6 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
+import invariant from "invariant";
9
import {
10
Identifier,
11
IdentifierId,
@@ -14,7 +15,6 @@ import {
15
ReactiveValueBlock,
16
} from "../HIR/HIR";
17
import { eachInstructionValueOperand } from "../HIR/visitors";
17
-import { invariant } from "../Utils/CompilerError";
18
import { assertExhaustive } from "../Utils/utils";
19
20
/**
compiler/forget/src/SSA/EnterSSA.ts
+1
-1
@@ -1,3 +1,4 @@
1
+import invariant from "invariant";
2
import {
3
BasicBlock,
4
BlockId,
@@ -17,7 +18,6 @@ import {
18
mapInstructionOperands,
19
mapTerminalOperands,
20
} from "../HIR/visitors";
20
-import { invariant } from "../Utils/CompilerError";
21
22
type IncompletePhi = {
23
oldId: Identifier;
compiler/forget/src/Utils/CompilerError.ts
deleted
-20
@@ -1,20 +0,0 @@
1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
-import invariant from "invariant";
9
-
10
-// Record a bailout if there is an invariant violation and a recently created compiler context.
11
-// Otherwise, just throws a regular invariant.
12
-function compilerInvariant(
13
- condition: unknown,
14
- format: string,
15
- ...args: any[]
16
-): asserts condition {
17
- return invariant(condition, format, ...args);
18
-}
19
-
20
-export { compilerInvariant as invariant };
compiler/forget/src/Utils/DisjointSet.ts
+1
-1
@@ -5,7 +5,7 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
-import { invariant } from "./CompilerError";
8
+import invariant from "invariant";
9
10
/**
11
* Represents items which form disjoint sets.