HomePhabricator

[clang-format] Add new style option IndentGotoLabels

Authored by MyDeveloperDay on Sep 12 2019, 3:07 AM.

Description

[clang-format] Add new style option IndentGotoLabels

Summary:
This option determines whether goto labels are indented according to scope. Setting this option to false causes goto labels to be flushed to the left.
This is mostly copied from this patch submitted by Christian Neukirchen that didn't make its way into trunk.

true:                                  false:
int f() {                      vs.     int f() {
  if (foo()) {                           if (foo()) {
  label1:                              label1:
    bar();                                 bar();
  }                                      }
label2:                                label2:
  return 1;                              return 1;
}                                      }

Reviewers: klimek, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang, #clang-tools-extra

Patch by: tetsuo-cpp

Differential Revision: https://reviews.llvm.org/D67037

llvm-svn: 371719