summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineFormatter.cpp
diff options
context:
space:
mode:
authorPaul Hoad <mydeveloperday@gmail.com>2019-03-13 08:15:03 +0000
committerPaul Hoad <mydeveloperday@gmail.com>2019-03-13 08:15:03 +0000
commitd74c055fe640d85d5fb22e261770601567c769ee (patch)
tree1797a4d04748a8a1c372aa74c9039d828de60c4d /clang/lib/Format/UnwrappedLineFormatter.cpp
parent6d294f28e9a24ca941f88bce7c8ed98d5931a3fc (diff)
downloadbcm5719-llvm-d74c055fe640d85d5fb22e261770601567c769ee.tar.gz
bcm5719-llvm-d74c055fe640d85d5fb22e261770601567c769ee.zip
Revert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present"
This reverts commit b358cbb9b78389e20f7be36e1a98e26515c3ecce. llvm-svn: 356030
Diffstat (limited to 'clang/lib/Format/UnwrappedLineFormatter.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineFormatter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp
index f14e3851c8d..a62755840df 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -413,12 +413,10 @@ private:
if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while,
TT_LineComment))
return 0;
- // Only inline simple if's (no nested if or else), unless specified
- if (Style.AllowShortIfStatementsOnASingleLine != FormatStyle::SIS_Always) {
- if (I + 2 != E && Line.startsWith(tok::kw_if) &&
- I[2]->First->is(tok::kw_else))
- return 0;
- }
+ // Only inline simple if's (no nested if or else).
+ if (I + 2 != E && Line.startsWith(tok::kw_if) &&
+ I[2]->First->is(tok::kw_else))
+ return 0;
return 1;
}
OpenPOWER on IntegriCloud