[PATCH] D11944: Nativize filename in FileManager::getFile().

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 01:51:48 PDT 2015


yaron.keren added inline comments.

================
Comment at: lib/Basic/FileManager.cpp:221-222
@@ -220,1 +220,4 @@
 
+  SmallString<1024> NativeFilename;
+  llvm::sys::path::native(Filename, NativeFilename);
+
----------------
rsmith wrote:
> I have two concerns with this:
> 
> 1) It's needlessly inefficient on non-Win32 platforms (we'll make an unnecessary string copy)
> 2) It does something bizarre and wrong on non-Win32 platforms (it converts `\` to `/` unless the `\` is followed by another `\`, making most files containing `\` inaccessible)
2 is surprising. Any idea why native does this on non-Windows platforms?



http://reviews.llvm.org/D11944





More information about the cfe-commits mailing list