aboutsummaryrefslogtreecommitdiff
path: root/lib/base-compiler.ts
diff options
context:
space:
mode:
authorJ. Ryan Stinnett <jryans@gmail.com>2023-12-03 16:33:42 +0000
committerGitHub <noreply@github.com>2023-12-03 11:33:42 -0500
commitc3e1b04c310729d713a8fa7d4a40c1bcd752b384 (patch)
tree4b408daefe05fb52e03d1417e4e82a6be585693c /lib/base-compiler.ts
parentc02f94233ed46c42600bec411262cba15c8e5b6f (diff)
downloadcompiler-explorer-c3e1b04c310729d713a8fa7d4a40c1bcd752b384.tar.gz
compiler-explorer-c3e1b04c310729d713a8fa7d4a40c1bcd752b384.zip
Rename opt pipeline without LLVM prefix (#5828)gh-9794
This prepares for future work that will reuse the opt pipeline view outside of the LLVM ecosystem by renaming related components to remove the LLVM prefix. The pass dumper keep its LLVM prefix, as it is assumed this part is likely to be customised for each compiler ecosystem. The historical component name has been preserved in the component list as an alias to keep old links working.
Diffstat (limited to 'lib/base-compiler.ts')
-rw-r--r--lib/base-compiler.ts60
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;