[llvm] [DiagnosticInfo] Output full file path instead of relative path (PR #68027)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 10:54:24 PDT 2023


CongzheUalberta wrote:


> can you give an example of the output with this change?

Definitely. The following is remark output when compiling a few simple cpp files, with "-Rpass=inline" and LTO enabled, where the first 4 lines are remarks from preLTO stage and the last line is remark from LTO. It is clear that the behavior is inconsistent where the former outputs full path but the latter outputs the relative path. After this patch the last line will output the full path as well, i.e., "/home/congzhe/develop/app1/funcs3.cpp:5:2....", so that the behavior becomes consistent.

```
/home/congzhe/develop/app1/funcs2.cpp:21:5: remark: '_Z1Av' inlined into '_ZL1Bv': always inline attribute at callsite _ZL1Bv:2:5; [-Rpass=inline]
   21 |     A();
      |     ^
/home/congzhe/develop/app1/funcs2.cpp:27:5: remark: '_ZL1Bv' inlined into '_Z1Cv' with (cost=40, threshold=375) at callsite _Z1Cv:2:5; [-Rpass=inline]
   27 |     B();
      |     ^
/home/congzhe/develop/app1/funcs2.cpp:36:9: remark: '_Z1Av' inlined into '_Z1Dv': always inline attribute at callsite _Z1Dv:3:9; [-Rpass=inline]
   36 |         A();
      |         ^
/home/congzhe/develop/app1/funcs2.cpp:43:5: remark: '_ZL1Bv' inlined into '_Z1Ev' with (cost=-14960, threshold=375) at callsite _Z1Ev:2:5; [-Rpass=inline]
   43 |     B();
      |     ^
app1/funcs3.cpp:5:2: '_Z1Av' inlined into 'main': always inline attribute at callsite main:1:2;

```

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


More information about the llvm-commits mailing list