This is an archive of the discontinued LLVM Phabricator instance.

Clean "./" from __FILE__ expansion.
ClosedPublic

Authored by ppluzhnikov on May 25 2022, 10:23 AM.

Details

Summary

This is alternative to https://reviews.llvm.org/D121733
and helps with Clang header modules in which FILE
may expand to "./foo.h" or "foo.h" depending on whether the file was
included directly or not.

Only do this when UseTargetPathSeparator is true, as we are already
changing the path in that case.

Diff Detail

Event Timeline

ppluzhnikov created this revision.May 25 2022, 10:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 10:23 AM

Also fix a buglet in remove_dots().

Rebase to ToT.

ppluzhnikov published this revision for review.Jun 2 2022, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 2:09 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ayzhao accepted this revision.Jun 2 2022, 2:19 PM
This revision is now accepted and ready to land.Jun 2 2022, 2:19 PM

Alan,

Thanks for the approval.
Could you push this patch -- I don't have commit rights.

This revision was automatically updated to reflect the committed changes.
ayzhao added a comment.Jun 2 2022, 3:00 PM

Alan,

Thanks for the approval.
Could you push this patch -- I don't have commit rights.

Done

Is it feasible to add a test?

Is it feasible to add a test?

Sure. I extended the existing tests added in https://reviews.llvm.org/D122766 to cover this.
https://reviews.llvm.org/D127009