This is an archive of the discontinued LLVM Phabricator instance.

[clang][lex] Add minimizer option to pad the output to the input size
AbandonedPublic

Authored by jansvoboda11 on Jun 17 2021, 7:25 AM.

Details

Summary

This patch adds a configuration point to the source minimizer to pad the output to the input size with whitespace. This is useful in D104465.

Depends on D104459.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Jun 17 2021, 7:25 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2021, 7:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 edited the summary of this revision. (Show Details)Jun 17 2021, 7:45 AM
dexonsmith requested changes to this revision.Jun 17 2021, 11:57 AM

I'm not sure D104465 (the motivation for this patch) is the right approach, but we can have that discussion over there.

clang/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp
24

Why turn this on all the time? That adds a lot of noise below. Can you instead just turn it on for specific targeted tests?

Also, maybe I just missed it, but I don't see any tests that check the behaviour of this flag.

113–115

I'm uncomfortable dropping the check that #define MACRO\n\n\n turns into precisely #define MACRO\n.

This revision now requires changes to proceed.Jun 17 2021, 11:57 AM

I agree with Duncan, it would be good to avoid modifying the existing test cases if possible

jansvoboda11 abandoned this revision.Jul 15 2021, 2:08 PM