diff options
Diffstat (limited to 'lib/base-compiler.ts')
-rw-r--r-- | lib/base-compiler.ts | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index 9e3b9b27d..6a2ccf985 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -44,9 +44,9 @@ import { bypassExecutionCache, } from '../types/compilation/compilation.interfaces.js'; import type { - LLVMOptPipelineBackendOptions, - LLVMOptPipelineOutput, -} from '../types/compilation/llvm-opt-pipeline-output.interfaces.js'; + OptPipelineBackendOptions, + OptPipelineOutput, +} from '../types/compilation/opt-pipeline-output.interfaces.js'; import type {CompilerInfo, ICompiler, PreliminaryCompilerInfo} from '../types/compiler.interfaces.js'; import { BasicExecutionResult, @@ -1349,8 +1349,8 @@ export class BaseCompiler implements ICompiler { .filter(option => option !== '-fcolor-diagnostics') .concat(unwrap(this.compiler.irArg)); - if (irOptions.noDiscardValueNames && this.compiler.llvmOptNoDiscardValueNamesArg) { - newOptions.push(...this.compiler.llvmOptNoDiscardValueNamesArg); + if (irOptions.noDiscardValueNames && this.compiler.optPipelineNoDiscardValueNamesArg) { + newOptions.push(...this.compiler.optPipelineNoDiscardValueNamesArg); } const execOptions = this.getDefaultExecOptions(); @@ -1402,19 +1402,19 @@ export class BaseCompiler implements ICompiler { }; } - async generateLLVMOptPipeline( + async generateOptPipeline( inputFilename: string, options: string[], filters: ParseFiltersAndOutputOptions, - llvmOptPipelineOptions: LLVMOptPipelineBackendOptions, - ): Promise<LLVMOptPipelineOutput | undefined> { + optPipelineOptions: OptPipelineBackendOptions, + ): Promise<OptPipelineOutput | undefined> { // These options make Clang produce the pass dumps const newOptions = options .filter(option => option !== '-fcolor-diagnostics') - .concat(unwrap(this.compiler.llvmOptArg)) - .concat(llvmOptPipelineOptions.fullModule ? unwrap(this.compiler.llvmOptModuleScopeArg) : []) + .concat(unwrap(this.compiler.optPipelineArg)) + .concat(optPipelineOptions.fullModule ? unwrap(this.compiler.optPipelineModuleScopeArg) : []) .concat( - llvmOptPipelineOptions.noDiscardValueNames ? unwrap(this.compiler.llvmOptNoDiscardValueNamesArg) : [], + optPipelineOptions.noDiscardValueNames ? unwrap(this.compiler.optPipelineNoDiscardValueNamesArg) : [], ) .concat(this.compiler.debugPatched ? ['-mllvm', '--debug-to-stdout'] : []); @@ -1429,7 +1429,7 @@ export class BaseCompiler implements ICompiler { return { error: 'Clang invocation timed out', results: {}, - clangTime: output.execTime || compileEnd - compileStart, + compileTime: output.execTime || compileEnd - compileStart, }; } @@ -1439,15 +1439,15 @@ export class BaseCompiler implements ICompiler { try { const parseStart = performance.now(); - const llvmOptPipeline = await this.processLLVMOptPipeline( + const optPipeline = await this.processOptPipeline( output, filters, - llvmOptPipelineOptions, + optPipelineOptions, this.compiler.debugPatched, ); const parseEnd = performance.now(); - if (llvmOptPipelineOptions.demangle) { + if (optPipelineOptions.demangle) { // apply demangles after parsing, would otherwise greatly complicate the parsing of the passes // new this.demanglerClass(this.compiler.demangler, this); const demangler = new LLVMIRDemangler(this.compiler.demangler, this); @@ -1458,14 +1458,14 @@ export class BaseCompiler implements ICompiler { demangler.collect({asm: output.stderr}); } return { - results: await demangler.demangleLLVMPasses(llvmOptPipeline), - clangTime: compileEnd - compileStart, + results: await demangler.demangleLLVMPasses(optPipeline), + compileTime: compileEnd - compileStart, parseTime: parseEnd - parseStart, }; } else { return { - results: llvmOptPipeline, - clangTime: compileEnd - compileStart, + results: optPipeline, + compileTime: compileEnd - compileStart, parseTime: parseEnd - parseStart, }; } @@ -1473,21 +1473,21 @@ export class BaseCompiler implements ICompiler { return { error: e.toString(), results: {}, - clangTime: compileEnd - compileStart, + compileTime: compileEnd - compileStart, }; } } - async processLLVMOptPipeline( + async processOptPipeline( output, filters: ParseFiltersAndOutputOptions, - llvmOptPipelineOptions: LLVMOptPipelineBackendOptions, + optPipelineOptions: OptPipelineBackendOptions, debugPatched?: boolean, ) { return this.llvmPassDumpParser.process( debugPatched ? output.stdout : output.stderr, filters, - llvmOptPipelineOptions, + optPipelineOptions, ); } @@ -2228,7 +2228,7 @@ export class BaseCompiler implements ICompiler { const makeGnatDebug = backendOptions.produceGnatDebug && this.compiler.supportsGnatDebugViews; const makeGnatDebugTree = backendOptions.produceGnatDebugTree && this.compiler.supportsGnatDebugViews; const makeIr = backendOptions.produceIr && this.compiler.supportsIrView; - const makeLLVMOptPipeline = backendOptions.produceLLVMOptPipeline && this.compiler.supportsLLVMOptPipelineView; + const makeOptPipeline = backendOptions.produceOptPipeline && this.compiler.supportsOptPipelineView; const makeRustMir = backendOptions.produceRustMir && this.compiler.supportsRustMirView; const makeRustMacroExp = backendOptions.produceRustMacroExp && this.compiler.supportsRustMacroExpView; const makeRustHir = backendOptions.produceRustHir && this.compiler.supportsRustHirView; @@ -2244,7 +2244,7 @@ export class BaseCompiler implements ICompiler { astResult, ppResult, irResult, - llvmOptPipelineResult, + optPipelineResult, rustHirResult, rustMacroExpResult, toolsResult, @@ -2261,8 +2261,8 @@ export class BaseCompiler implements ICompiler { filters, ) : null, - makeLLVMOptPipeline - ? this.generateLLVMOptPipeline(inputFilename, options, filters, backendOptions.produceLLVMOptPipeline) + makeOptPipeline + ? this.generateOptPipeline(inputFilename, options, filters, backendOptions.produceOptPipeline) : null, makeRustHir ? this.generateRustHir(inputFilename, options) : null, makeRustMacroExp ? this.generateRustMacroExpansion(inputFilename, options) : null, @@ -2359,9 +2359,9 @@ export class BaseCompiler implements ICompiler { asmResult.hasIrOutput = true; asmResult.irOutput = irResult; } - if (llvmOptPipelineResult) { - asmResult.hasLLVMOptPipelineOutput = true; - asmResult.llvmOptPipelineOutput = llvmOptPipelineResult; + if (optPipelineResult) { + asmResult.hasOptPipelineOutput = true; + asmResult.optPipelineOutput = optPipelineResult; } if (rustMirResult) { asmResult.hasRustMirOutput = true; |