mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[hir] Move inference passes to separate folder
This commit is contained in:
@@ -6,13 +6,8 @@
|
||||
*/
|
||||
import { NodePath } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
import {
|
||||
Environment,
|
||||
HIRFunction,
|
||||
inferMutableRanges,
|
||||
inferReferenceEffects,
|
||||
lower,
|
||||
} from "./HIR";
|
||||
import { inferMutableRanges, inferReferenceEffects } from "./Inference";
|
||||
import { Environment, HIRFunction, lower } from "./HIR";
|
||||
import { ReactiveFunction } from "./HIR/HIR";
|
||||
import {
|
||||
buildReactiveFunction,
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
export { lower } from "./BuildHIR";
|
||||
export { HIRFunction } from "./HIR";
|
||||
export { Environment } from "./HIRBuilder";
|
||||
export { inferMutableRanges } from "./InferMutableRanges";
|
||||
export { default as inferReferenceEffects } from "./InferReferenceEffects";
|
||||
export { printFunction } from "./PrintHIR";
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import DisjointSet from "../Utils/DisjointSet";
|
||||
import { HIRFunction, Identifier, Instruction, LValue, Place } from "./HIR";
|
||||
import {
|
||||
HIRFunction,
|
||||
Identifier,
|
||||
Instruction,
|
||||
LValue,
|
||||
Place,
|
||||
} from "../HIR/HIR";
|
||||
|
||||
export type AliasSet = Set<Identifier>;
|
||||
|
||||
+7
-1
@@ -5,7 +5,13 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import DisjointSet from "../Utils/DisjointSet";
|
||||
import { Effect, HIRFunction, Identifier, InstructionId, Place } from "./HIR";
|
||||
import {
|
||||
Effect,
|
||||
HIRFunction,
|
||||
Identifier,
|
||||
InstructionId,
|
||||
Place,
|
||||
} from "../HIR/HIR";
|
||||
|
||||
export function inferAliasForStores(
|
||||
func: HIRFunction,
|
||||
+3
-3
@@ -13,9 +13,9 @@ import {
|
||||
Instruction,
|
||||
makeInstructionId,
|
||||
Place,
|
||||
} from "./HIR";
|
||||
import { printInstruction, printPlace } from "./PrintHIR";
|
||||
import { eachInstructionOperand } from "./visitors";
|
||||
} from "../HIR/HIR";
|
||||
import { printInstruction, printPlace } from "../HIR/PrintHIR";
|
||||
import { eachInstructionOperand } from "../HIR/visitors";
|
||||
|
||||
/**
|
||||
* For each usage of a value in the given function, determines if the usage
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import { HIRFunction } from "./HIR";
|
||||
import { HIRFunction } from "../HIR/HIR";
|
||||
import { inferAliases } from "./InferAlias";
|
||||
import { inferAliasForStores } from "./InferAliasForStores";
|
||||
import { inferMutableLifetimes } from "./InferMutableLifetimes";
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import DisjointSet from "../Utils/DisjointSet";
|
||||
import { Identifier, InstructionId } from "./HIR";
|
||||
import { Identifier, InstructionId } from "../HIR/HIR";
|
||||
|
||||
export function inferMutableRangesForAlias(aliases: DisjointSet<Identifier>) {
|
||||
const aliasSets = aliases.buildSets();
|
||||
+7
-3
@@ -18,13 +18,17 @@ import {
|
||||
Phi,
|
||||
Place,
|
||||
ValueKind,
|
||||
} from "./HIR";
|
||||
import { printMixedHIR, printPlace, printSourceLocation } from "./PrintHIR";
|
||||
} from "../HIR/HIR";
|
||||
import {
|
||||
printMixedHIR,
|
||||
printPlace,
|
||||
printSourceLocation,
|
||||
} from "../HIR/PrintHIR";
|
||||
import {
|
||||
eachInstructionOperand,
|
||||
eachTerminalOperand,
|
||||
eachTerminalSuccessor,
|
||||
} from "./visitors";
|
||||
} from "../HIR/visitors";
|
||||
|
||||
/**
|
||||
* For every usage of a value in the given function, infers the effect or action
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* 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 { inferMutableRanges } from "./InferMutableRanges";
|
||||
export { default as inferReferenceEffects } from "./InferReferenceEffects";
|
||||
@@ -17,8 +17,7 @@ import * as t from "@babel/types";
|
||||
import { lower } from "./HIR/BuildHIR";
|
||||
import codegen from "./HIR/Codegen";
|
||||
import { Environment } from "./HIR/HIRBuilder";
|
||||
import { inferMutableRanges } from "./HIR/InferMutableRanges";
|
||||
import inferReferenceEffects from "./HIR/InferReferenceEffects";
|
||||
import { inferMutableRanges, inferReferenceEffects } from "./Inference";
|
||||
import { inferTypes } from "./TypeInference";
|
||||
import printHIR, { printFunction } from "./HIR/PrintHIR";
|
||||
import { buildReactiveFunction } from "./ReactiveScopes/BuildReactiveFunction";
|
||||
|
||||
Reference in New Issue
Block a user