From e28e67d972ac8e914aa74872a518c1caa7126cfb Mon Sep 17 00:00:00 2001 From: fodinabor <5982050+fodinabor@users.noreply.github.com> Date: Tue, 23 May 2023 05:35:01 +0200 Subject: [PATCH] Add new "Debug intrinsics" filter. (#5045) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For now, this removes all `llvm.dbg.*` calls from LLVM IR. This is useful to keep coloring the line correspondence between source and IR, while not polluting the IR with the debug intrinsics. Admittedly, I don't have much of a clue of what's going on here, so I might be missing obvious adaptions (e.g. can we disable this for all non-LLVM compilers for now somehow?). Also, not really a Node.JS testing wizard either... 🤷🏼 Just wanted this really bad for a workshop that's coming up soon ^^ Only tested with my system's default `clang` for now. Fixes #5044 --------- Co-authored-by: Matt Godbolt --- docs/API.md | 3 ++- lib/base-compiler.ts | 1 + lib/clientstate-normalizer.ts | 1 + lib/clientstate.ts | 2 ++ lib/compilers/analysis-tool.ts | 3 ++- lib/compilers/argument-parsers.ts | 1 + lib/compilers/carbon.ts | 1 + lib/compilers/circt.ts | 1 + lib/compilers/clangcl.ts | 1 + lib/compilers/java.ts | 2 +- lib/compilers/mlir.ts | 1 + lib/compilers/osaca.ts | 1 + lib/compilers/racket.ts | 2 +- lib/compilers/rust.ts | 1 + lib/compilers/zig.ts | 1 + lib/external-parsers/base.ts | 1 + lib/handlers/compile.ts | 13 ++++++++--- lib/llvm-ir.ts | 5 ++++ static/panes/compiler.ts | 23 ++++++++++++++++++- test/analysis-tests.ts | 13 ++++++++--- test/asm-tests.ts | 1 + test/example-states/default-state.json | 5 ++++ test/state/andthekitchensink.json | 2 ++ test/state/andthekitchensink.json.normalized | 6 +++-- test/state/bug-2231.json | 6 +++-- test/state/conformanceview.json | 9 +++++--- test/state/conformanceview.json.normalized | 5 ++++ test/state/executor.json | 1 + test/state/executor.json.normalized | 2 ++ test/state/executorwrap.json | 1 + test/state/executorwrap.json.normalized | 2 ++ test/state/output-editor-id.json | 1 + test/state/output-editor-id.normalized.json | 1 + test/state/tree-gl-outputpane.json | 1 + test/state/tree-gl-outputpane.normalized.json | 1 + test/state/tree-gl.json | 1 + test/state/tree-mobile.goldenified.json | 1 + test/state/tree-mobile.json | 1 + test/state/tree.goldenified.json | 1 + test/state/tree.json | 1 + test/state/tree.normalized.json | 1 + test/state/twocompilers.json | 2 ++ test/state/twocompilers.json.normalized | 2 ++ types/compiler.interfaces.ts | 1 + types/features/filters.interfaces.ts | 1 + views/options-filters.pug | 1 + 46 files changed, 116 insertions(+), 18 deletions(-) diff --git a/docs/API.md b/docs/API.md index ca3c6ee82..d95adc06d 100644 --- a/docs/API.md +++ b/docs/API.md @@ -73,7 +73,8 @@ To specify a compilation request as a JSON document, post it as the appropriate "intel": true, "labels": true, "libraryCode": false, - "trim": false + "trim": false, + "debugCalls": false }, "tools": [ {"id":"clangtidytrunk", "args":"-checks=*"} diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index fa5eda660..cc7b22ea1 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -3096,6 +3096,7 @@ but nothing was dumped. Possible causes are: libraryCode: false, trim: false, binaryObject: false, + debugCalls: false, }; } } diff --git a/lib/clientstate-normalizer.ts b/lib/clientstate-normalizer.ts index c93649683..58be7623a 100644 --- a/lib/clientstate-normalizer.ts +++ b/lib/clientstate-normalizer.ts @@ -45,6 +45,7 @@ export class ClientStateNormalizer { compiler.filters.trim = component.componentState.filters.trim; compiler.filters.intel = component.componentState.filters.intel; compiler.filters.demangle = component.componentState.filters.demangle; + compiler.filters.debugCalls = component.componentState.filters.debugCalls; } findCompilerInGoldenLayout(content, id) { diff --git a/lib/clientstate.ts b/lib/clientstate.ts index 38a1161a9..f89ddb8c3 100644 --- a/lib/clientstate.ts +++ b/lib/clientstate.ts @@ -31,6 +31,7 @@ export class ClientStateCompilerOptions { intel = true; labels = true; trim = false; + debugCalls = false; constructor(jsondata?) { if (jsondata) this.fromJsonData(jsondata); @@ -45,6 +46,7 @@ export class ClientStateCompilerOptions { if (jsondata.intel !== undefined) this.intel = jsondata.intel; if (jsondata.labels !== undefined) this.labels = jsondata.labels; if (jsondata.trim !== undefined) this.trim = jsondata.trim; + if (jsondata.debugCalls !== undefined) this.debugCalls = jsondata.debugCalls; } } diff --git a/lib/compilers/analysis-tool.ts b/lib/compilers/analysis-tool.ts index c7d96afd1..073540d1d 100644 --- a/lib/compilers/analysis-tool.ts +++ b/lib/compilers/analysis-tool.ts @@ -35,7 +35,7 @@ export class AnalysisTool extends BaseCompiler { super( { // Default is to disable all "cosmetic" filters - disabledFilters: ['labels', 'directives', 'commentOnly', 'trim'], + disabledFilters: ['labels', 'directives', 'commentOnly', 'trim', 'debugCalls'], ...info, }, env, @@ -56,6 +56,7 @@ export class AnalysisTool extends BaseCompiler { libraryCode: false, trim: false, binaryObject: false, + debugCalls: false, }; } } diff --git a/lib/compilers/argument-parsers.ts b/lib/compilers/argument-parsers.ts index 2996920ff..a3458ff51 100644 --- a/lib/compilers/argument-parsers.ts +++ b/lib/compilers/argument-parsers.ts @@ -258,6 +258,7 @@ export class ClangParser extends BaseParser { if (this.hasSupport(options, '-emit-llvm')) { compiler.compiler.supportsIrView = true; compiler.compiler.irArg = ['-Xclang', '-emit-llvm', '-fsyntax-only']; + compiler.compiler.minIrArgs = ['-emit-llvm']; } if ( diff --git a/lib/compilers/carbon.ts b/lib/compilers/carbon.ts index deaa65a5c..13aa1ad3f 100644 --- a/lib/compilers/carbon.ts +++ b/lib/compilers/carbon.ts @@ -63,6 +63,7 @@ export class CarbonCompiler extends BaseCompiler { intel: false, libraryCode: false, trim: false, + debugCalls: false, }, options, ); diff --git a/lib/compilers/circt.ts b/lib/compilers/circt.ts index 0331db196..bd8110007 100644 --- a/lib/compilers/circt.ts +++ b/lib/compilers/circt.ts @@ -47,6 +47,7 @@ export class CIRCTCompiler extends BaseCompiler { 'directives', 'commentOnly', 'trim', + 'debugCalls', ], ...compilerInfo, }, diff --git a/lib/compilers/clangcl.ts b/lib/compilers/clangcl.ts index 0d1866bc2..3b182496a 100644 --- a/lib/compilers/clangcl.ts +++ b/lib/compilers/clangcl.ts @@ -40,6 +40,7 @@ export class ClangCLCompiler extends Win32Compiler { this.compiler.supportsIrView = true; this.compiler.irArg = ['-Xclang', '-emit-llvm']; + this.compiler.minIrArgs = ['-emit-llvm']; this.compiler.supportsIntel = false; this.compiler.includeFlag = '/clang:-isystem'; } diff --git a/lib/compilers/java.ts b/lib/compilers/java.ts index 5b6dac29e..654aab039 100644 --- a/lib/compilers/java.ts +++ b/lib/compilers/java.ts @@ -48,7 +48,7 @@ export class JavaCompiler extends BaseCompiler { super( { // Default is to disable all "cosmetic" filters - disabledFilters: ['labels', 'directives', 'commentOnly', 'trim'], + disabledFilters: ['labels', 'directives', 'commentOnly', 'trim', 'debugCalls'], ...compilerInfo, }, env, diff --git a/lib/compilers/mlir.ts b/lib/compilers/mlir.ts index 51bd6da88..20db7e92d 100644 --- a/lib/compilers/mlir.ts +++ b/lib/compilers/mlir.ts @@ -48,6 +48,7 @@ export class MLIRCompiler extends BaseCompiler { 'directives', 'commentOnly', 'trim', + 'debugCalls', ], ...compilerInfo, }, diff --git a/lib/compilers/osaca.ts b/lib/compilers/osaca.ts index 0ecff9e92..f8df4982a 100644 --- a/lib/compilers/osaca.ts +++ b/lib/compilers/osaca.ts @@ -59,6 +59,7 @@ export class OSACATool extends AnalysisTool { libraryCode: false, trim: false, binaryObject: false, + debugCalls: false, }; } diff --git a/lib/compilers/racket.ts b/lib/compilers/racket.ts index 9c808dba7..8a4ba784b 100644 --- a/lib/compilers/racket.ts +++ b/lib/compilers/racket.ts @@ -41,7 +41,7 @@ export class RacketCompiler extends BaseCompiler { super( { // Disable output filters, as they currently don't do anything - disabledFilters: ['labels', 'directives', 'commentOnly', 'trim'], + disabledFilters: ['labels', 'directives', 'commentOnly', 'trim', 'debugCalls'], ...info, }, env, diff --git a/lib/compilers/rust.ts b/lib/compilers/rust.ts index 49d707217..98683f6d9 100644 --- a/lib/compilers/rust.ts +++ b/lib/compilers/rust.ts @@ -59,6 +59,7 @@ export class RustCompiler extends BaseCompiler { this.compiler.supportsRustHirView = isNightly; this.compiler.irArg = ['--emit', 'llvm-ir']; + this.compiler.minIrArgs = ['--emit=llvm-ir']; this.compiler.llvmOptArg = ['-C', 'llvm-args=-print-after-all -print-before-all']; this.compiler.llvmOptModuleScopeArg = ['-C', 'llvm-args=-print-module-scope']; this.compiler.llvmOptNoDiscardValueNamesArg = isNightly ? ['-Z', 'fewer-names=no'] : []; diff --git a/lib/compilers/zig.ts b/lib/compilers/zig.ts index 44c239438..235c1295d 100644 --- a/lib/compilers/zig.ts +++ b/lib/compilers/zig.ts @@ -55,6 +55,7 @@ export class ZigCompiler extends BaseCompiler { } else { this.compiler.irArg = ['--emit', 'llvm-ir']; } + this.compiler.minIrArgs = ['--emit llvm-ir', '-femit-llvm-ir']; } override getSharedLibraryPathsAsArguments(): string[] { diff --git a/lib/external-parsers/base.ts b/lib/external-parsers/base.ts index 0dc3781ae..3381041ce 100644 --- a/lib/external-parsers/base.ts +++ b/lib/external-parsers/base.ts @@ -42,6 +42,7 @@ export class ExternalParserBase implements IExternalParser { if (filters.trim) parameters.push('-whitespace'); if (filters.libraryCode) parameters.push('-library_functions'); if (filters.dontMaskFilenames) parameters.push('-dont_mask_filenames'); + if (filters.debugCalls) parameters.push('-debug_calls'); return parameters; } diff --git a/lib/handlers/compile.ts b/lib/handlers/compile.ts index 20616579e..e31ccea6e 100644 --- a/lib/handlers/compile.ts +++ b/lib/handlers/compile.ts @@ -157,9 +157,16 @@ export class CompileHandler { source: body.source, options: body.userArguments, filters: Object.fromEntries( - ['commentOnly', 'directives', 'libraryCode', 'labels', 'demangle', 'intel', 'execute'].map( - key => [key, body[key] === 'true'], - ), + [ + 'commentOnly', + 'directives', + 'libraryCode', + 'labels', + 'demangle', + 'intel', + 'execute', + 'debugCalls', + ].map(key => [key, body[key] === 'true']), ), }); } else { diff --git a/lib/llvm-ir.ts b/lib/llvm-ir.ts index cb4ed9b37..0007b59cb 100644 --- a/lib/llvm-ir.ts +++ b/lib/llvm-ir.ts @@ -33,6 +33,7 @@ export class LlvmIrParser { private debugReference: RegExp; private metaNodeRe: RegExp; private metaNodeOptionsRe: RegExp; + private llvmDebug: RegExp; constructor(compilerProps) { this.maxIrLines = 5000; @@ -43,6 +44,7 @@ export class LlvmIrParser { this.debugReference = /!dbg (!\d+)/; this.metaNodeRe = /^(!\d+) = (?:distinct )?!DI([A-Za-z]+)\(([^)]+?)\)/; this.metaNodeOptionsRe = /(\w+): (!?\d+|\w+|""|"(?:[^"]|\\")*[^\\]")/gi; + this.llvmDebug = /^\s*call void @llvm\.dbg\..*$/; } getFileName(debugInfo, scope): string | null { @@ -141,6 +143,9 @@ export class LlvmIrParser { if (filters.commentOnly && commentOnly.test(line)) { continue; } + if (filters.debugCalls && this.llvmDebug.test(line)) { + continue; + } // Non-Meta IR line. Metadata is attached to it using "!dbg !123" const match = line.match(this.debugReference); diff --git a/static/panes/compiler.ts b/static/panes/compiler.ts index f16fc3116..31218fb9c 100644 --- a/static/panes/compiler.ts +++ b/static/panes/compiler.ts @@ -95,7 +95,7 @@ function patchOldFilters(filters) { // but there are plenty of permalinks out there with no filters set at all. Here // we manually set any missing filters to 'false' to recover the old behaviour of // "if it's not here, it's off". - ['binary', 'labels', 'directives', 'commentOnly', 'trim', 'intel'].forEach(oldFilter => { + ['binary', 'labels', 'directives', 'commentOnly', 'trim', 'intel', 'debugCalls'].forEach(oldFilter => { if (filters[oldFilter] === undefined) filters[oldFilter] = false; }); return filters; @@ -232,6 +232,8 @@ export class Compiler extends MonacoPane; private filterTrimButton: JQuery; private filterTrimTitle: JQuery; + private filterDebugCallsButton: JQuery; + private filterDebugCallsTitle: JQuery; private filterIntelButton: JQuery; private filterIntelTitle: JQuery; private filterDemangleButton: JQuery; @@ -2020,6 +2022,7 @@ export class Compiler extends MonacoPane this.options.includes(value)); + if (this.compiler.irArg) enable ||= this.options.includes(this.compiler.irArg.join(' ')); + enable ||= this.irViewOpen; + enable ||= this.compiler.lang === 'llvm'; + } + this.filterDebugCallsButton.prop('disabled', !enable); + } + hasCompilerLicenseInfo(): string | undefined { return ( this.compiler?.license && diff --git a/test/analysis-tests.ts b/test/analysis-tests.ts index 868fa64ef..f76da5174 100644 --- a/test/analysis-tests.ts +++ b/test/analysis-tests.ts @@ -54,7 +54,13 @@ describe('LLVM-mca tool definition', () => { it('should have most filters disabled', () => { if (shouldExist(a)) { - a.getInfo().disabledFilters.should.be.deep.equal(['labels', 'directives', 'commentOnly', 'trim']); + a.getInfo().disabledFilters.should.be.deep.equal([ + 'labels', + 'directives', + 'commentOnly', + 'trim', + 'debugCalls', + ]); } }); @@ -65,6 +71,7 @@ describe('LLVM-mca tool definition', () => { filters.directives.should.equal(false); filters.labels.should.equal(false); filters.optOutput.should.equal(false); + filters.debugCalls.should.equal(false); }); it('should not support objdump', () => { @@ -89,8 +96,8 @@ describe('LLVM-mca tool definition', () => { path: 'bar', }, lang: 'analysis', - disabledFilters: 'labels,directives' as any, + disabledFilters: 'labels,directives,debugCalls' as any, }); - new AnalysisTool(info, ce).getInfo().disabledFilters.should.deep.equal(['labels', 'directives']); + new AnalysisTool(info, ce).getInfo().disabledFilters.should.deep.equal(['labels', 'directives', 'debugCalls']); }); }); diff --git a/test/asm-tests.ts b/test/asm-tests.ts index d6a5e7f55..b83edffce 100644 --- a/test/asm-tests.ts +++ b/test/asm-tests.ts @@ -43,6 +43,7 @@ describe('ASM CL parser', () => { execute: false, demangle: false, intel: false, + debugCalls: false, }); result.asm.should.deep.equal([ diff --git a/test/example-states/default-state.json b/test/example-states/default-state.json index da11af3ca..924f2cb45 100644 --- a/test/example-states/default-state.json +++ b/test/example-states/default-state.json @@ -83,6 +83,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, @@ -181,6 +182,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, @@ -233,6 +235,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, @@ -268,6 +271,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, @@ -351,6 +355,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, diff --git a/test/state/andthekitchensink.json b/test/state/andthekitchensink.json index 48384f3df..8a7d2d568 100644 --- a/test/state/andthekitchensink.json +++ b/test/state/andthekitchensink.json @@ -83,6 +83,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, @@ -217,6 +218,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, diff --git a/test/state/andthekitchensink.json.normalized b/test/state/andthekitchensink.json.normalized index 0cdcc8862..dc4d74230 100644 --- a/test/state/andthekitchensink.json.normalized +++ b/test/state/andthekitchensink.json.normalized @@ -18,7 +18,8 @@ "execute": false, "intel": true, "labels": true, - "trim": false + "trim": false, + "debugCalls": false }, "libs": [], "specialoutputs": [ @@ -41,7 +42,8 @@ "execute": false, "intel": true, "labels": true, - "trim": false + "trim": false, + "debugCalls": false }, "libs": [], "specialoutputs": [ diff --git a/test/state/bug-2231.json b/test/state/bug-2231.json index 3110ebcae..9fece59f2 100644 --- a/test/state/bug-2231.json +++ b/test/state/bug-2231.json @@ -17,7 +17,8 @@ "execute": false, "intel": true, "labels": false, - "trim": false + "trim": false, + "debugCalls": false }, "libs": [ { @@ -43,7 +44,8 @@ "execute": false, "intel": true, "labels": true, - "trim": false + "trim": false, + "debugCalls": false }, "libs": [], "specialoutputs": ["compilerOutput"], diff --git a/test/state/conformanceview.json b/test/state/conformanceview.json index da5c80237..931f1456d 100644 --- a/test/state/conformanceview.json +++ b/test/state/conformanceview.json @@ -84,7 +84,8 @@ "commentOnly": true, "trim": false, "intel": true, - "demangle": true + "demangle": true, + "debugCalls": false }, "libs": [], "lang": "c++" @@ -150,7 +151,8 @@ "commentOnly": true, "trim": false, "intel": true, - "demangle": true + "demangle": true, + "debugCalls": false }, "libs": [], "lang": "c++" @@ -184,7 +186,8 @@ "commentOnly": true, "trim": false, "intel": true, - "demangle": true + "demangle": true, + "debugCalls": false }, "libs": [], "lang": "c++" diff --git a/test/state/conformanceview.json.normalized b/test/state/conformanceview.json.normalized index 7f38ce00d..fa245ef5d 100644 --- a/test/state/conformanceview.json.normalized +++ b/test/state/conformanceview.json.normalized @@ -18,6 +18,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], @@ -35,6 +36,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], @@ -56,6 +58,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], @@ -74,6 +77,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], @@ -92,6 +96,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], diff --git a/test/state/executor.json b/test/state/executor.json index 0c8ef1584..36e3bbc8e 100644 --- a/test/state/executor.json +++ b/test/state/executor.json @@ -84,6 +84,7 @@ "directives": true, "commentOnly": true, "trim": false, + "debugCalls": false, "intel": true, "demangle": true }, diff --git a/test/state/executor.json.normalized b/test/state/executor.json.normalized index 12d86bd5e..3652bbe4c 100644 --- a/test/state/executor.json.normalized +++ b/test/state/executor.json.normalized @@ -15,6 +15,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "id": "g92", @@ -48,6 +49,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false } }, diff --git a/test/state/executorwrap.json b/test/state/executorwrap.json index 8122115dc..b9a3d2117 100644 --- a/test/state/executorwrap.json +++ b/test/state/executorwrap.json @@ -108,6 +108,7 @@ "libraryCode": true, "directives": true, "commentOnly": true, + "debugCalls": false, "trim": false }, "libs": [], diff --git a/test/state/executorwrap.json.normalized b/test/state/executorwrap.json.normalized index 6ad0e1c11..4678ff6bf 100644 --- a/test/state/executorwrap.json.normalized +++ b/test/state/executorwrap.json.normalized @@ -18,6 +18,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], @@ -44,6 +45,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], diff --git a/test/state/output-editor-id.json b/test/state/output-editor-id.json index 62ab5f5ef..0dae26574 100644 --- a/test/state/output-editor-id.json +++ b/test/state/output-editor-id.json @@ -96,6 +96,7 @@ "execute": true, "binary": false, "demangle": true, + "debugCalls": false, "libraryCode": true }, "libs": [], diff --git a/test/state/output-editor-id.normalized.json b/test/state/output-editor-id.normalized.json index 2a6d61608..0a63099fe 100644 --- a/test/state/output-editor-id.normalized.json +++ b/test/state/output-editor-id.normalized.json @@ -18,6 +18,7 @@ "execute": true, "intel": true, "labels": true, + "debugCalls": false, "trim": true }, "libs": [], diff --git a/test/state/tree-gl-outputpane.json b/test/state/tree-gl-outputpane.json index 0a7ce4519..42fbfaf57 100644 --- a/test/state/tree-gl-outputpane.json +++ b/test/state/tree-gl-outputpane.json @@ -132,6 +132,7 @@ "libraryCode": true, "directives": true, "commentOnly": true, + "debugCalls": false, "trim": false }, "libs": [ diff --git a/test/state/tree-gl-outputpane.normalized.json b/test/state/tree-gl-outputpane.normalized.json index 5a668914b..090db2722 100644 --- a/test/state/tree-gl-outputpane.normalized.json +++ b/test/state/tree-gl-outputpane.normalized.json @@ -72,6 +72,7 @@ "execute": true, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [ diff --git a/test/state/tree-gl.json b/test/state/tree-gl.json index 4e7d10141..581a0b318 100644 --- a/test/state/tree-gl.json +++ b/test/state/tree-gl.json @@ -234,6 +234,7 @@ "libraryCode": true, "directives": true, "commentOnly": true, + "debugCalls": false, "trim": false }, "libs": [], diff --git a/test/state/tree-mobile.goldenified.json b/test/state/tree-mobile.goldenified.json index f6157d1fa..4f0ab40cb 100644 --- a/test/state/tree-mobile.goldenified.json +++ b/test/state/tree-mobile.goldenified.json @@ -117,6 +117,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [ diff --git a/test/state/tree-mobile.json b/test/state/tree-mobile.json index cbe350231..890e4a5b0 100644 --- a/test/state/tree-mobile.json +++ b/test/state/tree-mobile.json @@ -72,6 +72,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [ diff --git a/test/state/tree.goldenified.json b/test/state/tree.goldenified.json index 86f325331..0080a82e4 100644 --- a/test/state/tree.goldenified.json +++ b/test/state/tree.goldenified.json @@ -172,6 +172,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "lang": "c++", diff --git a/test/state/tree.json b/test/state/tree.json index a8ab80569..e2b8c872f 100644 --- a/test/state/tree.json +++ b/test/state/tree.json @@ -99,6 +99,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], diff --git a/test/state/tree.normalized.json b/test/state/tree.normalized.json index cc12f5938..cd918eb1c 100644 --- a/test/state/tree.normalized.json +++ b/test/state/tree.normalized.json @@ -100,6 +100,7 @@ "execute": false, "intel": true, "labels": true, + "debugCalls": false, "trim": false }, "libs": [], diff --git a/test/state/twocompilers.json b/test/state/twocompilers.json index fdfb8029f..c1a49a5e1 100644 --- a/test/state/twocompilers.json +++ b/test/state/twocompilers.json @@ -117,6 +117,7 @@ "commentOnly": true, "trim": false, "intel": true, + "debugCalls": false, "demangle": true }, "libs": [], @@ -173,6 +174,7 @@ "commentOnly": true, "trim": false, "intel": true, + "debugCalls": false, "demangle": true }, "libs": [], diff --git a/test/state/twocompilers.json.normalized b/test/state/twocompilers.json.normalized index 28fcafbad..164f9b60f 100644 --- a/test/state/twocompilers.json.normalized +++ b/test/state/twocompilers.json.normalized @@ -18,6 +18,7 @@ "commentOnly": true, "demangle": true, "trim": false, + "debugCalls": false, "intel": true }, "libs": [], @@ -45,6 +46,7 @@ "commentOnly": true, "demangle": true, "trim": false, + "debugCalls": false, "intel": true }, "libs": [], diff --git a/types/compiler.interfaces.ts b/types/compiler.interfaces.ts index 2b6f30795..f4818f22a 100644 --- a/types/compiler.interfaces.ts +++ b/types/compiler.interfaces.ts @@ -124,6 +124,7 @@ export type CompilerInfo = { externalparser: any; removeEmptyGccDump?: boolean; irArg?: string[]; + minIrArgs?: string[]; llvmOptArg?: string[]; llvmOptModuleScopeArg?: string[]; llvmOptNoDiscardValueNamesArg?: string[]; diff --git a/types/features/filters.interfaces.ts b/types/features/filters.interfaces.ts index 77c4aa9c2..5323cb248 100644 --- a/types/features/filters.interfaces.ts +++ b/types/features/filters.interfaces.ts @@ -42,6 +42,7 @@ export type ParseFiltersAndOutputOptions = { directives: boolean; commentOnly: boolean; trim: boolean; + debugCalls?: boolean; dontMaskFilenames?: boolean; optOutput: boolean; preProcessLines?: preProcessLinesFunc; diff --git a/views/options-filters.pug b/views/options-filters.pug index c12142ff0..6b0acd374 100644 --- a/views/options-filters.pug +++ b/views/options-filters.pug @@ -18,3 +18,4 @@ mixin filteroption(name, longdescription, shortdescription, defaultchecked) +filteroption('directives', 'Filter all assembler directives from the output', 'Directives', true) +filteroption('commentOnly', 'Remove all lines which are only comments from the output', 'Comments', true) +filteroption('trim', 'Trim intra-line whitespace', 'Horizontal whitespace', false) ++filteroption('debugCalls', 'Remove lines only relevant for debug information', 'Debug intrinsics', false)