diff --git a/compiler/forget/src/Babel/BabelPlugin.ts b/compiler/forget/src/Babel/BabelPlugin.ts index 51df340d8a..4ee836e403 100644 --- a/compiler/forget/src/Babel/BabelPlugin.ts +++ b/compiler/forget/src/Babel/BabelPlugin.ts @@ -10,7 +10,7 @@ import type * as BabelCore from "@babel/core"; import type { PluginObj } from "@babel/core"; import jsx from "@babel/plugin-syntax-jsx"; -import Pipeline from "../HIR/Pipeline"; +import Pipeline from "../CompilerPipeline"; import { invariant } from "../Utils/CompilerError"; /** diff --git a/compiler/forget/src/HIR/Pipeline.ts b/compiler/forget/src/CompilerPipeline.ts similarity index 65% rename from compiler/forget/src/HIR/Pipeline.ts rename to compiler/forget/src/CompilerPipeline.ts index d9a46d9922..9203f5f420 100644 --- a/compiler/forget/src/HIR/Pipeline.ts +++ b/compiler/forget/src/CompilerPipeline.ts @@ -6,24 +6,26 @@ */ import { NodePath } from "@babel/traverse"; import * as t from "@babel/types"; -import { lower } from "../HIR/BuildHIR"; -import { Environment } from "../HIR/HIRBuilder"; -import inferReferenceEffects from "../HIR/InferReferenceEffects"; -import { buildReactiveFunction } from "../ReactiveScopes/BuildReactiveFunction"; -import { codegenReactiveFunction } from "../ReactiveScopes/CodegenReactiveFunction"; -import { flattenReactiveLoops } from "../ReactiveScopes/FlattenReactiveLoops"; -import { inferReactiveScopes } from "../ReactiveScopes/InferReactiveScopes"; -import { inferReactiveScopeVariables } from "../ReactiveScopes/InferReactiveScopeVariables"; -import { printReactiveFunction } from "../ReactiveScopes/PrintReactiveFunction"; -import { propagateScopeDependencies } from "../ReactiveScopes/PropagateScopeDependencies"; -import { pruneUnusedLabels } from "../ReactiveScopes/PruneUnusedLabels"; -import { eliminateRedundantPhi } from "../SSA/EliminateRedundantPhi"; -import enterSSA from "../SSA/EnterSSA"; -import { leaveSSA } from "../SSA/LeaveSSA"; -import { logHIRFunction } from "../Utils/logger"; -import { HIRFunction } from "./HIR"; -import { inferMutableRanges } from "./InferMutableRanges"; -import { inferTypes } from "./InferTypes"; +import { + Environment, + HIRFunction, + inferMutableRanges, + inferReferenceEffects, + inferTypes, + lower, +} from "./HIR"; +import { + buildReactiveFunction, + codegenReactiveFunction, + flattenReactiveLoops, + inferReactiveScopes, + inferReactiveScopeVariables, + printReactiveFunction, + propagateScopeDependencies, + pruneUnusedLabels, +} from "./ReactiveScopes"; +import { eliminateRedundantPhi, enterSSA, leaveSSA } from "./SSA"; +import { logHIRFunction } from "./Utils/logger"; export type CompilerFlags = { eliminateRedundantPhi: boolean; diff --git a/compiler/forget/src/HIR/index.ts b/compiler/forget/src/HIR/index.ts new file mode 100644 index 0000000000..f7d01396fc --- /dev/null +++ b/compiler/forget/src/HIR/index.ts @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export { lower } from "./BuildHIR"; +export { HIRFunction } from "./HIR"; +export { Environment } from "./HIRBuilder"; +export { inferMutableRanges } from "./InferMutableRanges"; +export { default as inferReferenceEffects } from "./InferReferenceEffects"; +export { inferTypes } from "./InferTypes"; +export { printFunction } from "./PrintHIR"; diff --git a/compiler/forget/src/ReactiveScopes/index.ts b/compiler/forget/src/ReactiveScopes/index.ts new file mode 100644 index 0000000000..3fcfa28bdd --- /dev/null +++ b/compiler/forget/src/ReactiveScopes/index.ts @@ -0,0 +1,15 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export { buildReactiveFunction } from "./BuildReactiveFunction"; +export { codegenReactiveFunction } from "./CodegenReactiveFunction"; +export { flattenReactiveLoops } from "./FlattenReactiveLoops"; +export { inferReactiveScopes } from "./InferReactiveScopes"; +export { inferReactiveScopeVariables } from "./InferReactiveScopeVariables"; +export { printReactiveFunction } from "./PrintReactiveFunction"; +export { propagateScopeDependencies } from "./PropagateScopeDependencies"; +export { pruneUnusedLabels } from "./PruneUnusedLabels"; diff --git a/compiler/forget/src/SSA/index.ts b/compiler/forget/src/SSA/index.ts new file mode 100644 index 0000000000..3843f4363a --- /dev/null +++ b/compiler/forget/src/SSA/index.ts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export { eliminateRedundantPhi } from "./EliminateRedundantPhi"; +export { default as enterSSA } from "./EnterSSA"; +export { leaveSSA } from "./LeaveSSA"; diff --git a/compiler/forget/src/__tests__/hir-test.ts b/compiler/forget/src/__tests__/hir-test.ts index 57522d7e15..9778bc0ffe 100644 --- a/compiler/forget/src/__tests__/hir-test.ts +++ b/compiler/forget/src/__tests__/hir-test.ts @@ -14,8 +14,8 @@ import { wasmFolder } from "@hpcc-js/wasm"; import invariant from "invariant"; import path from "path"; import prettier from "prettier"; -import run from "../HIR/Pipeline"; -import { printFunction } from "../HIR/PrintHIR"; +import run from "../CompilerPipeline"; +import { printFunction } from "../HIR"; import { toggleLogging } from "../Utils/logger"; import generateTestsFromFixtures from "./test-utils/generateTestsFromFixtures";