[compiler] Refactor createTemporaryPlace

Update createTemporaryPlace to use makeTemporary and also rename
makeTemporary to makeTemporaryIdentifier to make it less ambiguous.

ghstack-source-id: b5955d3d66
Pull Request resolved: https://github.com/facebook/react/pull/30585
This commit is contained in:
Sathya Gunsasekaran
2024-08-06 15:30:01 +01:00
parent 65903583d2
commit eb1d52b01b
2 changed files with 4 additions and 11 deletions
@@ -1205,7 +1205,7 @@ export type ValidIdentifierName = string & {
[opaqueValidIdentifierName]: 'ValidIdentifierName';
};
export function makeTemporary(
export function makeTemporaryIdentifier(
id: IdentifierId,
loc: SourceLocation,
): Identifier {
@@ -27,7 +27,7 @@ import {
makeBlockId,
makeIdentifierName,
makeInstructionId,
makeTemporary,
makeTemporaryIdentifier,
makeType,
} from './HIR';
import {printInstruction} from './PrintHIR';
@@ -183,7 +183,7 @@ export default class HIRBuilder {
makeTemporary(loc: SourceLocation): Identifier {
const id = this.nextIdentifierId;
return makeTemporary(id, loc);
return makeTemporaryIdentifier(id, loc);
}
#resolveBabelBinding(
@@ -891,14 +891,7 @@ export function createTemporaryPlace(
): Place {
return {
kind: 'Identifier',
identifier: {
id: env.nextIdentifierId,
mutableRange: {start: makeInstructionId(0), end: makeInstructionId(0)},
name: null,
scope: null,
type: makeType(),
loc,
},
identifier: makeTemporaryIdentifier(env.nextIdentifierId, loc),
reactive: false,
effect: Effect.Unknown,
loc: GeneratedSource,