diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index fb039fe3a..a44dec212 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -988,14 +988,19 @@ export class BaseCompiler { if (output.code !== 0) { return; } - // new this.demanglerClass(this.compiler.demangler, this); - const demangler = new LLVMIRDemangler(this.compiler.demangler, this); - // collect labels off the raw input - await demangler.collect({asm: output.stderr}); const llvmOptPipeline = await this.processLLVMOptPipeline(output, filters, llvmOptPipelineOptions); - // apply demangles later, would complicate the parsing of the passes otherwise - return demangler.demangleLLVMPasses(llvmOptPipeline); + + if (llvmOptPipelineOptions.demangle) { + // apply demangles after parsing, would otherwise greatly complicate the parsing of the passes + // new this.demanglerClass(this.compiler.demangler, this); + const demangler = new LLVMIRDemangler(this.compiler.demangler, this); + // collect labels off the raw input + await demangler.collect({asm: output.stderr}); + return await demangler.demangleLLVMPasses(llvmOptPipeline); + } else { + return llvmOptPipeline; + } } async processLLVMOptPipeline(output, filters: ParseFilters, llvmOptPipelineOptions: LLVMOptPipelineBackendOptions) { diff --git a/static/panes/llvm-opt-pipeline.ts b/static/panes/llvm-opt-pipeline.ts index c90683504..cbdb5602e 100644 --- a/static/panes/llvm-opt-pipeline.ts +++ b/static/panes/llvm-opt-pipeline.ts @@ -66,7 +66,7 @@ export class LLVMOptPipeline extends MonacoPane void; @@ -207,6 +207,7 @@ export class LLVMOptPipeline extends MonacoPane; export type LLVMOptPipelineBackendOptions = { 'dump-full-module': boolean; + demangle: boolean; }; diff --git a/views/templates.pug b/views/templates.pug index 7c04db0c7..075e03a9a 100644 --- a/views/templates.pug +++ b/views/templates.pug @@ -342,6 +342,10 @@ button.dropdown-item.btn.btn-sm.btn-light.dump-full-module(type="button" title="Dump the entire module for each pass" data-bind="dump-full-module" aria-pressed="false" aria-label="Filter Inconsequential Passes") span Dump Full Module input.d-none(type="checkbox" checked=false) + .button-checkbox + button.dropdown-item.btn.btn-sm.btn-light.dump-full-module(type="button" title="Demangle Symbols" data-bind="demangle-symbols" aria-pressed="false" aria-label="Demangle Symbols") + span Demangle Symbols + input.d-none(type="checkbox" checked=true) .btn-group.btn-group-sm .input-group.input-group-sm.mb-auto .input-group-prepend