mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 21:09:26 -06:00
This PR fixes the "unassigned file number" error in llvm-mca when processing GCC-generated assembly with debug information #6795 . **Problem**: GCC with `-g` flag generates `.loc` and `.file` debug directives that cause llvm-mca to fail with "unassigned file number" errors. **Solution**: Filter out `.loc` and `.file` directives during assembly preprocessing, similar to how other problematic directives are already handled. **Changes**: - Add regex filtering for `.loc` and `.file` directives in `rewriteAsm()` - Make `rewriteAsm()` method public for testability - Add comprehensive test coverage for debug directive removal The fix is minimal, targeted, and follows the existing pattern of directive filtering.