MCPcopy Create free account
hub / github.com/Snapchat/Valdi / compile

Method compile

compiler/companion/src/native/NativeCompiler.ts:4118–4149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4116 }
4117
4118 compile(): NativeCompilerIR.Base[] {
4119 try {
4120 const initFunctionName = this.allocateFunctionName(`${this.moduleName}__module_init__`);
4121
4122 this.processSourceFile(initFunctionName, this.sourceFile);
4123 return this.moduleBuilder.finalize(initFunctionName, this.options);
4124 } catch (exc: any) {
4125 if (!(exc instanceof NativeHelper.NativeCompilerError)) {
4126 if (this.lastProcessingDeclaration) {
4127 // Decorate error with last processing declaration
4128 try {
4129 const resolvedError = new NativeHelper.NativeCompilerError(
4130 this.filePath,
4131 this.sourceFile,
4132 this.lastProcessingDeclaration,
4133 exc.message,
4134 );
4135
4136 resolvedError.stack = exc.stack;
4137
4138 throw resolvedError;
4139 } catch (e: any) {
4140 throw exc;
4141 }
4142 } else {
4143 throw exc;
4144 }
4145 } else {
4146 throw exc;
4147 }
4148 }
4149 }
4150}
4151
4152export function compileIRsToC(

Callers 1

compileFileFunction · 0.95

Calls 3

allocateFunctionNameMethod · 0.95
processSourceFileMethod · 0.95
finalizeMethod · 0.65

Tested by

no test coverage detected