This is an archive of the discontinued LLVM Phabricator instance.

[clang][lex][minimizer] Avoid treating path separators as comments
ClosedPublic

Authored by jansvoboda11 on Feb 8 2022, 2:12 AM.

Details

Summary

The minimizer strips out single-line comments (introduced by //). This sequence of characters can also appear in #include or #import directives where they play the role of path separators. We already avoid stripping this character sequence for #include but not for #import (which has the same semantics). This patch makes it so #import <A//A.h> is not affected by minimization. Previously, we would incorrectly reduce it into #import <A.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Feb 8 2022, 2:12 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2022, 2:12 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
arphaman accepted this revision.Feb 11 2022, 12:02 PM

Cheers, LGTM

This revision is now accepted and ready to land.Feb 11 2022, 12:02 PM