mv src/HIR/Pipeline src/CompilerPipeline
Small reorganization to move Pipeline out of HIR since it's a compiler module. It used to make sense before to be in HIR since the old architecture was the still the primary, but no longer!
Lauren Tan committed
Dec 20, 2022 at 11:13 UTC
9390e969e21d68ea109fdf55f7b0db6e7d65b742
6 files changed
+62
-21
compiler/forget/src/Babel/BabelPlugin.ts
+1
-1
@@ -10,7 +10,7 @@
10
import type * as BabelCore from "@babel/core";
11
import type { PluginObj } from "@babel/core";
12
import jsx from "@babel/plugin-syntax-jsx";
13
-import Pipeline from "../HIR/Pipeline";
13
+import Pipeline from "../CompilerPipeline";
14
import { invariant } from "../Utils/CompilerError";
15
16
/**
compiler/forget/src/CompilerPipeline.ts
renamed
+20
-18
@@ -6,24 +6,26 @@
6
*/
7
import { NodePath } from "@babel/traverse";
8
import * as t from "@babel/types";
9
-import { lower } from "../HIR/BuildHIR";
10
-import { Environment } from "../HIR/HIRBuilder";
11
-import inferReferenceEffects from "../HIR/InferReferenceEffects";
12
-import { buildReactiveFunction } from "../ReactiveScopes/BuildReactiveFunction";
13
-import { codegenReactiveFunction } from "../ReactiveScopes/CodegenReactiveFunction";
14
-import { flattenReactiveLoops } from "../ReactiveScopes/FlattenReactiveLoops";
15
-import { inferReactiveScopes } from "../ReactiveScopes/InferReactiveScopes";
16
-import { inferReactiveScopeVariables } from "../ReactiveScopes/InferReactiveScopeVariables";
17
-import { printReactiveFunction } from "../ReactiveScopes/PrintReactiveFunction";
18
-import { propagateScopeDependencies } from "../ReactiveScopes/PropagateScopeDependencies";
19
-import { pruneUnusedLabels } from "../ReactiveScopes/PruneUnusedLabels";
20
-import { eliminateRedundantPhi } from "../SSA/EliminateRedundantPhi";
21
-import enterSSA from "../SSA/EnterSSA";
22
-import { leaveSSA } from "../SSA/LeaveSSA";
23
-import { logHIRFunction } from "../Utils/logger";
24
-import { HIRFunction } from "./HIR";
25
-import { inferMutableRanges } from "./InferMutableRanges";
26
-import { inferTypes } from "./InferTypes";
9
+import {
10
+ Environment,
11
+ HIRFunction,
12
+ inferMutableRanges,
13
+ inferReferenceEffects,
14
+ inferTypes,
15
+ lower,
16
+} from "./HIR";
17
+import {
18
+ buildReactiveFunction,
19
+ codegenReactiveFunction,
20
+ flattenReactiveLoops,
21
+ inferReactiveScopes,
22
+ inferReactiveScopeVariables,
23
+ printReactiveFunction,
24
+ propagateScopeDependencies,
25
+ pruneUnusedLabels,
26
+} from "./ReactiveScopes";
27
+import { eliminateRedundantPhi, enterSSA, leaveSSA } from "./SSA";
28
+import { logHIRFunction } from "./Utils/logger";
29
30
export type CompilerFlags = {
31
eliminateRedundantPhi: boolean;
compiler/forget/src/HIR/index.ts
new
+14
@@ -0,0 +1,14 @@
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
+export { lower } from "./BuildHIR";
9
+export { HIRFunction } from "./HIR";
10
+export { Environment } from "./HIRBuilder";
11
+export { inferMutableRanges } from "./InferMutableRanges";
12
+export { default as inferReferenceEffects } from "./InferReferenceEffects";
13
+export { inferTypes } from "./InferTypes";
14
+export { printFunction } from "./PrintHIR";
compiler/forget/src/ReactiveScopes/index.ts
new
+15
@@ -0,0 +1,15 @@
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
+export { buildReactiveFunction } from "./BuildReactiveFunction";
9
+export { codegenReactiveFunction } from "./CodegenReactiveFunction";
10
+export { flattenReactiveLoops } from "./FlattenReactiveLoops";
11
+export { inferReactiveScopes } from "./InferReactiveScopes";
12
+export { inferReactiveScopeVariables } from "./InferReactiveScopeVariables";
13
+export { printReactiveFunction } from "./PrintReactiveFunction";
14
+export { propagateScopeDependencies } from "./PropagateScopeDependencies";
15
+export { pruneUnusedLabels } from "./PruneUnusedLabels";
compiler/forget/src/SSA/index.ts
new
+10
@@ -0,0 +1,10 @@
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
+export { eliminateRedundantPhi } from "./EliminateRedundantPhi";
9
+export { default as enterSSA } from "./EnterSSA";
10
+export { leaveSSA } from "./LeaveSSA";
compiler/forget/src/__tests__/hir-test.ts
+2
-2
@@ -14,8 +14,8 @@ import { wasmFolder } from "@hpcc-js/wasm";
14
import invariant from "invariant";
15
import path from "path";
16
import prettier from "prettier";
17
-import run from "../HIR/Pipeline";
18
-import { printFunction } from "../HIR/PrintHIR";
17
+import run from "../CompilerPipeline";
18
+import { printFunction } from "../HIR";
19
import { toggleLogging } from "../Utils/logger";
20
import generateTestsFromFixtures from "./test-utils/generateTestsFromFixtures";
21