diff options
author | Daniel Jasper <djasper@google.com> | 2013-09-02 08:26:29 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-09-02 08:26:29 +0000 |
commit | 7240762504f219b61b8fae6b2adc123ac0fba466 (patch) | |
tree | ec823a86ca6c8fa034529f1be9875d512c5e686a /clang/lib/Format/UnwrappedLineParser.cpp | |
parent | b25f0f5538fbca6a24987150b1b059801e111001 (diff) | |
download | bcm5719-llvm-7240762504f219b61b8fae6b2adc123ac0fba466.tar.gz bcm5719-llvm-7240762504f219b61b8fae6b2adc123ac0fba466.zip |
clang-format: Fix case-indentation in macros.
Before:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name
After:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name
llvm-svn: 189743
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index fb63899f471..a149c185aa8 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -235,8 +235,9 @@ void UnwrappedLineParser::parseLevel(bool HasOpeningBrace) { break; case tok::kw_default: case tok::kw_case: - if (!SwitchLabelEncountered) - Line->Level += Style.IndentCaseLabels; + if (!SwitchLabelEncountered && + (Style.IndentCaseLabels || (Line->InPPDirective && Line->Level == 1))) + ++Line->Level; SwitchLabelEncountered = true; parseStructuralElement(); break; @@ -864,8 +865,6 @@ void UnwrappedLineParser::parseDoWhile() { } void UnwrappedLineParser::parseLabel() { - if (FormatTok->Tok.isNot(tok::colon)) - return; nextToken(); unsigned OldLineLevel = Line->Level; if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0)) |