import { ArkBody } from '../../../../core/model/ArkBody'; import { ArkMethod } from '../../../../core/model/ArkMethod'; import { MethodSignature } from '../../../../core/model/ArkSignature'; import { CfgBuilder } from '../../graph/builder/CfgBuilder'; import { GlobalRef } from '../../../../core/base/Ref'; import { CxxAstNode } from '../../utils/ArkCxxAstNode'; export declare class CxxBodyBuilder { private cfgBuilder; private globals?; constructor(methodSignature: MethodSignature, sourceAstNode: CxxAstNode, declaringMethod: ArkMethod, sourceFile: CxxAstNode); build(): ArkBody | null; getCfgBuilder(): CfgBuilder; getGlobals(): Map | undefined; setGlobals(globals: Map): void; /** * Find out all locals in the parent method which are used by the nested method, these locals are the closures of the rnested method. * nestedMethod is current nested method. * baseLocals are all locals defined in the outer function. * baseClosures are all closures of the outer function. * * When processing the CxxAstNode 'lambdaExpr', the closures of the nested function may be initially constructed. * Here, the true closures of the nested function are filtered out based on the locals and closures of the outer function. */ private findClosuresUsedInNested; /** * 1. Find out all locals in the parent method which are used by the childrenChain, these locals are the closures of the root node of the childrenChain. * 2. Create a lexical env local in the parent method, and pass it to root node of the childrenChain through the method signature. * 3. Update the root node of the childrenChain to add parameterRef assign stmt and closureRef assign stmt. * 4. Recursively do this for all nested method level by level. */ private buildLexicalEnv; /** * Find out and tag all closures from globals, and remove closures from both globals and locals. * Precondition: body build has been done. All locals, globals and closures are both set as Local in body, * while potential globals and closures are also recorded in bodybuilder. * Constraint: only the outermost function can call this method to recursively handle closures of itself as well as all nested methods. */ handleGlobalAndClosure(): void; private freeBodyBuilder; private updateLocalTypesWithTypeAlias; private inferUnclearReferenceTypeWithTypeAlias; private generateNestedMethodChains; private getNestedChildrenChains; private moveCurrentMethodLocalToGlobal; private reorganizeGlobalAndLocal; private inferTypesDefineInOuter; private updateNestedMethodUsedInOuter; private updateNestedMethodWithClosures; private updateOuterMethodWithClosures; private getOriginalNestedMethodName; private updateGlobalInfoWithClosures; private updateLocalInfoWithClosures; private updateAbstractInvokeExprWithClosures; private createNewSignatureWithClosures; private updateSignatureAndArgsInArkInvokeExpr; private addClosureParamsAssignStmts; private buildExplicitClosureCaptureTypeMap; } //# sourceMappingURL=BodyBuilder.d.ts.map