This is an archive of the discontinued LLVM Phabricator instance.

Fix for include file resolution on Windows
Needs ReviewPublic

Authored by selcott on Jan 7 2015, 3:44 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Fix for failure to resolve include files on Windows when the files in question are virtual, i.e. created with mapVirtualFile(). The files are searched for in a hash which is keyed on the file's normalized path as a string. Searches for a file in that hash will fail unless the search path is in the exact same textual form.

Diff Detail

Event Timeline

selcott updated this revision to Diff 17877.Jan 7 2015, 3:44 PM
selcott retitled this revision from to Fix for include file resolution on Windows.
selcott updated this object.
selcott edited the test plan for this revision. (Show Details)
selcott added a subscriber: Unknown Object (MLST).

I've previously encountered a problem fixing this:

http://reviews.llvm.org/D3686

clang/test/Misc/remap-file.c was failing since FileManager considers / different than \.
Is this test passing for you?

It should be possible to add a testcase showing that we now add a \ instead of a / on windows, no?

Yes, you're right, remap-file.c fails with this change. FWIW, the test is flawed. It verifies the following very specific (and incorrect) matching logic, which is to accept only paths where all separators excluding the final one are backslashes, and only the final one is a forward slash. I.e. C:\path\to\the/file.h

Anyway, here's another patch that fixes that one too.

selcott updated this revision to Diff 17899.Jan 8 2015, 8:28 AM