diff options
author | Marc Auberer <marc.auberer@chillibits.com> | 2024-02-20 14:56:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 14:56:19 +0100 |
commit | 1e72627cb7b9c61860f0588069cb0dd3ed2807d1 (patch) | |
tree | b7b82fa64b05f93a188ad4530c39817e6c27e8a7 /lib/compilers | |
parent | ee47a9be8fa050055f43067da47c52113541ffb8 (diff) | |
download | compiler-explorer-1e72627cb7b9c61860f0588069cb0dd3ed2807d1.tar.gz compiler-explorer-1e72627cb7b9c61860f0588069cb0dd3ed2807d1.zip |
[Spice] Abort compilation after dump (#6170)gh-10722
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/spice.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/compilers/spice.ts b/lib/compilers/spice.ts index 4328b95e1..34fcb404c 100644 --- a/lib/compilers/spice.ts +++ b/lib/compilers/spice.ts @@ -24,12 +24,14 @@ import path from 'path'; +import Semver from 'semver'; import _ from 'underscore'; 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 {asSafeVer} from '../utils.js'; import {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js'; export class SpiceCompiler extends BaseCompiler { @@ -43,8 +45,16 @@ export class SpiceCompiler extends BaseCompiler { super(info, env); this.compiler.supportsIntel = true; this.compiler.supportsIrView = true; - this.compiler.irArg = ['-ir', '--dump-ir']; - this.compiler.minIrArgs = ['-ir', '--dump-ir']; + + // The --abort-after-dump option was introduced in v0.19.3. Do not use it before that. + if (Semver.lte(asSafeVer(this.compiler.semver), '0.19.2', true)) { + this.compiler.irArg = ['-ir']; + this.compiler.minIrArgs = ['-ir']; + } else { + this.compiler.irArg = ['-ir', '--abort-after-dump']; + this.compiler.minIrArgs = ['-ir', '--abort-after-dump']; + } + this.compiler.optPipeline = { arg: ['-llvm', '-print-after-all', '-llvm', '-print-before-all'], moduleScopeArg: ['-llvm', '-print-module-scope'], @@ -61,7 +71,7 @@ export class SpiceCompiler extends BaseCompiler { outputFilename: string, userOptions: string[], ): string[] { - const options = ['build', '-g', '-o', outputFilename, '--dump-to-files', '-ir', '-asm']; + const options = ['build', '-g', '-o', outputFilename, '--dump-to-files', '-asm']; if (filters.intel) { options.push('-llvm', '--x86-asm-syntax=intel'); |