diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2023-06-30 00:52:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-30 00:52:42 +0200 |
commit | 3e204e204fbe7f5332d274cd16b579a4da574ad5 (patch) | |
tree | 16b5b6409132022d7cec3f9ff1dcd9db839d670d /lib/compilers | |
parent | 51529dad43b3974c895c9e95db8afefa0ef7a28f (diff) | |
download | compiler-explorer-3e204e204fbe7f5332d274cd16b579a4da574ad5.tar.gz compiler-explorer-3e204e204fbe7f5332d274cd16b579a4da574ad5.zip |
ada: add stack-usage support for GNAT (#5218)gh-8031
GNAT is gcc based, but its --help doesn't show all of gcc's option and
the base compiler doesn't detect its support for -fstack-usage.
Force the support (currently we only have GNAT as an Ada compiler).
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/ada.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/compilers/ada.ts b/lib/compilers/ada.ts index 1133b6cf3..a379449ea 100644 --- a/lib/compilers/ada.ts +++ b/lib/compilers/ada.ts @@ -24,6 +24,7 @@ // POSSIBILITY OF SUCH DAMAGE. import path from 'path'; +import {unwrap} from '../assert.js'; import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; @@ -38,9 +39,17 @@ export class AdaCompiler extends BaseCompiler { constructor(info: PreliminaryCompilerInfo, env) { super(info, env); + + this.outputFilebase = 'example'; + this.compiler.supportsGccDump = true; this.compiler.removeEmptyGccDump = true; + // this is not showing-up in the --help, so argument parser doesn't + // automatically detect the support. + this.compiler.stackUsageArg = '-fstack-usage'; + this.compiler.supportsStackUsageOutput = true; + // used for all GNAT related panes (Expanded code, Tree) this.compiler.supportsGnatDebugViews = true; } @@ -101,6 +110,10 @@ export class AdaCompiler extends BaseCompiler { gnatmake_opts.push(`--RTS=${this.compiler.adarts}`); } + if (this.compiler.supportsStackUsageOutput && backendOptions.produceStackUsageInfo) { + gnatmake_opts.push(unwrap(this.compiler.stackUsageArg)); + } + if (!filters.execute && backendOptions.produceGnatDebug && this.compiler.supportsGnatDebugViews) // This is using stdout gnatmake_opts.push('-gnatGL'); |