This is an archive of the discontinued LLVM Phabricator instance.

Fix bugs when an included file name is typo corrected.
ClosedPublic

Authored by thakis on May 7 2020, 1:32 PM.

Details

Summary

D52774 fixed a bug with typo correction of includes, but didn't add
a test.

D65907 then broke recovery of typo correction of includes again,
because it extracted the code that writes to Filename to a separate
function that took the parameter not by reference.

Fix that, and also don't repeat the slash normalization computation
and fix both lookup and regular file name after recovery.

Diff Detail

Event Timeline

thakis created this revision.May 7 2020, 1:32 PM
hans accepted this revision.May 8 2020, 8:45 AM

lgtm

This revision is now accepted and ready to land.May 8 2020, 8:45 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2020, 10:43 AM
abhinavgaba added inline comments.
clang/test/Lexer/case-insensitive-include-win.c
8

The test is currently failing if path of an existing directory in a network mounted drive, using forward slashes, is in CPATH. (e.g. export CPATH=//abc.def.com/dir1).

The error in that case is:

fatal error: cannot open file
      '//abc.def.com/dir1\?\<path_to_clang_dir>\test\Lexer\Output\case-insensitive-include-win.c.tmp.dir\FOO.h':
      The specified path is invalid.
skan added a subscriber: skan.May 11 2020, 7:15 PM
abhinavgaba added inline comments.May 13 2020, 3:33 PM
clang/test/Lexer/case-insensitive-include-win.c
8

Did you get a chance to look at this?