mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
Binge of (mostly) mindless tsification (#6838)
Turned on `noImplicitAny` in tsconfig, then went around fixing some random easy stuff. Hopefully tsification-PRs with more real content coming up.
This commit is contained in:
4
app.ts
4
app.ts
@@ -700,11 +700,11 @@ async function main() {
|
||||
return options;
|
||||
}
|
||||
|
||||
function isMobileViewer(req) {
|
||||
function isMobileViewer(req: express.Request) {
|
||||
return req.header('CloudFront-Is-Mobile-Viewer') === 'true';
|
||||
}
|
||||
|
||||
function renderGoldenLayout(config, metadata, req, res) {
|
||||
function renderGoldenLayout(config, metadata, req: express.Request, res: express.Response) {
|
||||
staticHeaders(res);
|
||||
contentPolicyHeader(res);
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ export async function initConfig(properties: PropertyGetter) {
|
||||
awsConfig = await loadAwsConfig(properties);
|
||||
}
|
||||
|
||||
export function getConfig(name): string {
|
||||
export function getConfig(name: string): string {
|
||||
if (!awsConfigInit) throw new Error("Reading AWS config before it's loaded");
|
||||
return awsConfig[name] || unwrap(awsProps)<string>(name);
|
||||
}
|
||||
|
||||
@@ -588,11 +588,11 @@ export class BaseCompiler implements ICompiler {
|
||||
}
|
||||
|
||||
async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean | undefined,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
@@ -651,7 +651,7 @@ export class BaseCompiler implements ICompiler {
|
||||
};
|
||||
}
|
||||
|
||||
protected filename(fn) {
|
||||
protected filename(fn: string) {
|
||||
return fn;
|
||||
}
|
||||
|
||||
@@ -1167,7 +1167,7 @@ export class BaseCompiler implements ICompiler {
|
||||
return userOptions;
|
||||
}
|
||||
|
||||
async generateAST(inputFilename, options): Promise<ResultLine[]> {
|
||||
async generateAST(inputFilename: string, options: string[]): Promise<ResultLine[]> {
|
||||
// These options make Clang produce an AST dump
|
||||
const newOptions = options
|
||||
.filter(option => option !== '-fcolor-diagnostics')
|
||||
@@ -1659,7 +1659,11 @@ export class BaseCompiler implements ICompiler {
|
||||
else return null;
|
||||
}
|
||||
|
||||
async checkOutputFileAndDoPostProcess(asmResult, outputFilename: string, filters: ParseFiltersAndOutputOptions) {
|
||||
async checkOutputFileAndDoPostProcess(
|
||||
asmResult: CompilationResult,
|
||||
outputFilename: string,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
try {
|
||||
const stat = await fs.stat(outputFilename);
|
||||
asmResult.asmSize = stat.size;
|
||||
@@ -2030,7 +2034,7 @@ export class BaseCompiler implements ICompiler {
|
||||
}
|
||||
|
||||
async handleExecution(
|
||||
key,
|
||||
key: CacheKey,
|
||||
executeParameters: ExecutableExecutionOptions,
|
||||
bypassCache: BypassCache,
|
||||
): Promise<CompilationResult> {
|
||||
@@ -3126,8 +3130,8 @@ but nothing was dumped. Possible causes are:
|
||||
outputFilename,
|
||||
result,
|
||||
maxSize,
|
||||
filters.intel,
|
||||
filters.demangle,
|
||||
!!filters.intel,
|
||||
!!filters.demangle,
|
||||
filters.binaryObject,
|
||||
false,
|
||||
filters,
|
||||
|
||||
@@ -107,7 +107,7 @@ export class BaseCFGParser {
|
||||
let rangeBb: BBRange = {nameId: functionName, start: first, end: 0, actionPos: []};
|
||||
const result: BBRange[] = [];
|
||||
|
||||
const newRangeWith = function (oldRange, nameId, start) {
|
||||
const newRangeWith = function (oldRange: BBRange, nameId: string, start: number) {
|
||||
return {nameId: nameId, start: start, actionPos: [], end: oldRange.end};
|
||||
};
|
||||
|
||||
|
||||
@@ -25,11 +25,13 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
export class AdaCompiler extends BaseCompiler {
|
||||
@@ -37,7 +39,7 @@ export class AdaCompiler extends BaseCompiler {
|
||||
return 'ada';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.outputFilebase = 'example';
|
||||
@@ -85,7 +87,7 @@ export class AdaCompiler extends BaseCompiler {
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
libraries,
|
||||
libraries: CompileChildLibraries[],
|
||||
overrides: ConfiguredOverrides,
|
||||
) {
|
||||
backendOptions = backendOptions || {};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
// Plain compiler, which just runs the tool and returns whatever the output was
|
||||
export class AnalysisTool extends BaseCompiler {
|
||||
@@ -31,7 +32,7 @@ export class AnalysisTool extends BaseCompiler {
|
||||
return 'analysis-tool';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
// Default is to disable all "cosmetic" filters
|
||||
|
||||
@@ -27,10 +27,11 @@ import path from 'path';
|
||||
|
||||
import _ from 'underscore';
|
||||
|
||||
import type {BuildResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {BuildResult, CompilationResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {AsmRaw} from '../parsers/asm-raw.js';
|
||||
import {fileExists} from '../utils.js';
|
||||
|
||||
@@ -41,7 +42,7 @@ export class AssemblyCompiler extends BaseCompiler {
|
||||
return 'assembly';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.asm = new AsmRaw();
|
||||
}
|
||||
@@ -59,7 +60,7 @@ export class AssemblyCompiler extends BaseCompiler {
|
||||
return [];
|
||||
}
|
||||
|
||||
getGeneratedOutputFilename(fn: string) {
|
||||
getGeneratedOutputFilename(fn: string): string {
|
||||
const outputFolder = path.dirname(fn);
|
||||
const files = fs.readdirSync(outputFolder);
|
||||
|
||||
@@ -77,7 +78,7 @@ export class AssemblyCompiler extends BaseCompiler {
|
||||
return this.getGeneratedOutputFilename(path.join(dirPath, 'example.asm'));
|
||||
}
|
||||
|
||||
async runReadelf(fullResult, objectFilename) {
|
||||
async runReadelf(fullResult: BuildResult, objectFilename: string) {
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
execOptions.customCwd = path.dirname(objectFilename);
|
||||
return await this.doBuildstepAndAddToResult(
|
||||
@@ -89,7 +90,7 @@ export class AssemblyCompiler extends BaseCompiler {
|
||||
);
|
||||
}
|
||||
|
||||
async getArchitecture(fullResult, objectFilename) {
|
||||
async getArchitecture(fullResult: BuildResult, objectFilename: string) {
|
||||
const result = await this.runReadelf(fullResult, objectFilename);
|
||||
const output = result.stdout.map(line => line.text).join('\n');
|
||||
if (output.includes('ELF32') && output.includes('80386')) {
|
||||
@@ -183,7 +184,11 @@ export class AssemblyCompiler extends BaseCompiler {
|
||||
return fullResult;
|
||||
}
|
||||
|
||||
override checkOutputFileAndDoPostProcess(asmResult, outputFilename, filters: ParseFiltersAndOutputOptions) {
|
||||
override checkOutputFileAndDoPostProcess(
|
||||
asmResult: CompilationResult,
|
||||
outputFilename: string,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
return this.postProcess(asmResult, outputFilename, filters);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {ExecutionOptions} from '../../types/compilation/compilation.interfa
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class AvrGcc6502Compiler extends BaseCompiler {
|
||||
private readonly avrgccpath: string;
|
||||
@@ -38,7 +39,7 @@ export class AvrGcc6502Compiler extends BaseCompiler {
|
||||
return 'avrgcc6502';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.avrgccpath = this.compilerProps<string>(`compiler.${this.compiler.id}.avrgccpath`);
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {ArtifactType} from '../../types/tool.interfaces.js';
|
||||
import {addArtifactToResult} from '../artifact-utils.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {AsmParserBeebAsm} from '../parsers/asm-parser-beebasm.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -39,7 +40,7 @@ export class BeebAsmCompiler extends BaseCompiler {
|
||||
return 'beebasm';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.asm = new AsmParserBeebAsm(this.compilerProps);
|
||||
|
||||
@@ -3,13 +3,14 @@ import path from 'path';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class C3Compiler extends BaseCompiler {
|
||||
static get key() {
|
||||
return 'c3c';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIrView = true;
|
||||
this.compiler.irArg = ['--emit-llvm'];
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import type {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {BaseParser} from './argument-parsers.js';
|
||||
|
||||
@@ -36,7 +37,7 @@ export class CarbonCompiler extends BaseCompiler {
|
||||
return 'carbon';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.compiler.demangler = '';
|
||||
this.demanglerClass = null;
|
||||
|
||||
@@ -27,12 +27,13 @@ import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import _ from 'underscore';
|
||||
|
||||
import type {CompilationResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {CompilationResult, CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {ArtifactType} from '../../types/tool.interfaces.js';
|
||||
import {addArtifactToResult} from '../artifact-utils.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {CC65AsmParser} from '../parsers/asm-parser-cc65.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -41,14 +42,14 @@ export class Cc65Compiler extends BaseCompiler {
|
||||
return 'cc65';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.asm = new CC65AsmParser(this.compilerProps);
|
||||
this.toolchainPath = path.resolve(path.dirname(compilerInfo.exe), '..');
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath?) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
const libPathFlag = this.compiler.libpathFlag || '-L';
|
||||
|
||||
if (!libDownloadPath) {
|
||||
@@ -96,11 +97,11 @@ export class Cc65Compiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: CompilationResult,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
|
||||
@@ -29,6 +29,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -37,7 +38,7 @@ export class CerberusCompiler extends BaseCompiler {
|
||||
return 'cerberus';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
// Default is to disable all "cosmetic" filters
|
||||
@@ -61,7 +62,7 @@ export class CerberusCompiler extends BaseCompiler {
|
||||
return path.join(dirPath, `${path.basename(this.compileFilename, this.lang.extensions[0])}.co`);
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number) {
|
||||
override async objdump(outputFilename: string, result: any, maxSize: number) {
|
||||
if (!(await utils.fileExists(outputFilename))) {
|
||||
result.asm = '<No output file ' + outputFilename + '>';
|
||||
return result;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import path from 'path';
|
||||
|
||||
import {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
|
||||
import {CircleParser} from './argument-parsers.js';
|
||||
@@ -38,7 +39,7 @@ export class CircleCompiler extends BaseCompiler {
|
||||
return CircleParser;
|
||||
}
|
||||
|
||||
override optionsForFilter(filters, outputFilename) {
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string) {
|
||||
let options = [`-o=${this.filename(outputFilename)}`];
|
||||
if (this.compiler.intelAsm && filters.intel && !filters.binary) {
|
||||
options = options.concat(this.compiler.intelAsm.split(' '));
|
||||
@@ -49,16 +50,16 @@ export class CircleCompiler extends BaseCompiler {
|
||||
return options;
|
||||
}
|
||||
|
||||
override getOutputFilename(dirPath, outputFilebase) {
|
||||
override getOutputFilename(dirPath: string, outputFilebase: string) {
|
||||
// Do not add '.s' as default implementation does,
|
||||
// because circle emit assembly file instead of executable.
|
||||
return path.join(dirPath, outputFilebase);
|
||||
}
|
||||
|
||||
override async runCompiler(
|
||||
compiler,
|
||||
options,
|
||||
inputFilename,
|
||||
compiler: string,
|
||||
options: string[],
|
||||
inputFilename: string,
|
||||
execOptions: ExecutionOptions & {env: Record<string, string>},
|
||||
) {
|
||||
if (!execOptions) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import path from 'path';
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {BaseParser} from './argument-parsers.js';
|
||||
|
||||
@@ -34,7 +35,7 @@ export class CIRCTCompiler extends BaseCompiler {
|
||||
return 'circt';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
disabledFilters: [
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {changeExtension} from '../utils.js';
|
||||
|
||||
export class CL430Compiler extends BaseCompiler {
|
||||
@@ -32,7 +33,7 @@ export class CL430Compiler extends BaseCompiler {
|
||||
return 'cl430';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
// We need to have the same name for the C/C++ file as we expect for the output file
|
||||
|
||||
@@ -314,7 +314,7 @@ export class ClangCudaCompiler extends ClangCompiler {
|
||||
return 'clang-cuda';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.asm = new SassAsmParser();
|
||||
@@ -328,7 +328,7 @@ export class ClangCudaCompiler extends ClangCompiler {
|
||||
return ['-o', this.filename(outputFilename), '-g1', filters.binary ? '-c' : '-S'];
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result, maxSize) {
|
||||
override async objdump(outputFilename: string, result, maxSize) {
|
||||
// For nvdisasm.
|
||||
const args = [...this.compiler.objdumperArgs, outputFilename, '-c', '-g', '-hex'];
|
||||
const execOptions = {maxOutput: maxSize, customCwd: path.dirname(outputFilename)};
|
||||
@@ -349,7 +349,7 @@ export class ClangHipCompiler extends ClangCompiler {
|
||||
return 'clang-hip';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.asm = new AmdgpuAsmParser();
|
||||
@@ -365,7 +365,7 @@ export class ClangIntelCompiler extends ClangCompiler {
|
||||
return 'clang-intel';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
if (!this.offloadBundlerPath) {
|
||||
@@ -400,7 +400,7 @@ export class ClangHexagonCompiler extends ClangCompiler {
|
||||
return 'clang-hexagon';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.asm = new HexagonAsmParser();
|
||||
@@ -412,7 +412,7 @@ export class ClangDxcCompiler extends ClangCompiler {
|
||||
return 'clang-dxc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.compiler.supportsIntel = false;
|
||||
|
||||
@@ -28,6 +28,7 @@ import {LLVMIrBackendOptions} from '../../types/compilation/ir.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {Win32Compiler} from './win32.js';
|
||||
|
||||
@@ -36,7 +37,7 @@ export class ClangCLCompiler extends Win32Compiler {
|
||||
return 'clang-cl';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.compiler.supportsIrView = true;
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {ExecutionOptions} from '../../types/compilation/compilation.interfa
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import {SPIRVAsmParser} from '../parsers/asm-parser-spirv.js';
|
||||
import * as utils from '../utils.js';
|
||||
@@ -39,7 +40,7 @@ export class CLSPVCompiler extends BaseCompiler {
|
||||
return 'clspv';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.asm = new SPIRVAsmParser(this.compilerProps);
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {AsmParserCpp} from '../parsers/asm-parser-cpp.js';
|
||||
|
||||
export class CppFrontCompiler extends BaseCompiler {
|
||||
@@ -34,7 +36,7 @@ export class CppFrontCompiler extends BaseCompiler {
|
||||
return 'cppfront';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.asm = new AsmParserCpp();
|
||||
@@ -49,7 +51,7 @@ export class CppFrontCompiler extends BaseCompiler {
|
||||
return [];
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {CrystalAsmParser} from '../parsers/asm-parser-crystal.js';
|
||||
|
||||
import {CrystalParser} from './argument-parsers.js';
|
||||
@@ -42,7 +43,7 @@ export class CrystalCompiler extends BaseCompiler {
|
||||
|
||||
ccPath: string;
|
||||
|
||||
constructor(compiler: PreliminaryCompilerInfo, env) {
|
||||
constructor(compiler: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compiler, env);
|
||||
this.asm = new CrystalAsmParser();
|
||||
this.compiler.supportsIrView = true;
|
||||
|
||||
@@ -34,6 +34,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in
|
||||
import type {SelectedLibraryVersion} from '../../types/libraries/libraries.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler, SimpleOutputFilenameCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
|
||||
import {JavaCompiler} from './java.js';
|
||||
@@ -54,7 +55,7 @@ export class D8Compiler extends BaseCompiler implements SimpleOutputFilenameComp
|
||||
|
||||
libPaths: string[];
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super({...compilerInfo}, env);
|
||||
|
||||
this.lineNumberRegex = /^\s+\.line\s+(\d+).*$/;
|
||||
@@ -176,7 +177,7 @@ export class D8Compiler extends BaseCompiler implements SimpleOutputFilenameComp
|
||||
};
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number) {
|
||||
override async objdump(outputFilename: string, result: any, maxSize: number) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
|
||||
const javaCompiler = unwrap(
|
||||
|
||||
@@ -26,17 +26,19 @@ import path from 'path';
|
||||
|
||||
import Semver from 'semver';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {DartAsmParser} from '../parsers/asm-parser-dart.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
import {BaseParser} from './argument-parsers.js';
|
||||
|
||||
export class DartCompiler extends BaseCompiler {
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.asm = new DartAsmParser();
|
||||
}
|
||||
@@ -51,7 +53,7 @@ export class DartCompiler extends BaseCompiler {
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
libraries,
|
||||
libraries: CompileChildLibraries[],
|
||||
overrides: ConfiguredOverrides,
|
||||
) {
|
||||
let options = this.optionsForFilter(filters, outputFilename, userOptions);
|
||||
|
||||
@@ -39,6 +39,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in
|
||||
import type {SelectedLibraryVersion} from '../../types/libraries/libraries.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler, SimpleOutputFilenameCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {Dex2OatPassDumpParser} from '../parsers/dex2oat-pass-dump-parser.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -74,7 +75,7 @@ export class Dex2OatCompiler extends BaseCompiler {
|
||||
|
||||
libs: SelectedLibraryVersion[];
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super({...compilerInfo}, env);
|
||||
this.compiler.optPipeline = {
|
||||
arg: ['-print-after-all', '-print-before-all'],
|
||||
@@ -313,7 +314,7 @@ export class Dex2OatCompiler extends BaseCompiler {
|
||||
return {path: binaryFormatProfile, result: result};
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number) {
|
||||
override async objdump(outputFilename: string, result: any, maxSize: number) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
const files = await fs.readdir(dirPath);
|
||||
const odexFile = files.find(f => f.endsWith('.odex'));
|
||||
|
||||
@@ -27,6 +27,7 @@ import path from 'path';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {ClangParser} from './argument-parsers.js';
|
||||
|
||||
@@ -35,7 +36,7 @@ export class DMDCompiler extends BaseCompiler {
|
||||
return 'dmd';
|
||||
}
|
||||
|
||||
constructor(compiler: PreliminaryCompilerInfo, env) {
|
||||
constructor(compiler: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compiler, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import fs from 'fs-extra';
|
||||
import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import * as exec from '../exec.js';
|
||||
import {logger} from '../logger.js';
|
||||
import {TurboCAsmParser} from '../parsers/asm-parser-turboc.js';
|
||||
@@ -37,7 +38,7 @@ export class DosboxCompiler extends BaseCompiler {
|
||||
private readonly dosbox: string;
|
||||
private readonly root: string;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.dosbox = this.compilerProps<string>(`compiler.${this.compiler.id}.dosbox`);
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {AssemblyName, DotnetExtraConfiguration} from '../execution/dotnet-execution-env.js';
|
||||
import {IExecutionEnvironment} from '../execution/execution-env.interfaces.js';
|
||||
import {DotNetAsmParser} from '../parsers/asm-parser-dotnet.js';
|
||||
@@ -48,7 +49,7 @@ class DotNetCompiler extends BaseCompiler {
|
||||
private readonly ilcPath: string;
|
||||
private readonly sdkMajorVersion: number;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.sdkBaseDir = path.join(path.dirname(compilerInfo.exe), 'sdk');
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {AsmEWAVRParser} from '../parsers/asm-parser-ewavr.js';
|
||||
|
||||
export class EWARMCompiler extends BaseCompiler {
|
||||
@@ -32,7 +33,7 @@ export class EWARMCompiler extends BaseCompiler {
|
||||
return 'ewarm';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.asm = new AsmEWAVRParser(this.compilerProps);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {AsmEWAVRParser} from '../parsers/asm-parser-ewavr.js';
|
||||
|
||||
export class EWAVRCompiler extends BaseCompiler {
|
||||
@@ -32,7 +33,7 @@ export class EWAVRCompiler extends BaseCompiler {
|
||||
return 'ewavr';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
info.supportsDemangle = false;
|
||||
info.supportsLibraryCodeFilter = false;
|
||||
super(info, env);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import _ from 'underscore';
|
||||
|
||||
import {BypassCache} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {ICompiler} from '../../types/compiler.interfaces.js';
|
||||
import {CompilerArguments} from '../compiler-arguments.js';
|
||||
|
||||
@@ -71,7 +72,17 @@ export class FakeCompiler implements ICompiler {
|
||||
return null;
|
||||
}
|
||||
|
||||
compile(source, options, backendOptions, filters, bypassCache, tools, executeParameters, libraries, files) {
|
||||
compile(
|
||||
source,
|
||||
options,
|
||||
backendOptions,
|
||||
filters,
|
||||
bypassCache: BypassCache,
|
||||
tools,
|
||||
executeParameters,
|
||||
libraries,
|
||||
files,
|
||||
) {
|
||||
const inputBody = {
|
||||
input: {
|
||||
source: source,
|
||||
|
||||
@@ -22,17 +22,19 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class FlangFC1Compiler extends BaseCompiler {
|
||||
static get key() {
|
||||
return 'flang-fc1';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
disabledFilters: [
|
||||
@@ -59,7 +61,7 @@ export class FlangFC1Compiler extends BaseCompiler {
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
libraries,
|
||||
libraries: CompileChildLibraries[],
|
||||
overrides: ConfiguredOverrides,
|
||||
) {
|
||||
let options = ['-fc1'];
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {GCCCompiler} from './gcc.js';
|
||||
|
||||
@@ -32,7 +33,7 @@ export class GCCRSCompiler extends GCCCompiler {
|
||||
return 'gccrs';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsVerboseDemangling = true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {CompileChildLibraries, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
@@ -74,11 +74,11 @@ export class GnuCobolCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
@@ -122,7 +122,7 @@ export class GnuCobolCompiler extends BaseCompiler {
|
||||
return path.join(dirPath, outputFilebase);
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in
|
||||
import type {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
import {GolangParser} from './argument-parsers.js';
|
||||
@@ -58,7 +59,7 @@ export class GolangCompiler extends BaseCompiler {
|
||||
return 'golang';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
const group = this.compiler.group;
|
||||
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {GHCParser} from './argument-parsers.js';
|
||||
|
||||
@@ -35,7 +37,7 @@ export class HaskellCompiler extends BaseCompiler {
|
||||
return 'haskell';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsHaskellCoreView = true;
|
||||
this.compiler.supportsHaskellStgView = true;
|
||||
@@ -71,7 +73,7 @@ export class HaskellCompiler extends BaseCompiler {
|
||||
return options;
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[]) {
|
||||
const libPathFlag = this.compiler.libpathFlag || '-L';
|
||||
return [libPathFlag + '.', ...this.getSharedLibraryPaths(libraries).map(path => libPathFlag + path)];
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export class HLSLCompiler extends BaseCompiler {
|
||||
};
|
||||
}
|
||||
|
||||
override async generateAST(inputFilename, options): Promise<ResultLine[]> {
|
||||
override async generateAST(inputFilename: string, options: string[]): Promise<ResultLine[]> {
|
||||
// These options make DXC produce an AST dump
|
||||
const newOptions = options
|
||||
.filter(option => option !== '-Zi' && option !== '-Qembed_debug')
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in
|
||||
import type {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {asSafeVer} from '../utils.js';
|
||||
|
||||
import {ISPCParser} from './argument-parsers.js';
|
||||
@@ -39,7 +40,7 @@ export class ISPCCompiler extends BaseCompiler {
|
||||
return 'ispc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIrView = true;
|
||||
this.compiler.irArg = ['--emit-llvm-text'];
|
||||
@@ -77,7 +78,7 @@ export class ISPCCompiler extends BaseCompiler {
|
||||
return ISPCParser;
|
||||
}
|
||||
|
||||
override async generateAST(inputFilename, options): Promise<ResultLine[]> {
|
||||
override async generateAST(inputFilename: string, options: string[]): Promise<ResultLine[]> {
|
||||
// These options make Clang produce an AST dump
|
||||
const newOptions = options.filter(option => option !== '--colored-output').concat(['--ast-dump']);
|
||||
|
||||
|
||||
@@ -24,16 +24,18 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class JaktCompiler extends BaseCompiler {
|
||||
static get key() {
|
||||
return 'jakt';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.outputFilebase = 'example';
|
||||
@@ -44,11 +46,11 @@ export class JaktCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
@@ -83,7 +85,7 @@ export class JaktCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
// We have no dynamic linking in Jakt
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import {ExecutableExecutionOptions} from '../../types/execution/execution.interf
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler, SimpleOutputFilenameCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -47,7 +48,7 @@ export class JavaCompiler extends BaseCompiler implements SimpleOutputFilenameCo
|
||||
javaRuntime: string;
|
||||
mainRegex: RegExp;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
// Default is to disable all "cosmetic" filters
|
||||
@@ -64,7 +65,7 @@ export class JavaCompiler extends BaseCompiler implements SimpleOutputFilenameCo
|
||||
return [];
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number) {
|
||||
override async objdump(outputFilename: string, result: any, maxSize: number) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
const files = await fs.readdir(dirPath);
|
||||
logger.verbose('Class files: ', files);
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {CompilationResult, ExecutionOptions} from '../../types/compilation/
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
import {JuliaParser} from './argument-parsers.js';
|
||||
@@ -39,7 +40,7 @@ export class JuliaCompiler extends BaseCompiler {
|
||||
return 'julia';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIrView = true;
|
||||
this.compiler.irArg = ['--format=llvm-module'];
|
||||
|
||||
@@ -27,6 +27,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {SimpleOutputFilenameCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {KotlinParser} from './argument-parsers.js';
|
||||
import {JavaCompiler} from './java.js';
|
||||
@@ -38,7 +39,7 @@ export class KotlinCompiler extends JavaCompiler implements SimpleOutputFilename
|
||||
|
||||
javaHome: string;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.javaHome = this.compilerProps<string>(`compiler.${this.compiler.id}.java_home`);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {CompilationResult} from '../../types/compilation/compilation.interf
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -43,7 +44,7 @@ export class LDCCompiler extends BaseCompiler {
|
||||
|
||||
asanSymbolizerPath: string;
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
this.compiler.supportsIrView = true;
|
||||
@@ -102,7 +103,7 @@ export class LDCCompiler extends BaseCompiler {
|
||||
return versionMatch ? semverParser.compare(versionMatch[1] + '.0', '1.4.0', true) >= 0 : false;
|
||||
}
|
||||
|
||||
override async generateAST(inputFilename, options): Promise<ResultLine[]> {
|
||||
override async generateAST(inputFilename: string, options: string[]): Promise<ResultLine[]> {
|
||||
// These options make LDC produce an AST dump in a separate file `<inputFilename>.cg`.
|
||||
const newOptions = options.concat('-vcg-ast');
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {ClangParser} from './argument-parsers.js';
|
||||
|
||||
@@ -33,7 +34,7 @@ export class LLCCompiler extends BaseCompiler {
|
||||
return 'llc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
this.compiler.optPipeline = {
|
||||
|
||||
@@ -29,6 +29,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {ArtifactType} from '../../types/tool.interfaces.js';
|
||||
import {addArtifactToResult} from '../artifact-utils.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
import {ClangCompiler} from './clang.js';
|
||||
@@ -38,7 +39,7 @@ export class LLVMMOSCompiler extends ClangCompiler {
|
||||
return 'llvmmos';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.externalparser = null;
|
||||
this.toolchainPath = path.normalize(path.join(path.dirname(this.compiler.exe), '..'));
|
||||
|
||||
@@ -160,11 +160,11 @@ export class MadPascalCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean | undefined,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
|
||||
@@ -27,6 +27,7 @@ import path from 'path';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {BaseParser} from './argument-parsers.js';
|
||||
|
||||
@@ -35,7 +36,7 @@ export class MLIRCompiler extends BaseCompiler {
|
||||
return 'mlir';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
disabledFilters: [
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
|
||||
@@ -38,7 +39,7 @@ export class NasmCompiler extends AssemblyCompiler {
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
libraries,
|
||||
libraries: CompileChildLibraries[],
|
||||
overrides: ConfiguredOverrides,
|
||||
) {
|
||||
let options = super.prepareArguments(
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {NimParser} from './argument-parsers.js';
|
||||
|
||||
@@ -41,12 +42,12 @@ export class NimCompiler extends BaseCompiler {
|
||||
return 'nim';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
}
|
||||
|
||||
cacheDir(outputFilename) {
|
||||
cacheDir(outputFilename: string) {
|
||||
return outputFilename + '.cache';
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {SassAsmParser} from '../parsers/asm-parser-sass.js';
|
||||
import {asSafeVer} from '../utils.js';
|
||||
|
||||
@@ -45,7 +46,7 @@ export class NvccCompiler extends BaseCompiler {
|
||||
|
||||
deviceAsmParser: SassAsmParser;
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsOptOutput = true;
|
||||
this.compiler.supportsDeviceAsmView = true;
|
||||
@@ -106,7 +107,7 @@ export class NvccCompiler extends BaseCompiler {
|
||||
const postProcess = _.compact(this.compiler.postProcess);
|
||||
const asmPromise = (
|
||||
filters.binary
|
||||
? this.objdump(outputFilename, {}, maxSize, filters.intel, filters.demangle, false, false, filters)
|
||||
? this.objdump(outputFilename, {}, maxSize, !!filters.intel, !!filters.demangle, false, false, filters)
|
||||
: (async () => {
|
||||
if (result.asmSize === undefined) {
|
||||
result.asm = '<No output file>';
|
||||
|
||||
@@ -29,6 +29,7 @@ import {CompilationInfo} from '../../types/compilation/compilation.interfaces.js
|
||||
import {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {SassAsmParser} from '../parsers/asm-parser-sass.js';
|
||||
|
||||
export class NvcppCompiler extends BaseCompiler {
|
||||
@@ -39,7 +40,7 @@ export class NvcppCompiler extends BaseCompiler {
|
||||
return 'nvcpp';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.cuobjdump = this.compilerProps<string | undefined>(
|
||||
|
||||
@@ -30,6 +30,7 @@ import {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {SassAsmParser} from '../parsers/asm-parser-sass.js';
|
||||
import {asSafeVer} from '../utils.js';
|
||||
|
||||
@@ -40,7 +41,7 @@ export class NvrtcCompiler extends BaseCompiler {
|
||||
return 'nvrtc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.asm = new SassAsmParser(this.compilerProps);
|
||||
@@ -54,7 +55,7 @@ export class NvrtcCompiler extends BaseCompiler {
|
||||
return ClangParser;
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number) {
|
||||
override async objdump(outputFilename: string, result: any, maxSize: number) {
|
||||
const {nvdisasm, semver} = this.compiler;
|
||||
|
||||
const args = Semver.lt(asSafeVer(semver), '11.0.0', true)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {PascalParser} from './argument-parsers.js';
|
||||
|
||||
@@ -33,7 +34,7 @@ export class OCamlCompiler extends BaseCompiler {
|
||||
return 'ocaml';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
// override output base because ocaml's -S -o has different semantics.
|
||||
// namely, it outputs a full binary exe to the supposed asm dump.
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {ClangParser} from './argument-parsers.js';
|
||||
|
||||
@@ -33,7 +34,7 @@ export class OptCompiler extends BaseCompiler {
|
||||
return 'opt';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.optPipeline = {
|
||||
arg: ['-print-after-all', '-print-before-all'],
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {MapFileReaderDelphi} from '../mapfiles/map-file-delphi.js';
|
||||
import {PELabelReconstructor} from '../pe32-support.js';
|
||||
import * as utils from '../utils.js';
|
||||
@@ -46,7 +47,7 @@ export class PascalWinCompiler extends BaseCompiler {
|
||||
dprFilename: string;
|
||||
pasUtils: PascalUtils;
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
info.supportsFiltersInBinary = true;
|
||||
|
||||
@@ -90,7 +91,7 @@ export class PascalWinCompiler extends BaseCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result, maxSize: number, intelAsm) {
|
||||
override async objdump(outputFilename: string, result, maxSize: number, intelAsm) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
const execBinary = this.getExecutableFilename(dirPath);
|
||||
if (await utils.fileExists(execBinary)) {
|
||||
|
||||
@@ -32,6 +32,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
import {PascalParser} from './argument-parsers.js';
|
||||
@@ -48,7 +49,7 @@ export class FPCCompiler extends BaseCompiler {
|
||||
pasUtils: PascalUtils;
|
||||
demangler: any | null = null;
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
|
||||
this.compileFilename = 'output.pas';
|
||||
@@ -108,11 +109,11 @@ export class FPCCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import type {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {SassAsmParser} from '../parsers/asm-parser-sass.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
@@ -39,7 +40,7 @@ export class PtxAssembler extends BaseCompiler {
|
||||
return 'ptxas';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compileFilename = 'example.ptxas';
|
||||
this.asm = new SassAsmParser();
|
||||
@@ -115,11 +116,15 @@ export class PtxAssembler extends BaseCompiler {
|
||||
return path.join(dirPath, `${outputFilebase}.cubin`);
|
||||
}
|
||||
|
||||
override checkOutputFileAndDoPostProcess(asmResult, outputFilename, filters: ParseFiltersAndOutputOptions) {
|
||||
override checkOutputFileAndDoPostProcess(
|
||||
asmResult: CompilationResult,
|
||||
outputFilename: string,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
) {
|
||||
return this.postProcess(asmResult, outputFilename, filters);
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number) {
|
||||
override async objdump(outputFilename: string, result: any, maxSize: number) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
const args = [...this.compiler.objdumperArgs, '-c', '-g', '-hex', outputFilename];
|
||||
const objResult = await this.exec(this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath});
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {AsmResultSource, ParsedAsmResultLine} from '../../types/asmresult/a
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {resolvePathFromAppRoot} from '../utils.js';
|
||||
|
||||
import {BaseParser} from './argument-parsers.js';
|
||||
@@ -37,7 +38,7 @@ export class PythonCompiler extends BaseCompiler {
|
||||
return 'python';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.compiler.demangler = '';
|
||||
this.demanglerClass = null;
|
||||
|
||||
@@ -4,6 +4,7 @@ import {CompileChildLibraries} from '../../types/compilation/compilation.interfa
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class PythranCompiler extends BaseCompiler {
|
||||
static get key() {
|
||||
@@ -12,7 +13,7 @@ export class PythranCompiler extends BaseCompiler {
|
||||
|
||||
cpp_compiler_root: string;
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.cpp_compiler_root = this.compilerProps<string>(`compiler.${this.compiler.id}.cpp_compiler_root`);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {SimpleOutputFilenameCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
|
||||
import {D8Compiler} from './d8.js';
|
||||
@@ -45,7 +46,7 @@ export class R8Compiler extends D8Compiler implements SimpleOutputFilenameCompil
|
||||
|
||||
kotlinLibPath: string;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super({...compilerInfo}, env);
|
||||
this.kotlinLibPath = this.compilerProps<string>(`group.${this.compiler.group}.kotlinLibPath`);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,11 @@ import path from 'path';
|
||||
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import type {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {
|
||||
CompilationResult,
|
||||
CompileChildLibraries,
|
||||
ExecutionOptions,
|
||||
} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {
|
||||
OptPipelineBackendOptions,
|
||||
OptPipelineOutput,
|
||||
@@ -34,6 +38,7 @@ import type {
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import {RacketPassDumpParser} from '../parsers/racket-pass-dump-parser.js';
|
||||
|
||||
@@ -45,7 +50,7 @@ export class RacketCompiler extends BaseCompiler {
|
||||
return 'racket';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(
|
||||
{
|
||||
// Disable output filters, as they currently don't do anything
|
||||
@@ -89,7 +94,7 @@ export class RacketCompiler extends BaseCompiler {
|
||||
return true;
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries: object[], libDownloadPath?: string): string[] {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string): string[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -142,13 +147,13 @@ export class RacketCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename: any,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm: any,
|
||||
demangle: any,
|
||||
staticReloc,
|
||||
dynamicReloc,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean | undefined,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
): Promise<any> {
|
||||
// Decompile to assembly via `raco decompile` with `disassemble` package
|
||||
|
||||
@@ -27,6 +27,7 @@ import path from 'path';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {resolvePathFromAppRoot} from '../utils.js';
|
||||
|
||||
import {BaseParser} from './argument-parsers.js';
|
||||
@@ -38,7 +39,7 @@ export class RubyCompiler extends BaseCompiler {
|
||||
return 'ruby';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.disasmScriptPath =
|
||||
this.compilerProps('disasmScript') || resolvePathFromAppRoot('etc', 'scripts', 'disasms', 'disasm.rb');
|
||||
|
||||
@@ -27,15 +27,17 @@ import path from 'path';
|
||||
import {SemVer} from 'semver';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {CompileChildLibraries, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {CompilerOverrideType, ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import {LLVMIrBackendOptions} from '../../types/compilation/ir.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {BasicExecutionResult, UnprocessedExecResult} from '../../types/execution/execution.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {SelectedLibraryVersion} from '../../types/libraries/libraries.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import type {BuildEnvDownloadInfo} from '../buildenvsetup/buildenv.interfaces.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {changeExtension, parseRustOutput} from '../utils.js';
|
||||
|
||||
import {RustParser} from './argument-parsers.js';
|
||||
@@ -47,7 +49,7 @@ export class RustCompiler extends BaseCompiler {
|
||||
return 'rust';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
this.compiler.supportsIrView = true;
|
||||
@@ -134,7 +136,7 @@ export class RustCompiler extends BaseCompiler {
|
||||
await super.populatePossibleOverrides();
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -142,7 +144,7 @@ export class RustCompiler extends BaseCompiler {
|
||||
return [];
|
||||
}
|
||||
|
||||
override getIncludeArguments(libraries) {
|
||||
override getIncludeArguments(libraries: SelectedLibraryVersion[]) {
|
||||
const includeFlag = '--extern';
|
||||
return libraries.flatMap(selectedLib => {
|
||||
const foundVersion = this.findLibVersion(selectedLib);
|
||||
|
||||
@@ -27,6 +27,7 @@ import path from 'path';
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {RustCompiler} from './rust.js';
|
||||
|
||||
@@ -35,7 +36,7 @@ export class RustcCgGCCCompiler extends RustCompiler {
|
||||
return 'rustc-cg-gcc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIrView = false;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import Semver from 'semver';
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {asSafeVer} from '../utils.js';
|
||||
|
||||
import {ScalaParser} from './argument-parsers.js';
|
||||
@@ -38,7 +39,7 @@ export class ScalaCompiler extends JavaCompiler {
|
||||
|
||||
javaHome: string;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.javaHome = this.compilerProps<string>(`compiler.${this.compiler.id}.java_home`);
|
||||
}
|
||||
|
||||
@@ -24,10 +24,12 @@
|
||||
|
||||
import _ from 'underscore';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class SnowballCompiler extends BaseCompiler {
|
||||
linker: string;
|
||||
@@ -36,7 +38,7 @@ export class SnowballCompiler extends BaseCompiler {
|
||||
return 'snowball';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
this.compiler.supportsIrView = true;
|
||||
@@ -51,7 +53,7 @@ export class SnowballCompiler extends BaseCompiler {
|
||||
this.linker = this.compilerProps<string>('linker');
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {asSafeVer} from '../utils.js';
|
||||
|
||||
export class SpiceCompiler extends BaseCompiler {
|
||||
@@ -41,7 +42,7 @@ export class SpiceCompiler extends BaseCompiler {
|
||||
return 'spice';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
this.compiler.supportsIrView = true;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {CompileChildLibraries, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import {LLVMIrBackendOptions} from '../../types/compilation/ir.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
@@ -32,6 +32,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in
|
||||
import {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import {SPIRVAsmParser} from '../parsers/asm-parser-spirv.js';
|
||||
import * as utils from '../utils.js';
|
||||
@@ -44,7 +45,7 @@ export class SPIRVCompiler extends BaseCompiler {
|
||||
return 'spirv';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.asm = new SPIRVAsmParser(this.compilerProps);
|
||||
@@ -59,7 +60,7 @@ export class SPIRVCompiler extends BaseCompiler {
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
libraries,
|
||||
libraries: CompileChildLibraries[],
|
||||
overrides: ConfiguredOverrides,
|
||||
) {
|
||||
let options = this.optionsForFilter(filters, outputFilename);
|
||||
@@ -190,7 +191,7 @@ export class SPIRVCompiler extends BaseCompiler {
|
||||
return super.runCompiler(compiler, newOptions, inputFilename, execOptions);
|
||||
}
|
||||
|
||||
override async generateAST(inputFilename, options): Promise<ResultLine[]> {
|
||||
override async generateAST(inputFilename: string, options: string[]): Promise<ResultLine[]> {
|
||||
const newOptions = options.filter(option => option !== '-fcolor-diagnostics').concat(['-ast-dump']);
|
||||
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {SwiftParser} from './argument-parsers.js';
|
||||
|
||||
@@ -32,7 +33,7 @@ export class SwiftCompiler extends BaseCompiler {
|
||||
return 'swift';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.optPipeline = {
|
||||
arg: ['-Xllvm', '-print-after-all', '-Xllvm', '-print-before-all'],
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {TiC2000AsmParser} from '../parsers/asm-parser-tic2000.js';
|
||||
|
||||
export class TIC2000 extends BaseCompiler {
|
||||
@@ -32,7 +34,7 @@ export class TIC2000 extends BaseCompiler {
|
||||
return 'tic2000';
|
||||
}
|
||||
|
||||
constructor(info, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.outputFilebase = this.compileFilename.split('.')[0];
|
||||
this.asm = new TiC2000AsmParser(this.compilerProps);
|
||||
|
||||
@@ -22,9 +22,11 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
import {ToitParser} from './argument-parsers.js';
|
||||
|
||||
@@ -33,7 +35,7 @@ export class ToitCompiler extends BaseCompiler {
|
||||
return 'toit';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
}
|
||||
@@ -42,12 +44,16 @@ export class ToitCompiler extends BaseCompiler {
|
||||
return outputFilename + '.cache';
|
||||
}
|
||||
|
||||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename, userOptions?): string[] {
|
||||
override optionsForFilter(
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
outputFilename: string,
|
||||
userOptions?: string[],
|
||||
): string[] {
|
||||
if (!filters.binary) return ['execute', outputFilename];
|
||||
return [outputFilename];
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries: object[], libDownloadPath: string) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
override getArgumentParser() {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {logger} from '../logger.js';
|
||||
|
||||
import {TurboCParser} from './argument-parsers.js';
|
||||
@@ -38,7 +39,7 @@ export class TurboCCompiler extends DosboxCompiler {
|
||||
return ['-B'];
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries: object[], libDownloadPath: string) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {asSafeVer, changeExtension} from '../utils.js';
|
||||
|
||||
import {TypeScriptNativeParser} from './argument-parsers.js';
|
||||
@@ -45,7 +46,7 @@ export class TypeScriptNativeCompiler extends BaseCompiler {
|
||||
tscNewOutput: boolean;
|
||||
tscAsmOutput: boolean;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.tscJit = this.compiler.exe;
|
||||
|
||||
@@ -24,7 +24,11 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {
|
||||
CompilationResult,
|
||||
CompileChildLibraries,
|
||||
ExecutionOptions,
|
||||
} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
@@ -81,7 +85,7 @@ export class VCompiler extends BaseCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath?: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,14 @@ import path from 'path';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class V8Compiler extends BaseCompiler {
|
||||
static get key() {
|
||||
return 'v8';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.compiler.demangler = '';
|
||||
this.demanglerClass = null;
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
|
||||
export class ValaCompiler extends BaseCompiler {
|
||||
static get key() {
|
||||
@@ -36,7 +38,7 @@ export class ValaCompiler extends BaseCompiler {
|
||||
ccPath: string;
|
||||
pkgconfigPath: string;
|
||||
|
||||
constructor(compiler: PreliminaryCompilerInfo, env) {
|
||||
constructor(compiler: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compiler, env);
|
||||
this.ccPath = this.compilerProps<string>(`compiler.${this.compiler.id}.cc`);
|
||||
this.pkgconfigPath = this.compilerProps<string>(`compiler.${this.compiler.id}.pkgconfigpath`);
|
||||
@@ -71,11 +73,11 @@ export class ValaCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
@@ -95,7 +97,7 @@ export class ValaCompiler extends BaseCompiler {
|
||||
return objdumpResult;
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries, libDownloadPath) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[], libDownloadPath: string | undefined) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {BuildResult, BypassCache, CompilationResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {BuildResult, BypassCache, CacheKey, CompilationResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {copyNeededDlls} from '../win-utils.js';
|
||||
|
||||
@@ -94,7 +95,11 @@ export class Win32MingWClang extends ClangCompiler {
|
||||
return result;
|
||||
}
|
||||
|
||||
override async handleExecution(key, executeParameters, bypassCache: BypassCache): Promise<CompilationResult> {
|
||||
override async handleExecution(
|
||||
key: CacheKey,
|
||||
executeParameters: ExecutableExecutionOptions,
|
||||
bypassCache: BypassCache,
|
||||
): Promise<CompilationResult> {
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
return super.handleExecution(key, {...executeParameters, env: execOptions.env}, bypassCache);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import {BuildResult, BypassCache, CompilationResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {BuildResult, BypassCache, CacheKey, CompilationResult} from '../../types/compilation/compilation.interfaces.js';
|
||||
import {ExecutableExecutionOptions} from '../../types/execution/execution.interfaces.js';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {copyNeededDlls} from '../win-utils.js';
|
||||
|
||||
@@ -94,7 +95,11 @@ export class Win32MingWGcc extends GCCCompiler {
|
||||
return result;
|
||||
}
|
||||
|
||||
override async handleExecution(key, executeParameters, bypassCache: BypassCache): Promise<CompilationResult> {
|
||||
override async handleExecution(
|
||||
key: CacheKey,
|
||||
executeParameters: ExecutableExecutionOptions,
|
||||
bypassCache: BypassCache,
|
||||
): Promise<CompilationResult> {
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
return super.handleExecution(key, {...executeParameters, env: execOptions.env}, bypassCache);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {VcAsmParser} from '../parsers/asm-parser-vc.js';
|
||||
|
||||
import {VCParser} from './argument-parsers.js';
|
||||
@@ -33,7 +34,7 @@ export class Win32VcCompiler extends Win32Compiler {
|
||||
return 'win32-vc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.asm = new VcAsmParser(this.compilerProps);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {Vc6AsmParser} from '../parsers/asm-parser-vc6.js';
|
||||
|
||||
import {VCParser} from './argument-parsers.js';
|
||||
@@ -33,7 +34,7 @@ export class Win32Vc6Compiler extends Win32Compiler {
|
||||
return 'win32-vc6';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.asm = new Vc6AsmParser(this.compilerProps);
|
||||
}
|
||||
|
||||
@@ -26,12 +26,13 @@ import path from 'path';
|
||||
|
||||
import _ from 'underscore';
|
||||
|
||||
import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {CompileChildLibraries, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {ConfiguredOverrides} from '../../types/compilation/compiler-overrides.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {MapFileReaderVS} from '../mapfiles/map-file-vs.js';
|
||||
import {AsmParser} from '../parsers/asm-parser.js';
|
||||
import {PELabelReconstructor} from '../pe32-support.js';
|
||||
@@ -44,7 +45,7 @@ export class Win32Compiler extends BaseCompiler {
|
||||
|
||||
binaryAsmParser: AsmParser;
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
|
||||
this.binaryAsmParser = new AsmParser(this.compilerProps);
|
||||
@@ -62,7 +63,7 @@ export class Win32Compiler extends BaseCompiler {
|
||||
return this.getExecutableFilename(path.dirname(defaultOutputFilename), 'output');
|
||||
}
|
||||
|
||||
override getSharedLibraryPathsAsArguments(libraries) {
|
||||
override getSharedLibraryPathsAsArguments(libraries: CompileChildLibraries[]) {
|
||||
const libPathFlag = this.compiler.libpathFlag || '/LIBPATH:';
|
||||
|
||||
return this.getSharedLibraryPaths(libraries).map(path => libPathFlag + path);
|
||||
@@ -92,7 +93,7 @@ export class Win32Compiler extends BaseCompiler {
|
||||
backendOptions: Record<string, any>,
|
||||
inputFilename: string,
|
||||
outputFilename: string,
|
||||
libraries,
|
||||
libraries: CompileChildLibraries[],
|
||||
overrides: ConfiguredOverrides,
|
||||
) {
|
||||
let options = this.optionsForFilter(filters, outputFilename, userOptions);
|
||||
|
||||
@@ -28,6 +28,7 @@ import type {ExecutionOptions} from '../../types/compilation/compilation.interfa
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {MapFileReaderVS} from '../mapfiles/map-file-vs.js';
|
||||
import {VcAsmParser} from '../parsers/asm-parser-vc.js';
|
||||
import {PELabelReconstructor} from '../pe32-support.js';
|
||||
@@ -39,7 +40,7 @@ export class WineVcCompiler extends BaseCompiler {
|
||||
return 'wine-vc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
info.supportsFiltersInBinary = true;
|
||||
super(info, env);
|
||||
this.asm = new VcAsmParser();
|
||||
|
||||
@@ -31,6 +31,7 @@ import path from 'path';
|
||||
import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
|
||||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import {unwrap} from '../assert.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {VcAsmParser} from '../parsers/asm-parser-vc.js';
|
||||
|
||||
import {Win32VcCompiler} from './win32-vc.js';
|
||||
@@ -40,7 +41,7 @@ export class WslVcCompiler extends Win32VcCompiler {
|
||||
return 'wsl-vc';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.asm = new VcAsmParser();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in
|
||||
import {ArtifactType} from '../../types/tool.interfaces.js';
|
||||
import {addArtifactToResult} from '../artifact-utils.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {logger} from '../logger.js';
|
||||
import {AsmParserZ88dk} from '../parsers/asm-parser-z88dk.js';
|
||||
import * as utils from '../utils.js';
|
||||
@@ -41,7 +42,7 @@ export class z88dkCompiler extends BaseCompiler {
|
||||
return 'z88dk';
|
||||
}
|
||||
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
|
||||
constructor(compilerInfo: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(compilerInfo, env);
|
||||
this.outputFilebase = 'example';
|
||||
this.asm = new AsmParserZ88dk(this.compilerProps);
|
||||
@@ -131,11 +132,11 @@ export class z88dkCompiler extends BaseCompiler {
|
||||
}
|
||||
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
outputFilename: string,
|
||||
result: any,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
intelAsm: boolean,
|
||||
demangle: boolean,
|
||||
staticReloc: boolean,
|
||||
dynamicReloc: boolean,
|
||||
filters: ParseFiltersAndOutputOptions,
|
||||
|
||||
@@ -31,6 +31,7 @@ import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import type {SelectedLibraryVersion} from '../../types/libraries/libraries.interfaces.js';
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
import {CompilationEnvironment} from '../compilation-env.js';
|
||||
import {asSafeVer} from '../utils.js';
|
||||
|
||||
export class ZigCompiler extends BaseCompiler {
|
||||
@@ -40,7 +41,7 @@ export class ZigCompiler extends BaseCompiler {
|
||||
return 'zig';
|
||||
}
|
||||
|
||||
constructor(info: PreliminaryCompilerInfo, env) {
|
||||
constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
|
||||
super(info, env);
|
||||
this.compiler.supportsIntel = true;
|
||||
this.compiler.supportsIrView = true;
|
||||
|
||||
@@ -84,7 +84,10 @@ export class BaseDemangler extends AsmRegex {
|
||||
return !!this.demanglerExe;
|
||||
}
|
||||
|
||||
protected demangleLabelDefinitions(labelDefinitions, translations: [string, string][]) {
|
||||
protected demangleLabelDefinitions(
|
||||
labelDefinitions: Record<string, number> | undefined,
|
||||
translations: [string, string][],
|
||||
) {
|
||||
if (!labelDefinitions) return;
|
||||
|
||||
for (const [oldValue, newValue] of translations) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {OptPipelineResults} from '../../types/compilation/opt-pipeline-output.interfaces.js';
|
||||
import {UnprocessedExecResult} from '../../types/execution/execution.interfaces.js';
|
||||
import {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {logger} from '../logger.js';
|
||||
import {SymbolStore} from '../symbol-store.js';
|
||||
@@ -61,7 +62,7 @@ export class LLVMIRDemangler extends BaseDemangler {
|
||||
}
|
||||
}
|
||||
|
||||
protected processPassOutput(passOutput: OptPipelineResults, demanglerOutput) {
|
||||
protected processPassOutput(passOutput: OptPipelineResults, demanglerOutput: UnprocessedExecResult) {
|
||||
if (demanglerOutput.stdout.length === 0 && demanglerOutput.stderr.length > 0) {
|
||||
logger.error(`Error executing demangler ${this.demanglerExe}`, demanglerOutput);
|
||||
return passOutput;
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {BaseCompiler} from '../base-compiler.js';
|
||||
|
||||
import {CppDemangler} from './cpp.js';
|
||||
|
||||
export class TiC2000Demangler extends CppDemangler {
|
||||
@@ -29,7 +31,7 @@ export class TiC2000Demangler extends CppDemangler {
|
||||
return 'tic2000';
|
||||
}
|
||||
|
||||
constructor(demanglerExe, compiler) {
|
||||
constructor(demanglerExe: string, compiler: BaseCompiler) {
|
||||
super(demanglerExe, compiler, ['-q']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export class Win32Demangler extends CppDemangler {
|
||||
protected async createTranslations() {
|
||||
const translations: Record<string, string> = {};
|
||||
|
||||
const demangleSingleSet = async names => {
|
||||
const demangleSingleSet = async (names: string[]) => {
|
||||
const args = [this.flags, ...names];
|
||||
const output = await this.compiler.exec(this.demanglerExe, args, this.compiler.getDefaultExecOptions());
|
||||
const outputArray = utils.splitLines(output.stdout);
|
||||
|
||||
@@ -266,7 +266,7 @@ export class ClientOptionsHandler {
|
||||
},
|
||||
{
|
||||
ceProps: this.ceProps,
|
||||
compilerProps: propname => this.compilerProps(lang, propname),
|
||||
compilerProps: (propname: string) => this.compilerProps(lang, propname),
|
||||
},
|
||||
);
|
||||
} else {
|
||||
@@ -400,7 +400,7 @@ export class ClientOptionsHandler {
|
||||
return libs;
|
||||
}
|
||||
|
||||
async getRemoteLibraries(language, remoteUrl) {
|
||||
async getRemoteLibraries(language: LanguageKey, remoteUrl: string) {
|
||||
const remoteId = this.getRemoteId(remoteUrl, language);
|
||||
if (!this.remoteLibs[remoteId]) {
|
||||
return new Promise(resolve => {
|
||||
@@ -429,7 +429,7 @@ export class ClientOptionsHandler {
|
||||
return this.remoteLibs[remoteId];
|
||||
}
|
||||
|
||||
async fetchRemoteLibrariesIfNeeded(language, remote) {
|
||||
async fetchRemoteLibrariesIfNeeded(language: LanguageKey, remote) {
|
||||
await this.getRemoteLibraries(language, remote.target);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,10 @@ import {
|
||||
} from '../../types/asmresult/asmresult.interfaces.js';
|
||||
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import {assert} from '../assert.js';
|
||||
import {PropertyGetter} from '../properties.interfaces.js';
|
||||
import * as utils from '../utils.js';
|
||||
|
||||
import {AsmParser} from './asm-parser.js';
|
||||
import {AsmParser, ParsingContext} from './asm-parser.js';
|
||||
import {AsmRegex} from './asmregex.js';
|
||||
|
||||
export class MadsAsmParser extends AsmParser {
|
||||
@@ -42,7 +43,7 @@ export class MadsAsmParser extends AsmParser {
|
||||
protected varAssignment: RegExp;
|
||||
protected constAssignment: RegExp;
|
||||
|
||||
constructor(compilerProps) {
|
||||
constructor(compilerProps: PropertyGetter) {
|
||||
super(compilerProps);
|
||||
|
||||
this.labelDef = /^([Ll]_\d*)$/;
|
||||
@@ -69,7 +70,7 @@ export class MadsAsmParser extends AsmParser {
|
||||
this.lineRe = /^[\d ]{6} (.*)/;
|
||||
}
|
||||
|
||||
override handleSource(context, line) {}
|
||||
override handleSource(context: ParsingContext, line: string) {}
|
||||
|
||||
override handleStabs(context, line) {}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ export class AsmParser extends AsmRegex implements IAsmParser {
|
||||
return isMips ? this.labelFindMips : this.labelFindNonMips;
|
||||
}
|
||||
|
||||
findUsedLabels(asmLines, filterDirectives) {
|
||||
findUsedLabels(asmLines: string[], filterDirectives?: boolean) {
|
||||
const labelsUsed = {};
|
||||
const weakUsages = {};
|
||||
const labelFind = this.labelFindFor(asmLines);
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
||||
import type {ResultLine} from '../../types/resultline/resultline.interfaces.js';
|
||||
import {assert} from '../assert.js';
|
||||
import {PropertyGetter} from '../properties.interfaces.js';
|
||||
|
||||
type PassDump = {
|
||||
header: string;
|
||||
@@ -51,7 +52,7 @@ export class RacketPassDumpParser {
|
||||
passHeader: RegExp;
|
||||
mainModule: RegExp;
|
||||
|
||||
constructor(compilerProps) {
|
||||
constructor(compilerProps: PropertyGetter) {
|
||||
// Filters that are always enabled
|
||||
this.filters = [];
|
||||
this.lineFilters = [];
|
||||
|
||||
@@ -30,7 +30,7 @@ export abstract class BaseShortener {
|
||||
constructor(protected storageHandler: StorageBase) {}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
abstract handle(req: express.Request, res: express.Response);
|
||||
abstract handle(req: express.Request, res: express.Response): void;
|
||||
|
||||
static get key(): string {
|
||||
throw 'get key() must be overridden';
|
||||
|
||||
@@ -29,7 +29,7 @@ export class StorageNull extends StorageBase {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
async storeItem(item) {
|
||||
async storeItem(item: any) {
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export class LLVMCovTool extends BaseTool {
|
||||
return 'llvm-cov-tool';
|
||||
}
|
||||
|
||||
override async runTool(compilationInfo: CompilationInfo, inputFilepath, args: string[], stdin) {
|
||||
override async runTool(compilationInfo: CompilationInfo, inputFilepath: string, args: string[], stdin?: string) {
|
||||
const compilationExecOptions = this.getDefaultExecOptions();
|
||||
compilationExecOptions.customCwd = path.dirname(inputFilepath);
|
||||
compilationExecOptions.input = stdin;
|
||||
|
||||
@@ -145,6 +145,7 @@ export type CompilationResult = {
|
||||
buildsteps?: BuildStep[];
|
||||
inputFilename?: string;
|
||||
asm?: ResultLine[];
|
||||
asmSize?: number;
|
||||
devices?: Record<string, CompilationResult>;
|
||||
stdout: ResultLine[];
|
||||
stderr: ResultLine[];
|
||||
|
||||
@@ -159,7 +159,17 @@ export type PreliminaryCompilerInfo = Omit<CompilerInfo, 'version' | 'fullVersio
|
||||
export interface ICompiler {
|
||||
possibleArguments: ICompilerArguments;
|
||||
lang: Language;
|
||||
compile(source, options, backendOptions, filters, bypassCache, tools, executeParameters, libraries, files);
|
||||
compile(
|
||||
source,
|
||||
options,
|
||||
backendOptions,
|
||||
filters,
|
||||
bypassCache: BypassCache,
|
||||
tools,
|
||||
executeParameters,
|
||||
libraries,
|
||||
files,
|
||||
);
|
||||
cmake(files, key, bypassCache: BypassCache);
|
||||
initialise(mtime: Date, clientOptions, isPrediscovered: boolean);
|
||||
getInfo(): CompilerInfo;
|
||||
|
||||
@@ -39,7 +39,7 @@ import {WebpackManifestPlugin} from 'webpack-manifest-plugin';
|
||||
const __dirname = path.resolve(path.dirname(fileURLToPath(import.meta.url)));
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
|
||||
function log(message) {
|
||||
function log(message: string) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('webpack: ' + message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user