From 3e204e204fbe7f5332d274cd16b579a4da574ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Fri, 30 Jun 2023 00:52:42 +0200 Subject: ada: add stack-usage support for GNAT (#5218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/compilers/ada.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/compilers') 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'); -- cgit v1.2.3