(asmLines: string[])
| 231 | } |
| 232 | |
| 233 | parseFiles(asmLines: string[]) { |
| 234 | const files: Record<number, string> = {}; |
| 235 | const fileFind = /^\s*\.(?:cv_)?file\s+(\d+)\s+"([^"]+)"(\s+"([^"]+)")?.*/; |
| 236 | for (const line of asmLines) { |
| 237 | const match = line.match(fileFind); |
| 238 | if (match) { |
| 239 | const lineNum = Number.parseInt(match[1], 10); |
| 240 | if (match[4] && !line.includes('.cv_file')) { |
| 241 | // Clang-style file directive '.file X "dir" "filename"' |
| 242 | if (match[4].startsWith('/')) { |
| 243 | files[lineNum] = match[4]; |
| 244 | } else { |
| 245 | files[lineNum] = match[2] + '/' + match[4]; |
| 246 | } |
| 247 | } else { |
| 248 | files[lineNum] = match[2]; |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | return files; |
| 253 | } |
| 254 | |
| 255 | removeNonMainSourceFunctions(asmLines: string[]): string[] { |
| 256 | const files = this.parseFiles(asmLines); |
no test coverage detected