[LLVMdev] Questions before moving the new debug info hierarchy into place

Frédéric Riss friss at apple.com
Fri Feb 20 11:44:55 PST 2015


> On Feb 20, 2015, at 11:40 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
> 
>> On 2015-Feb-20, at 11:34, Frédéric Riss <friss at apple.com> wrote:
>> 
>>> David also pointed out (in a previous thread about this) that
>>> the frontend (or `DIBuilder`) might be the right location for
>>> canonicalization.  Certainly, we couldn't canonicalize `..`
>>> references without access to the filesystem (at least not on
>>> POSIX platforms), but maybe we don't care about that anyway?
>> 
>> What I attempted to do in the past was exactly that, canonicalize ‘..’ in the paths 
> 
> On POSIX you need access to the filesystem to canonicalize
> `..`  (if `./dir` is a symlink, then `./dir/../` does not
> necessarily equal `./`), so any such canonicalization should
> IMO be done outside of `MDFile`.  But yeah, we should revisit
> this soon.
> 
>> (The lldb folks would have loved to be able to consider file identifiers as unique in the line table). 
> 
> This further requires resolving *all* symlinks in the path.
> Certainly doable... but it's not just string manipulation.

Yeah, both problems are solved by a call to realpath. It’s quite heavy though as it has to at least stat every component of the path. If we do that we’ll need to make sure it’s not too costly, or resort to some sort of caching.



More information about the llvm-dev mailing list