Added toggle for demangling

This commit is contained in:
Jeremy Rifkin
2022-06-20 10:19:43 -04:00
parent 923c48ddbc
commit 1ad7552002
4 changed files with 18 additions and 7 deletions
+11 -6
View File
@@ -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) {
+2 -1
View File
@@ -66,7 +66,7 @@ export class LLVMOptPipeline extends MonacoPane<monaco.editor.IStandaloneDiffEdi
modifiedModel: any;
options: Toggles;
// todo: can probably get rid of this and just use state?
lastOptions: LLVMOptPipelineBackendOptions = {'dump-full-module': false};
lastOptions: LLVMOptPipelineBackendOptions = {'dump-full-module': false, demangle: true};
resizeStartX: number;
resizeStartWidth: number;
resizeDragMoveBind: (e: MouseEvent) => void;
@@ -207,6 +207,7 @@ export class LLVMOptPipeline extends MonacoPane<monaco.editor.IStandaloneDiffEdi
const newOptions: LLVMOptPipelineBackendOptions = {
//'filter-inconsequential-passes': options['filter-inconsequential-passes'],
'dump-full-module': options['dump-full-module'],
demangle: options['demangle-symbols'],
};
let changed = false;
for (const k in newOptions) {
@@ -37,4 +37,5 @@ export type LLVMOptPipelineOutput = Record<string, Pass[]>;
export type LLVMOptPipelineBackendOptions = {
'dump-full-module': boolean;
demangle: boolean;
};
+4
View File
@@ -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