Fixed the FIXME: Filename concatenation done using llvm::sys::path::append.
Diff Detail
Event Timeline
Does this fix any bug or is just a cleanup? If it fixes a bug, can you
include a testcase?
I fixes the file names shown in clang messages as
c:\my\dir/file.cpp
(incosistent slashes) TmpDir arrives in native so always concatenating '/' is wrong. That's what the fixme said...
testcase is tricky as the path seperator changes if clang and the tools were compiled on windows or not. It does not depend on the target but on the host.
Can we make a test that behave differently based on the host OS?
Can we make a test that behave differently based on the host OS?
Since the behavior change is on windows, I think you can just write a test with
REQUIRES: system-windows
Cheers,
Rafael
// REQUIRES: system-windows
run on Windows 7 results in
UNSUPPORTED: LLVM :: Other/path-seperator.c (1 of 1)
what feature work with requires? In other test I have seen REQUIRES: asserts, zlib, nozlib but no OS example.
This patch caused one regression test failure, clang/test/Misc/remap-file.c.
The failure is the result of a FileManager::getVirtualFile limitation: it considers c:\dir\file different than c:/dir/file.
FileManager::getFile may have the same problem but I think it gets sorted out since both names point to same inode and getFile merges them.
Regardless of this patch I think getVirtualFile and getFile should be tolerant to the path seperators.
How to proceed?
Fix the get*File to be tolerant? his will require allocating a native version filename for each entry.
XFAIL the test on Windows and add a Windows only version of it?
I added Argyrios Kyrtzidis to the review since he has done some work on clang's file handling. He probably has an opinion on how to fix the virtual interface.
It may make sense to fix this together with file names case insensitivty on Windows
http://llvm.org/bugs/show_bug.cgi?id=17993