Unify unix and windows versions of FileManager::UniqueDirContainer and FileManager::UniqueFileContainer

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Jul 30 20:35:42 PDT 2013

This started with what I assumed would be a trivial patch to use
llvm::sys::fs::UniqueID instead of using st_dev and st_ino directly.

Unfortunately, we are passing a stat buffer through most of the file
manager, so the patch got somewhat verbose.

We cannot also just replace "struct stat" with
llvm::sys::fs::file_status, since we want to be able to construct fake
ones, and file_status has different members on unix and windows.

What the patch does is:

* Record only the information that clang is actually using.
* Use llvm::sys::fs::status instead of stat and fstat.
* Use llvm::sys::fs::UniqueID
* Delete the old windows versions of UniqueDirContainer and
UniqueFileContainer since the "unix" one now works on windows too.

Since the use of dev/inode has reached libclang, I have also patched
llvm to make it clear that
UniqueID has device and file components instead of being made of
arbitrary 128 bits.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: application/octet-stream
Size: 1058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130730/1e56e144/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.patch
Type: application/octet-stream
Size: 33170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130730/1e56e144/attachment-0001.obj>

More information about the cfe-commits mailing list