[llvm] fix wrong inline assembly line/col info in the error message with ThinLTO (PR #102211)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 23:05:59 PDT 2024


HighW4y2H3ll wrote:

Thanks for taking a look! I should write a clearer description. let me update it real quick! I'm also updating the testcase! Seems its failing on the windows.... and I'm trying to setup a windows env to test it out...

And yes, this is only a best-effort patch -- there are still problems that I'm not sure if there's an easy way to fix...
* The column number is off a few bytes because of the missing semantics from source code (DebugLoc) to LLVM IR -- DebugLoc points to the starting position of the `asm` qualifier, but the InlineSourceManager starts counting the column from actual inline assembly string. So all the qualifiers in the source code, like `asm` and `volatile`, won't be counted.
* And i believe it's also why the line number in one of the multi-line assembly is wrong -- the InlineSourceManager counts line number based on the number of `\n`, and all the multi-line assembly are rearranged into one line of string in the IR (including the `\n` character). So the assembly code without any line change would be treated as a one-liner...

https://github.com/llvm/llvm-project/pull/102211


More information about the llvm-commits mailing list