This is an archive of the discontinued LLVM Phabricator instance.

Correctly implement -include search logic.
ClosedPublic

Authored by klimek on Aug 7 2014, 6:57 AM.

Details

Reviewers
nicholas
rsmith
Summary

According to the gcc docs, -include uses the current working directory for
the lookup instead of the main source file.

This patch gets rid of NormalizeIncludePath (which relied on an implementation
detail of FileManager / FileEntry for the include path logic to work), and
instead hands the correct lookup information down to LookupFile.

This will allow us to change the FileEntry's behavior regarding its Name
caching.

Diff Detail

Event Timeline

klimek updated this revision to Diff 12281.Aug 7 2014, 6:57 AM
klimek retitled this revision from to Correctly implement -include search logic..
klimek updated this object.
klimek edited the test plan for this revision. (Show Details)
klimek added reviewers: rsmith, nicholas.
klimek added a subscriber: Unknown Object (MLST).
rsmith accepted this revision.Aug 11 2014, 11:00 AM
rsmith edited edge metadata.

LGTM

lib/Frontend/InitPreprocessor.cpp
69

Please include a comment here indicating that header search will search the current working directory for includes in the buffer.

This revision is now accepted and ready to land.Aug 11 2014, 11:00 AM
klimek closed this revision.Aug 12 2014, 1:35 AM

Committed as r215433. Thx.

lib/Frontend/InitPreprocessor.cpp
69

Done.