MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / processAsm

Method processAsm

lib/compilers/python.ts:50–77  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

48 }
49
50 override async processAsm(result) {
51 const lineRe = /^\s{0,4}(\d+)(.*)/;
52
53 const bytecodeLines = result.asm.split('\n');
54
55 const bytecodeResult: ParsedAsmResultLine[] = [];
56 let lastLineNo: number | null = null;
57 let sourceLoc: AsmResultSource | null = null;
58
59 for (const line of bytecodeLines) {
60 const match = line.match(lineRe);
61
62 if (match) {
63 const lineno = Number.parseInt(match[1], 10);
64 sourceLoc = {line: lineno, file: null};
65 lastLineNo = lineno;
66 } else if (line) {
67 sourceLoc = {line: lastLineNo, file: null};
68 } else {
69 sourceLoc = {line: null, file: null};
70 lastLineNo = null;
71 }
72
73 bytecodeResult.push({text: line, source: sourceLoc});
74 }
75
76 return {asm: bytecodeResult};
77 }
78
79 override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string) {
80 return ['-I', this.disasmScriptPath, '--outputfile', outputFilename, '--inputfile'];

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected