[llvm-branch-commits] [llvm-mc] Add --show-source-loc option to emit source locations (PR #199298)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Sep 6 01:54:46 PDT 2026
https://github.com/zhangweize9-cyber commented:
This is really interesting to realize, and I especially agree with this plan. It's just that you can directly go from `llvm/lib/mc/MCParser/AsmParser.cpp about the error message. The `AsmParser::Run` function in this file takes the data, the source of the problem is around the 1030-1050th line position.
At that time, in order to save trouble pointers, the pointer was recorded to the end of the file, which caused the position to be lost. You can Using `Twine(startLoc, endLoc)` in a function can solve similar problems more cleanly, without adding parameters to the command line, and the code is cleaner and easier to report errors.
https://github.com/llvm/llvm-project/pull/199298
More information about the llvm-branch-commits
mailing list