mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
refactor: renames the CompilerFilters type (#4346)
The type which probably started as a real enum of possible post filtering options now also includes options used for compilers' invocations. The type was already split, but the naming was not reflecting this in the other part of the code. This changes tries to apply a simple renaming to the type only (corresponding variables are left as 'filters'). While doing so, some typing error were discovered around the GccDump feature. A fix for this will follow in a different PR. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
This commit is contained in:
@@ -48,7 +48,7 @@ import {
|
||||
ExecutableExecutionOptions,
|
||||
UnprocessedExecResult,
|
||||
} from '../types/execution/execution.interfaces';
|
||||
import {CompilerFilters, ParseFilters} from '../types/features/filters.interfaces';
|
||||
import {CompilerOutputOptions, ParseFiltersAndOutputOptions} from '../types/features/filters.interfaces';
|
||||
import {Language} from '../types/languages.interfaces';
|
||||
import {Library, LibraryVersion, SelectedLibraryVersion} from '../types/libraries/libraries.interfaces';
|
||||
import {ResultLine} from '../types/resultline/resultline.interfaces';
|
||||
@@ -392,7 +392,14 @@ export class BaseCompiler {
|
||||
return output;
|
||||
}
|
||||
|
||||
async objdump(outputFilename, result: any, maxSize: number, intelAsm, demangle, filters: ParseFilters) {
|
||||
async objdump(
|
||||
outputFilename,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
outputFilename = this.getObjdumpOutputFilename(outputFilename);
|
||||
|
||||
if (!(await utils.fileExists(outputFilename))) {
|
||||
@@ -585,7 +592,11 @@ export class BaseCompiler {
|
||||
return addOpts;
|
||||
}
|
||||
|
||||
protected optionsForFilter(filters: ParseFilters, outputFilename: string, userOptions?: string[]): string[] {
|
||||
protected optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions?: string[],
|
||||
): string[] {
|
||||
let options = ['-g', '-o', this.filename(outputFilename)];
|
||||
if (this.compiler.intelAsm && filters.intel && !filters.binary) {
|
||||
options = options.concat(this.compiler.intelAsm.split(' '));
|
||||
@@ -844,7 +855,7 @@ export class BaseCompiler {
|
||||
|
||||
prepareArguments(
|
||||
userOptions: string[],
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
@@ -1009,7 +1020,7 @@ export class BaseCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
async generateIR(inputFilename: string, options: string[], filters: ParseFilters) {
|
||||
async generateIR(inputFilename: string, options: string[], filters: ParseFiltersAndOutputOptions) {
|
||||
// These options make Clang produce an IR
|
||||
const newOptions = options.filter(option => option !== '-fcolor-diagnostics').concat(this.compiler.irArg);
|
||||
|
||||
@@ -1025,7 +1036,7 @@ export class BaseCompiler {
|
||||
return ir.asm;
|
||||
}
|
||||
|
||||
async processIrOutput(output, filters: ParseFilters) {
|
||||
async processIrOutput(output, filters: ParseFiltersAndOutputOptions) {
|
||||
const irPath = this.getIrOutputFilename(output.inputFilename, filters);
|
||||
if (await fs.pathExists(irPath)) {
|
||||
const output = await fs.readFile(irPath, 'utf-8');
|
||||
@@ -1041,7 +1052,7 @@ export class BaseCompiler {
|
||||
async generateLLVMOptPipeline(
|
||||
inputFilename: string,
|
||||
options: string[],
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
llvmOptPipelineOptions: LLVMOptPipelineBackendOptions,
|
||||
): Promise<LLVMOptPipelineOutput | undefined> {
|
||||
// These options make Clang produce the pass dumps
|
||||
@@ -1102,7 +1113,11 @@ export class BaseCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
async processLLVMOptPipeline(output, filters: ParseFilters, llvmOptPipelineOptions: LLVMOptPipelineBackendOptions) {
|
||||
async processLLVMOptPipeline(
|
||||
output,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
llvmOptPipelineOptions: LLVMOptPipelineBackendOptions,
|
||||
) {
|
||||
return this.llvmPassDumpParser.process(output.stderr, filters, llvmOptPipelineOptions);
|
||||
}
|
||||
|
||||
@@ -1198,7 +1213,7 @@ export class BaseCompiler {
|
||||
return [{text: 'Internal error; unable to open output path'}];
|
||||
}
|
||||
|
||||
getIrOutputFilename(inputFilename: string, filters: ParseFilters): string {
|
||||
getIrOutputFilename(inputFilename: string, filters: ParseFiltersAndOutputOptions): string {
|
||||
return inputFilename.replace(path.extname(inputFilename), '.ll');
|
||||
}
|
||||
|
||||
@@ -1316,7 +1331,7 @@ export class BaseCompiler {
|
||||
else return null;
|
||||
}
|
||||
|
||||
async checkOutputFileAndDoPostProcess(asmResult, outputFilename, filters: ParseFilters) {
|
||||
async checkOutputFileAndDoPostProcess(asmResult, outputFilename, filters: ParseFiltersAndOutputOptions) {
|
||||
try {
|
||||
const stat = await fs.stat(outputFilename);
|
||||
asmResult.asmSize = stat.size;
|
||||
@@ -1386,7 +1401,7 @@ export class BaseCompiler {
|
||||
return Promise.all(filesToWrite);
|
||||
}
|
||||
|
||||
protected async writeAllFiles(dirPath, source, files, filters: ParseFilters) {
|
||||
protected async writeAllFiles(dirPath, source, files, filters: ParseFiltersAndOutputOptions) {
|
||||
if (!source) throw new Error(`File ${this.compileFilename} has no content or file is missing`);
|
||||
|
||||
const inputFilename = path.join(dirPath, this.compileFilename);
|
||||
@@ -1401,7 +1416,7 @@ export class BaseCompiler {
|
||||
};
|
||||
}
|
||||
|
||||
protected async writeAllFilesCMake(dirPath, source, files, filters: ParseFilters) {
|
||||
protected async writeAllFilesCMake(dirPath, source, files, filters: ParseFiltersAndOutputOptions) {
|
||||
if (!source) throw new Error('File CMakeLists.txt has no content or file is missing');
|
||||
|
||||
const inputFilename = path.join(dirPath, 'CMakeLists.txt');
|
||||
@@ -1424,7 +1439,7 @@ export class BaseCompiler {
|
||||
|
||||
const outputFilename = this.getExecutableFilename(dirPath, this.outputFilebase, key);
|
||||
|
||||
const buildFilters: ParseFilters = Object.assign({}, key.filters);
|
||||
const buildFilters: ParseFiltersAndOutputOptions = Object.assign({}, key.filters);
|
||||
buildFilters.binary = true;
|
||||
buildFilters.execute = true;
|
||||
|
||||
@@ -2307,7 +2322,7 @@ export class BaseCompiler {
|
||||
return this.asm.process(result.asm, filters);
|
||||
}
|
||||
|
||||
async postProcessAsm(result, filters?: ParseFilters) {
|
||||
async postProcessAsm(result, filters?: ParseFiltersAndOutputOptions) {
|
||||
if (!result.okToCache || !this.demanglerClass || !result.asm) return result;
|
||||
const demangler = new this.demanglerClass(this.compiler.demangler, this);
|
||||
|
||||
@@ -2478,14 +2493,14 @@ but nothing was dumped. Possible causes are:
|
||||
return this.handlePostProcessResult(result, await this.exec('bash', ['-c', postCommand], {maxOutput: maxSize}));
|
||||
}
|
||||
|
||||
preProcess(source: string, filters: CompilerFilters): string {
|
||||
preProcess(source: string, filters: CompilerOutputOptions): string {
|
||||
if (filters.binary && !this.stubRe.test(source)) {
|
||||
source += `\n${this.stubText}\n`;
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
async postProcess(result, outputFilename: string, filters: ParseFilters) {
|
||||
async postProcess(result, outputFilename: string, filters: ParseFiltersAndOutputOptions) {
|
||||
const postProcess = _.compact(this.compiler.postProcess);
|
||||
const maxSize = this.env.ceProps('max-asm-size', 64 * 1024 * 1024);
|
||||
const optPromise = result.hasOptOutput ? this.processOptOutput(result.optPath) : '';
|
||||
|
||||
@@ -28,7 +28,7 @@ import path from 'path';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {BuildResult} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {AsmRaw} from '../parsers/asm-raw';
|
||||
import {fileExists} from '../utils';
|
||||
@@ -138,7 +138,7 @@ export class AssemblyCompiler extends BaseCompiler {
|
||||
|
||||
const outputFilename = this.getExecutableFilename(dirPath);
|
||||
|
||||
const buildFilters: ParseFilters = Object.assign({}, key.filters);
|
||||
const buildFilters: ParseFiltersAndOutputOptions = Object.assign({}, key.filters);
|
||||
buildFilters.binary = true;
|
||||
buildFilters.execute = false;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import fs from 'fs-extra';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {CompilationResult} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {CC65AsmParser} from '../parsers/asm-parser-cc65';
|
||||
import * as utils from '../utils';
|
||||
@@ -98,7 +98,7 @@ export class Cc65Compiler extends BaseCompiler {
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
const res = await super.objdump(outputFilename, result, maxSize, intelAsm, demangle, filters);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
import {BaseParser} from './argument-parsers';
|
||||
@@ -63,7 +63,7 @@ export class CIRCTCompiler extends BaseCompiler {
|
||||
return BaseParser;
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename, userOptions?): any[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename, userOptions?): any[] {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {AsmParserCpp} from '../parsers/asm-parser-cpp';
|
||||
|
||||
@@ -44,7 +44,7 @@ export class CppFrontCompiler extends BaseCompiler {
|
||||
return 'cppp';
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: any) {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: any) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
import {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {DotNetAsmParser} from '../parsers/asm-parser-dotnet';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
|
||||
class DotNetCompiler extends BaseCompiler {
|
||||
private targetFramework: string;
|
||||
@@ -204,7 +204,7 @@ class DotNetCompiler extends BaseCompiler {
|
||||
return compilerResult;
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters) {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions) {
|
||||
if (filters.binary) {
|
||||
this.compileToBinary = true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
import {ErlangParser} from './argument-parsers';
|
||||
@@ -34,7 +34,7 @@ export class ErlangCompiler extends BaseCompiler {
|
||||
return 'erlang';
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: string): string[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string): string[] {
|
||||
return [
|
||||
'-noshell',
|
||||
'-eval',
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
export class HLSLCompiler extends BaseCompiler {
|
||||
@@ -39,7 +39,11 @@ export class HLSLCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: string, userOptions?: string[]): string[] {
|
||||
override optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions?: string[],
|
||||
): string[] {
|
||||
return [
|
||||
'-Zi', // Embed debug information to get DXIL line associations
|
||||
'-Qembed_debug', // Silences the warning associated with embedded debug information
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import path from 'path';
|
||||
|
||||
import {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
export class HookCompiler extends BaseCompiler {
|
||||
@@ -33,7 +33,7 @@ export class HookCompiler extends BaseCompiler {
|
||||
return 'hook';
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters): string[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions): string[] {
|
||||
return ['--dump'];
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import path from 'path';
|
||||
|
||||
import {ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
export class JaktCompiler extends BaseCompiler {
|
||||
@@ -43,13 +43,20 @@ export class JaktCompiler extends BaseCompiler {
|
||||
return 'cppp';
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number, intelAsm, demangle, filters: ParseFilters) {
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
const objdumpResult = await super.objdump(outputFilename, result, maxSize, intelAsm, demangle, filters);
|
||||
objdumpResult.languageId = 'asm';
|
||||
return objdumpResult;
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: any) {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: any) {
|
||||
return ['--binary-dir', path.dirname(outputFilename)];
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import fs from 'fs-extra';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {CompilationResult} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import * as utils from '../utils';
|
||||
|
||||
import {ClangCompiler} from './clang';
|
||||
@@ -62,7 +62,7 @@ export class LLVMMOSCompiler extends ClangCompiler {
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
if (!outputFilename.endsWith('.elf') && (await utils.fileExists(outputFilename + '.elf'))) {
|
||||
outputFilename = outputFilename + '.elf';
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
import {BaseParser} from './argument-parsers';
|
||||
@@ -67,7 +67,7 @@ export class MLIRCompiler extends BaseCompiler {
|
||||
return BaseParser;
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename, userOptions?): any[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename, userOptions?): any[] {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export class NvccCompiler extends BaseCompiler {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {import('../../types/features/filters.interfaces').ParseFilters} filters
|
||||
* @param {import('../../types/features/filters.interfaces').ParseFiltersAndOutputOptions} filters
|
||||
* @param {string} outputFilename
|
||||
* @param {string[]?} userOptions
|
||||
* @returns {string[]}
|
||||
@@ -107,7 +107,7 @@ export class NvccCompiler extends BaseCompiler {
|
||||
*
|
||||
* @param {*} result
|
||||
* @param {string} outputFilename
|
||||
* @param {import('../../types/features/filters.interfaces').ParseFilters} filters
|
||||
* @param {import('../../types/features/filters.interfaces').ParseFiltersAndOutputOptions} filters
|
||||
*/
|
||||
async postProcess(result, outputFilename, filters) {
|
||||
const maxSize = this.env.ceProps('max-asm-size', 64 * 1024 * 1024);
|
||||
|
||||
@@ -27,7 +27,7 @@ import path from 'path';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
export class PonyCompiler extends BaseCompiler {
|
||||
@@ -42,7 +42,7 @@ export class PonyCompiler extends BaseCompiler {
|
||||
this.compiler.irArg = ['--pass', 'ir'];
|
||||
} */
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: any, userOptions?: any): string[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: any, userOptions?: any): string[] {
|
||||
let options = ['-d', '-b', path.parse(outputFilename).name];
|
||||
|
||||
if (!filters.binary) {
|
||||
@@ -61,7 +61,7 @@ export class PonyCompiler extends BaseCompiler {
|
||||
return source;
|
||||
}
|
||||
|
||||
override async generateIR(inputFilename: string, options: string[], filters: ParseFilters) {
|
||||
override async generateIR(inputFilename: string, options: string[], filters: ParseFiltersAndOutputOptions) {
|
||||
const newOptions = _.filter(options, option => !['--pass', 'asm'].includes(option)).concat(this.compiler.irArg);
|
||||
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import path from 'path';
|
||||
|
||||
import {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {logger} from '../logger';
|
||||
|
||||
@@ -45,7 +45,11 @@ export class RacketCompiler extends BaseCompiler {
|
||||
this.raco = this.compilerProps<string>(`compiler.${this.compiler.id}.raco`);
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: string, userOptions?: string[]): string[] {
|
||||
override optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions?: string[],
|
||||
): string[] {
|
||||
// We currently always compile to bytecode first and then decompile.
|
||||
// Forcing `binary` on like this ensures `objdump` will be called for
|
||||
// the decompilation phase.
|
||||
@@ -93,7 +97,7 @@ export class RacketCompiler extends BaseCompiler {
|
||||
maxSize: number,
|
||||
intelAsm: any,
|
||||
demangle: any,
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
): Promise<any> {
|
||||
// Decompile to assembly via `raco decompile` with `disassemble` package
|
||||
const execOptions: ExecutionOptions = {
|
||||
|
||||
@@ -27,7 +27,7 @@ import path from 'path';
|
||||
import {readdir, readFile, rename, writeFile} from 'fs-extra';
|
||||
|
||||
import {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import * as exec from '../exec';
|
||||
import {logger} from '../logger';
|
||||
@@ -54,7 +54,7 @@ export class RGACompiler extends BaseCompiler {
|
||||
logger.debug(`RGA compiler ${this.compiler.id} configured to use DXC at ${this.dxcPath}`);
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: any, userOptions?: any): any[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: any, userOptions?: any): any[] {
|
||||
return [outputFilename];
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import path from 'path';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {BasicExecutionResult, UnprocessedExecResult} from '../../types/execution/execution.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {BuildEnvDownloadInfo} from '../buildenvsetup/buildenv.interfaces';
|
||||
import {parseRustOutput} from '../utils';
|
||||
@@ -149,7 +149,7 @@ export class RustCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
// Override the IR file name method for rustc because the output file is different from clang.
|
||||
override getIrOutputFilename(inputFilename: string, filters: ParseFilters): string {
|
||||
override getIrOutputFilename(inputFilename: string, filters: ParseFiltersAndOutputOptions): string {
|
||||
const outputFilename = this.getOutputFilename(path.dirname(inputFilename), this.outputFilebase);
|
||||
// As per #4054, if we are asked for binary mode, the output will be in the .s file, no .ll will be emited
|
||||
if (!filters.binary) {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import _ from 'underscore';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
import {ToitParser} from './argument-parsers';
|
||||
@@ -43,7 +43,7 @@ export class ToitCompiler extends BaseCompiler {
|
||||
return outputFilename + '.cache';
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename, userOptions?): string[] {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename, userOptions?): string[] {
|
||||
if (!filters.binary) return ['execute', outputFilename];
|
||||
return [outputFilename];
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import {ExecutionOptions} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {logger} from '../logger';
|
||||
import {AsmParserZ88dk} from '../parsers/asm-parser-z88dk';
|
||||
@@ -82,7 +82,7 @@ export class z88dkCompiler extends BaseCompiler {
|
||||
);
|
||||
}
|
||||
|
||||
protected override optionsForFilter(filters: ParseFilters, outputFilename: string): string[] {
|
||||
protected override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string): string[] {
|
||||
if (!filters.binary) {
|
||||
return ['-S'];
|
||||
} else {
|
||||
@@ -110,7 +110,14 @@ export class z88dkCompiler extends BaseCompiler {
|
||||
return `${this.outputFilebase}.sms`;
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number, intelAsm, demangle, filters: ParseFilters) {
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
outputFilename = this.getObjdumpOutputFilename(outputFilename);
|
||||
|
||||
// sometimes (with +z80 for example) the .bin file is written and the .s file is empty
|
||||
|
||||
@@ -27,7 +27,7 @@ import path from 'path';
|
||||
import Semver from 'semver';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {SelectedLibraryVersion} from '../../types/libraries/libraries.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {asSafeVer} from '../utils';
|
||||
@@ -104,7 +104,11 @@ export class ZigCompiler extends BaseCompiler {
|
||||
return source;
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: string, userOptions: string[]): string[] {
|
||||
override optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions: string[],
|
||||
): string[] {
|
||||
let options = [filters.execute ? 'build-exe' : 'build-obj'];
|
||||
|
||||
const desiredName = path.basename(outputFilename);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import Semver from 'semver';
|
||||
|
||||
import {CompilerFilters, ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {CompilerOutputOptions, ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {asSafeVer} from '../utils';
|
||||
|
||||
import {ClangCompiler} from './clang';
|
||||
@@ -43,7 +43,7 @@ export class ZigCC extends ClangCompiler {
|
||||
Semver.lt(asSafeVer(this.compiler.semver), '0.9.0', true);
|
||||
}
|
||||
|
||||
override preProcess(source: string, filters: CompilerFilters): string {
|
||||
override preProcess(source: string, filters: CompilerOutputOptions): string {
|
||||
if (this.needsForcedBinary) {
|
||||
// note: zig versions > 0.6 don't emit asm, only binary works - https://github.com/ziglang/zig/issues/8153
|
||||
filters.binary = true;
|
||||
@@ -52,7 +52,11 @@ export class ZigCC extends ClangCompiler {
|
||||
return super.preProcess(source, filters);
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: string, userOptions?: string[]): string[] {
|
||||
override optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions?: string[],
|
||||
): string[] {
|
||||
if (this.needsForcedBinary) {
|
||||
// note: zig versions > 0.6 don't emit asm, only binary works - https://github.com/ziglang/zig/issues/8153
|
||||
filters.binary = true;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import Semver from 'semver';
|
||||
|
||||
import {CompilerFilters, ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {CompilerOutputOptions, ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {asSafeVer} from '../utils';
|
||||
|
||||
import {ClangCompiler} from './clang';
|
||||
@@ -43,7 +43,7 @@ export class ZigCXX extends ClangCompiler {
|
||||
Semver.lt(asSafeVer(this.compiler.semver), '0.9.0', true);
|
||||
}
|
||||
|
||||
override preProcess(source: string, filters: CompilerFilters): string {
|
||||
override preProcess(source: string, filters: CompilerOutputOptions): string {
|
||||
if (this.needsForcedBinary) {
|
||||
// note: zig versions > 0.6 don't emit asm, only binary works - https://github.com/ziglang/zig/issues/8153
|
||||
filters.binary = true;
|
||||
@@ -52,7 +52,11 @@ export class ZigCXX extends ClangCompiler {
|
||||
return super.preProcess(source, filters);
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFilters, outputFilename: string, userOptions?: string[]): string[] {
|
||||
override optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions?: string[],
|
||||
): string[] {
|
||||
if (this.needsForcedBinary) {
|
||||
// note: zig versions > 0.6 don't emit asm, only binary works - https://github.com/ziglang/zig/issues/8153
|
||||
filters.binary = true;
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from 'path';
|
||||
|
||||
import {ParsedAsmResult} from '../../types/asmresult/asmresult.interfaces';
|
||||
import {TypicalExecutionFunc, UnprocessedExecResult} from '../../types/execution/execution.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {maskRootdir} from '../utils';
|
||||
|
||||
import {IExternalParser} from './external-parser.interface';
|
||||
@@ -25,7 +25,7 @@ export class ExternalParserBase implements IExternalParser {
|
||||
this.execFunc = execFunc;
|
||||
}
|
||||
|
||||
private getParserArguments(filters: ParseFilters, fromStdin: boolean): string[] {
|
||||
private getParserArguments(filters: ParseFiltersAndOutputOptions, fromStdin: boolean): string[] {
|
||||
const parameters = ['-plt'];
|
||||
|
||||
if (fromStdin) parameters.push('-stdin');
|
||||
@@ -40,7 +40,7 @@ export class ExternalParserBase implements IExternalParser {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
private getObjdumpStarterScriptContent(filters: ParseFilters) {
|
||||
private getObjdumpStarterScriptContent(filters: ParseFiltersAndOutputOptions) {
|
||||
const parserArgs = this.getParserArguments(filters, true);
|
||||
|
||||
return (
|
||||
@@ -51,7 +51,10 @@ export class ExternalParserBase implements IExternalParser {
|
||||
);
|
||||
}
|
||||
|
||||
private async writeStarterScriptObjdump(buildfolder: string, filters: ParseFilters): Promise<string> {
|
||||
private async writeStarterScriptObjdump(
|
||||
buildfolder: string,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
): Promise<string> {
|
||||
const scriptFilepath = path.join(buildfolder, starterScriptName);
|
||||
|
||||
return new Promise(resolve => {
|
||||
@@ -80,7 +83,7 @@ export class ExternalParserBase implements IExternalParser {
|
||||
public async objdumpAndParseAssembly(
|
||||
buildfolder: string,
|
||||
objdumpArgs: string[],
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
): Promise<ParsedAsmResult> {
|
||||
objdumpArgs = objdumpArgs.map(v => {
|
||||
return maskRootdir(v);
|
||||
@@ -95,7 +98,7 @@ export class ExternalParserBase implements IExternalParser {
|
||||
return this.parseAsmExecResult(execResult);
|
||||
}
|
||||
|
||||
public async parseAssembly(filepath: string, filters: ParseFilters): Promise<ParsedAsmResult> {
|
||||
public async parseAssembly(filepath: string, filters: ParseFiltersAndOutputOptions): Promise<ParsedAsmResult> {
|
||||
const execOptions = {
|
||||
env: this.envInfo.getEnv(this.compilerInfo.needsMulti),
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {ParsedAsmResult} from '../../types/asmresult/asmresult.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
|
||||
export interface IExternalParser {
|
||||
objdumpAndParseAssembly(
|
||||
buildfolder: string,
|
||||
objdumpArgs: string[],
|
||||
filters: ParseFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
): Promise<ParsedAsmResult>;
|
||||
parseAssembly(filepath: string, filters: ParseFilters): Promise<ParsedAsmResult>;
|
||||
parseAssembly(filepath: string, filters: ParseFiltersAndOutputOptions): Promise<ParsedAsmResult>;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {AsmResultLabel, ParsedAsmResultLine} from '../../types/asmresult/asmresult.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
|
||||
import {AsmParser} from './asm-parser';
|
||||
|
||||
@@ -69,7 +69,7 @@ export class CC65AsmParser extends AsmParser {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
override processBinaryAsm(asm, filters: ParseFilters) {
|
||||
override processBinaryAsm(asm, filters: ParseFiltersAndOutputOptions) {
|
||||
const result: ParsedAsmResultLine[] = [];
|
||||
const asmLines = asm.split('\n');
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import * as utils from '../utils';
|
||||
|
||||
import {IAsmParser} from './asm-parser.interfaces';
|
||||
@@ -33,7 +33,7 @@ type Source = {file: string | null; line: number};
|
||||
const lineRe = /^\s*#line\s+(?<line>\d+)\s+"(?<file>[^"]+)"/;
|
||||
|
||||
export class AsmParserCpp implements IAsmParser {
|
||||
process(asmResult: string, filters: ParseFilters) {
|
||||
process(asmResult: string, filters: ParseFiltersAndOutputOptions) {
|
||||
const startTime = process.hrtime.bigint();
|
||||
|
||||
const asm: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
|
||||
export interface IAsmParser {
|
||||
process(asm: string, filters: ParseFilters);
|
||||
process(asm: string, filters: ParseFiltersAndOutputOptions);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
ParsedAsmResult,
|
||||
ParsedAsmResultLine,
|
||||
} from '../../types/asmresult/asmresult.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import * as utils from '../utils';
|
||||
|
||||
import {AsmRegex} from './asmregex';
|
||||
@@ -322,7 +322,7 @@ export class AsmParser extends AsmRegex {
|
||||
return labelsInLine;
|
||||
}
|
||||
|
||||
processAsm(asmResult, filters: ParseFilters): ParsedAsmResult {
|
||||
processAsm(asmResult, filters: ParseFiltersAndOutputOptions): ParsedAsmResult {
|
||||
if (filters.binary) return this.processBinaryAsm(asmResult, filters);
|
||||
|
||||
const startTime = process.hrtime.bigint();
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
LLVMOptPipelineResults,
|
||||
Pass,
|
||||
} from '../../types/compilation/llvm-opt-pipeline-output.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {ResultLine} from '../../types/resultline/resultline.interfaces';
|
||||
|
||||
// Note(jeremy-rifkin):
|
||||
@@ -497,7 +497,11 @@ export class LlvmPassDumpParser {
|
||||
);
|
||||
}
|
||||
|
||||
process(output: ResultLine[], _: ParseFilters, llvmOptPipelineOptions: LLVMOptPipelineBackendOptions) {
|
||||
process(
|
||||
output: ResultLine[],
|
||||
_: ParseFiltersAndOutputOptions,
|
||||
llvmOptPipelineOptions: LLVMOptPipelineBackendOptions,
|
||||
) {
|
||||
// Crop out any junk before the pass dumps (e.g. warnings)
|
||||
const ir = output.slice(
|
||||
output.findIndex(line => line.text.match(this.irDumpHeader) || line.text.match(this.machineCodeDumpHeader)),
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {CompilerFilters} from '../types/features/filters.interfaces';
|
||||
import {CompilerOutputOptions} from '../types/features/filters.interfaces';
|
||||
import {LLVMOptPipelineViewState} from './panes/llvm-opt-pipeline.interfaces';
|
||||
|
||||
export const COMPILER_COMPONENT_NAME = 'compiler';
|
||||
export const EXECUTOR_COMPONENT_NAME = 'executor';
|
||||
export const EDITOR_COMPONENT_NAME = 'codeEditor';
|
||||
@@ -67,7 +66,7 @@ type EmptyState = Record<never, never>;
|
||||
|
||||
export type EmptyCompilerState = StateWithLanguage & StateWithEditor;
|
||||
export type PopulatedCompilerState = StateWithEditor & {
|
||||
filters: CompilerFilters;
|
||||
filters: CompilerOutputOptions;
|
||||
options: unknown;
|
||||
compiler: string;
|
||||
libs?: unknown;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {CompilerFilters} from '../types/features/filters.interfaces';
|
||||
import {ParseFiltersAndOutputOptions} from '../types/features/filters.interfaces';
|
||||
import {
|
||||
EmptyCompilerState,
|
||||
ComponentConfig,
|
||||
@@ -126,7 +126,7 @@ export function getCompiler(editorId: number, lang: string): ComponentConfig<Emp
|
||||
*/
|
||||
export function getCompilerWith(
|
||||
editorId: number,
|
||||
filters: CompilerFilters,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
options: unknown,
|
||||
compilerId: string,
|
||||
langId?: string,
|
||||
@@ -222,7 +222,11 @@ export function getEditor(id?: number, langId?: string): ComponentConfig<EmptyEd
|
||||
}
|
||||
|
||||
/** Get an editor component with the given configuration. */
|
||||
export function getEditorWith(id: number, source: string, options): ComponentConfig<PopulatedEditorState> {
|
||||
export function getEditorWith(
|
||||
id: number,
|
||||
source: string,
|
||||
options: ParseFiltersAndOutputOptions
|
||||
): ComponentConfig<PopulatedEditorState> {
|
||||
return {
|
||||
type: 'component',
|
||||
componentName: EDITOR_COMPONENT_NAME,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {Language} from '../types/languages.interfaces';
|
||||
import {CompilerFilters} from '../types/features/filters.interfaces';
|
||||
import {CompilerOutputOptions} from '../types/features/filters.interfaces';
|
||||
import {MessageWithLocation} from '../types/resultline/resultline.interfaces';
|
||||
import {SiteSettings} from './settings';
|
||||
import {Theme} from './themes';
|
||||
@@ -86,13 +86,17 @@ export type EventMap = {
|
||||
) => void;
|
||||
executorClose: (executorId: number) => void;
|
||||
executorOpen: (executorId: number, editorId: boolean | number) => void;
|
||||
filtersChange: (compilerId: number, filters: CompilerFilters) => void;
|
||||
filtersChange: (compilerId: number, filters: CompilerOutputOptions) => void;
|
||||
findCompilers: () => void;
|
||||
findEditors: () => void;
|
||||
findExecutors: () => void;
|
||||
flagsViewClosed: (compilerId: number, options: string) => void;
|
||||
flagsViewOpened: (compilerId: number) => void;
|
||||
gccDumpFiltersChanged: (compilerId: number, filters: CompilerFilters, recompile: boolean) => void;
|
||||
gccDumpFiltersChanged: (
|
||||
compilerId: number,
|
||||
filters: CompilerOutputOptions,
|
||||
recompile: boolean
|
||||
) => void;
|
||||
gccDumpPassSelected: (compilerId: number, pass: GccSelectedPass, recompile: boolean) => void;
|
||||
gccDumpUIInit: (compilerId: number) => void;
|
||||
gccDumpViewClosed: (compilerId: number) => void;
|
||||
|
||||
@@ -51,8 +51,8 @@ import {CompilerState} from './compiler.interfaces';
|
||||
import {ComponentConfig, ToolViewState} from '../components.interfaces';
|
||||
import {FiledataPair} from '../multifile-service';
|
||||
import {LanguageLibs} from '../options.interfaces';
|
||||
import {CompilerFilters} from '../../types/features/filters.interfaces';
|
||||
import {GccSelectedPass} from './gccdump-view.interfaces';
|
||||
import {CompilerOutputOptions} from '../../types/features/filters.interfaces';
|
||||
import {Tool} from '../../lib/tooling/base-tool.interface';
|
||||
import {AssemblyInstructionInfo} from '../../lib/asm-docs/base';
|
||||
import {PPOptions} from './pp-view.interfaces';
|
||||
@@ -2155,9 +2155,10 @@ export class Compiler extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Co
|
||||
|
||||
onGccDumpFiltersChanged(
|
||||
id: number,
|
||||
filters: CompilerFilters & Record<string, boolean | undefined>,
|
||||
filters: CompilerOutputOptions & Record<string, boolean | undefined>,
|
||||
reqCompile: boolean
|
||||
): void {
|
||||
|
||||
if (this.id === id) {
|
||||
this.treeDumpEnabled = filters.treeDump !== false;
|
||||
this.rtlDumpEnabled = filters.rtlDump !== false;
|
||||
|
||||
@@ -40,7 +40,7 @@ import * as monacoConfig from '../monaco-config';
|
||||
import {GccDumpFilters, GccDumpState} from './gccdump-view.interfaces';
|
||||
|
||||
import {ga} from '../analytics';
|
||||
import {CompilerFilters} from '../../types/features/filters.interfaces';
|
||||
import {CompilerOutputOptions} from '../../types/features/filters.interfaces';
|
||||
|
||||
export class GccDump extends MonacoPane<monaco.editor.IStandaloneCodeEditor, GccDumpState> {
|
||||
selectize: TomSelect;
|
||||
@@ -114,7 +114,7 @@ export class GccDump extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Gcc
|
||||
this.eventHub.emit(
|
||||
'gccDumpFiltersChanged',
|
||||
this.compilerInfo.compilerId,
|
||||
this.getEffectiveFilters() as CompilerFilters,
|
||||
this.getEffectiveFilters() as CompilerOutputOptions,
|
||||
false
|
||||
);
|
||||
|
||||
@@ -397,7 +397,7 @@ export class GccDump extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Gcc
|
||||
this.eventHub.emit(
|
||||
'gccDumpFiltersChanged',
|
||||
this.compilerInfo.compilerId,
|
||||
this.getEffectiveFilters() as unknown as CompilerFilters,
|
||||
this.getEffectiveFilters() as unknown as CompilerOutputOptions,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,22 +22,25 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
export type CompilerFilters = {
|
||||
// These options are used both for the output options and our filtering passes
|
||||
// applied to the compiler output. They correspond to the "Compiler output
|
||||
// options" and "Compiler output filters" drop down menu in a compiler pane.
|
||||
|
||||
export type CompilerOutputOptions = {
|
||||
binary: boolean;
|
||||
execute: boolean;
|
||||
demangle: boolean;
|
||||
intel: boolean;
|
||||
};
|
||||
|
||||
export type preProcessLinesFunc = (lines: string[]) => string[];
|
||||
export type ParseFiltersAndOutputOptions = {
|
||||
labels: boolean;
|
||||
libraryCode: boolean;
|
||||
directives: boolean;
|
||||
commentOnly: boolean;
|
||||
trim: boolean;
|
||||
};
|
||||
|
||||
export type preProcessLinesFunc = (lines: string[]) => string[];
|
||||
|
||||
export type ParseFilters = CompilerFilters & {
|
||||
dontMaskFilenames?: boolean;
|
||||
optOutput: boolean;
|
||||
preProcessLines?: preProcessLinesFunc;
|
||||
};
|
||||
} & CompilerOutputOptions;
|
||||
|
||||
Reference in New Issue
Block a user