[PATCH] D87657: [DebugInfo] Remove dots from getFilenameByIndex return value

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 19:31:32 PDT 2020


dblaikie added a comment.

In D87657#2272901 <https://reviews.llvm.org/D87657#2272901>, @phosek wrote:

> So a trivial example is:
>
>   #include <string>
>   int main() {}
>
> When compiled as:
>
>   clang++ test.cc -g3 -S -o test.S
>
> I see paths like these in the output:
>
>   "/usr/local/google/home/phosek/fuchsia" "prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/cstddef"
>
> We could go over driver code and make sure we always invoke `sys::path::remove_dots` inside methods like `AddIncludePaths` or `addPathIfExists` (see for example https://github.com/llvm/llvm-project/blob/b3afad046301d8bb1f4471aceaad704b87de3a69/clang/lib/Driver/ToolChains/Gnu.cpp#L2902 which where the `..` in libc++ header path comes from), but maybe it'd be better to do the normalization uniformly when emitting debuginfo metadata?

Probably when emitting the LLVM IR Debug info, rather than at the backend of LLVM, so that the IR itself doesn't have problematic redundancies. CGDebugInfo::remapDIPath might be the place for this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87657/new/

https://reviews.llvm.org/D87657



More information about the llvm-commits mailing list