From 7b4a1e77c19aa78632e0e9fb47926e2ee7be3aa4 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 12 Jun 2022 20:33:07 -0400 Subject: [PATCH] Forgot to insert stop for machine code passes --- lib/parsers/llvm-print-after-all-parser.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/parsers/llvm-print-after-all-parser.ts b/lib/parsers/llvm-print-after-all-parser.ts index 08ddce5f3..89fb9a224 100644 --- a/lib/parsers/llvm-print-after-all-parser.ts +++ b/lib/parsers/llvm-print-after-all-parser.ts @@ -61,6 +61,7 @@ export class LlvmPrintAfterAllParser { filters: RegExp[]; lineFilters: RegExp[]; irDumpAfterHeader: RegExp; + machineCodeDumpHeader: RegExp; defineLine: RegExp; label: RegExp; instruction: RegExp; @@ -89,6 +90,7 @@ export class LlvmPrintAfterAllParser { ]; this.irDumpAfterHeader = /^\*{3} (.+) \*{3}(;.+)?$/; + this.machineCodeDumpHeader = /^# \*{3} (.+) \*{3}:$/; this.defineLine = /^define .+ @(\w+)\(.+$/; this.label = /^\d+:(\s+;.+)?$/; this.instruction = /^\s+.+$/; @@ -162,6 +164,8 @@ export class LlvmPrintAfterAllParser { if (func.name === '') { // loop dumps must be alone if (Object.entries(pass.functions).length > 0) { + //console.dir(dump, { depth: 5, maxArrayLength: 100000 }); + //console.log(pass.functions); throw 'Internal error during breakdownPass (5)'; } pass.functions[func.name] = func.lines; @@ -177,6 +181,10 @@ export class LlvmPrintAfterAllParser { const raw_passes: PassDump[] = []; let pass: PassDump | null = null; for (const line of ir) { + // stop once the machine code passes start, can't handle these yet + if (this.machineCodeDumpHeader.test(line.text)) { + break; + } const match = line.text.match(this.irDumpAfterHeader); if (match) { if (pass !== null) {