This revision was automatically updated to reflect the committed changes.
Closed by commit rL324238: [clang-format] Fixup #include guard indents after
parseFile() (authored by mzeren-vmw, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/
krasimir accepted this revision.
krasimir added a comment.
This revision is now accepted and ready to land.
Looks good! Thank you!
Comment at: lib/Format/UnwrappedLineParser.cpp:244
PPBranchLevel = -1;
- IfNdefCondition = nullptr;
- FoundIncludeGuardStart = false;
- Inclu
mzeren-vmw updated this revision to Diff 132394.
mzeren-vmw added a comment.
- Add comments to IncludeGuardState.
- Fix re-initialization of IncludeGuard in UnwrappedLineParser::reset.
- Remove unnecessary block after if.
- Rebase
Repository:
rC Clang
https://reviews.llvm.org/D42035
Files:
mzeren-vmw added inline comments.
Comment at: lib/Format/UnwrappedLineParser.cpp:244
PPBranchLevel = -1;
- IfNdefCondition = nullptr;
- FoundIncludeGuardStart = false;
- IncludeGuardRejected = false;
+ IncludeGuard = IG_Inited;
+ IncludeGuardToken = nullptr;
-
krasimir added a comment.
Looks good! Just some comments for the include guard states would be helpful.
Comment at: lib/Format/UnwrappedLineParser.h:259
+IG_Rejected,
+ };
+
Please put a short comment explaining each of these states.
Repository:
rC Cla
mzeren-vmw updated this revision to Diff 132320.
mzeren-vmw added a comment.
rebase, ping.
Repository:
rC Clang
https://reviews.llvm.org/D42035
Files:
lib/Format/UnwrappedLineParser.cpp
lib/Format/UnwrappedLineParser.h
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTest
mzeren-vmw created this revision.
mzeren-vmw added reviewers: euhlmann, krasimir, klimek.
Herald added a subscriber: cfe-commits.
When a preprocessor indent closes after the last line of normal code we do not
correctly fixup include guard indents. For example:
#ifndef HEADER_H
#define HEADER_