Go to file
Paul Hoad 6d294f28e9 [clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present
Summary:
Addressing: PR25010 - https://bugs.llvm.org/show_bug.cgi?id=25010

Code like:

```
    if(true) var++;
    else  {
        var--;
    }
```

is reformatted to be

```
  if (true)
    var++;
  else {
    var--;
  }
```

Even when `AllowShortIfStatementsOnASingleLine` is true

The following revision comes from a +1'd suggestion in the PR to support AllowShortIfElseStatementsOnASingleLine

This suppresses the clause prevents the merging of the if when there is a compound else

Reviewers: klimek, djasper, JonasToth, alexfh, krasimir, reuk
Reviewed By: reuk
Subscribers: reuk, Higuoxing, jdoerfert, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D59087

llvm-svn: 356029
2019-03-13 08:07:46 +00:00
clang [clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present 2019-03-13 08:07:46 +00:00
clang-tools-extra [clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present 2019-03-13 08:07:46 +00:00
compiler-rt AddressSanitizer: 64-bit SPARC/Linux port 2019-03-12 21:02:24 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc sincos: Simplify declaration headers. 2019-03-13 07:13:34 +00:00
libcxx [libc++] Enable deprecation warnings by default 2019-03-12 20:10:06 +00:00
libcxxabi Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/" 2019-03-08 20:33:55 +00:00
libunwind Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/" 2019-03-08 20:33:55 +00:00
lld [WebAssembly] Handle undefined data symbols in shared libraries 2019-03-12 21:53:23 +00:00
lldb [TestBatchMode] We already log this output to a file. 2019-03-13 02:47:51 +00:00
llgo Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
llvm [clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present 2019-03-13 08:07:46 +00:00
openmp [OpenMP][stats] Update stats gathering macros 2019-03-08 21:23:34 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly [opaque pointer types] Update calls to CreateCall to pass the function 2019-02-08 19:30:46 +00:00
pstl [pstl] Deprecate non-CMake based build 2019-03-12 13:54:37 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.