aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/tablegen.ts
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-11-04 19:54:43 +0000
committerGitHub <noreply@github.com>2023-11-04 20:54:43 +0100
commit971889e5d77be91b854ab9376613b51d3ea6aec9 (patch)
tree8b4dcfbcc2d9a60576dd185c1b7f58839132a9f8 /lib/compilers/tablegen.ts
parentbb66fc6a9719f913b01fd6708b5e900329d65e0e (diff)
downloadcompiler-explorer-971889e5d77be91b854ab9376613b51d3ea6aec9.tar.gz
compiler-explorer-971889e5d77be91b854ab9376613b51d3ea6aec9.zip
LLVM TableGen: Add actions to Overrides menu (#5699)gh-9391
Diffstat (limited to 'lib/compilers/tablegen.ts')
-rw-r--r--lib/compilers/tablegen.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/compilers/tablegen.ts b/lib/compilers/tablegen.ts
index ea2465000..1ce51f2cc 100644
--- a/lib/compilers/tablegen.ts
+++ b/lib/compilers/tablegen.ts
@@ -1,5 +1,7 @@
import {BaseCompiler} from '../base-compiler.js';
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
+import {TableGenParser} from './argument-parsers.js';
+import {CompilerOverrideType} from '../../types/compilation/compiler-overrides.interfaces.js';
export class TableGenCompiler extends BaseCompiler {
static get key() {
@@ -17,4 +19,26 @@ export class TableGenCompiler extends BaseCompiler {
override isCfgCompiler() {
return false;
}
+
+ override getArgumentParser() {
+ return TableGenParser;
+ }
+
+ override async populatePossibleOverrides() {
+ const possibleActions = await TableGenParser.getPossibleActions(this);
+ if (possibleActions.length > 0) {
+ this.compiler.possibleOverrides?.push({
+ name: CompilerOverrideType.action,
+ display_title: 'Action',
+ description:
+ 'The action to perform, which is the backend you wish to ' +
+ 'run. By default, the records are just printed as text.',
+ flags: ['<value>'],
+ values: possibleActions,
+ default: '--print-records',
+ });
+ }
+
+ await super.populatePossibleOverrides();
+ }
}