[PATCH] D71508: [DebugInfo] Duplicate file names in debug info

kamlesh kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 10:16:36 PST 2019


kamleshbhalui added a comment.

In D71508#1786148 <https://reviews.llvm.org/D71508#1786148>, @probinson wrote:

> In D71508#1786122 <https://reviews.llvm.org/D71508#1786122>, @kamleshbhalui wrote:
>
> > In D71508#1785767 <https://reviews.llvm.org/D71508#1785767>, @probinson wrote:
> >
> > > Do we have a similar problem if the filespec has an embedded ./ or ../ in it?
> >
> >
> > problems  occur only when filespec starts with ./ otherwise it's fine.
>
>
> So do other kinds of paths get canonicalized elsewhere?  I'm thinking if there's already a place that undoes embedded .. then it should handle leading . as well.


other canonicalization happens here 
https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGDebugInfo.cpp#L541
and 
https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGDebugInfo.cpp#L441

but that does not undo any embedded . and .. anywhere,except leading ./

i.e. when we pass like
$clang .././p1.c -S -emit-llvm -g

IRGen gives single file entry like this
!1 = !DIFile(filename: ".././p1.c"

As you can see path is  not canonicalized but it atleast does not have duplicate file entry.

> Is a leading .. okay or a problem?

yes It's ok in the sense ,it does not create duplicate file entry in debug info.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71508





More information about the cfe-commits mailing list