summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-09-04 13:33:52 +0000
committerDaniel Jasper <djasper@google.com>2017-09-04 13:33:52 +0000
commit4df130f94192faf5cb8535a9fdce18d1c4c33de1 (patch)
tree2645be312e9578f54cf630b858bafa741d8daf3b /clang/lib/Format/UnwrappedLineParser.cpp
parent1fab4f8a593099fb1b8964f5e9f9b6e4dfd6e8aa (diff)
downloadbcm5719-llvm-4df130f94192faf5cb8535a9fdce18d1c4c33de1.tar.gz
bcm5719-llvm-4df130f94192faf5cb8535a9fdce18d1c4c33de1.zip
clang-format: Fix indentation of macros in include guards (after r312125).
Before: #ifndef A_H #define A_H #define A() \ int i; \ int j; #endif // A_H After: #ifndef A_H #define A_H #define A() \ int i; \ int j; #endif // A_H llvm-svn: 312484
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index c0cb461418b..b15e52aeb2c 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -742,12 +742,11 @@ void UnwrappedLineParser::parsePPEndIf() {
// preprocessor indent.
unsigned TokenPosition = Tokens->getPosition();
FormatToken *PeekNext = AllTokens[TokenPosition];
- if (FoundIncludeGuardStart && PPBranchLevel == -1 && PeekNext->is(tok::eof)) {
- for (auto &Line : Lines) {
+ if (FoundIncludeGuardStart && PPBranchLevel == -1 && PeekNext->is(tok::eof) &&
+ Style.IndentPPDirectives != FormatStyle::PPDIS_None)
+ for (auto &Line : Lines)
if (Line.InPPDirective && Line.Level > 0)
--Line.Level;
- }
- }
}
void UnwrappedLineParser::parsePPDefine() {
OpenPOWER on IntegriCloud