- Nov 27, 2017
-
-
Krasimir Georgiev authored
Summary: This patch allows grouping multiple #include blocks together and sort all includes as one big block. Additionally, sorted includes can be regrouped after sorting based on configured categories. Contributed by @KrzysztofKapusta! Reviewers: krasimir Reviewed By: krasimir Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D40288 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319024 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 17, 2017
-
-
Stephan Bergmann authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318530 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 09, 2017
-
-
Krasimir Georgiev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317799 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
Summary: This patch improves using declarations sorting. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39786 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317794 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 12, 2017
-
-
Sylvestre Ledru authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315568 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 15, 2017
-
-
Krasimir Georgiev authored
Summary: Bug: https://bugs.llvm.org/show_bug.cgi?id=34016 - **"extern C part"** **Problem:** Due to the lack of "brace wrapping extern" flag, clang format does parse the block after **extern** keyword moving the opening bracket to the header line always! **Patch description:** A new style added, new configuration flag - **BraceWrapping.AfterExternBlock** that allows us to decide whether we want a break before brace or not. Reviewers: djasper, krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37845 Contributed by @PriMee! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313354 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 07, 2017
-
-
Daniel Jasper authored
The current description of AllowAllParametersOfDeclarationOnNextLine in the Clang-Format Style Options guide suggests that it is possible to format function declaration, which fits in a single line (what is not supported in current clang-format version). Also the example was not reproducible and mades no sense. Patch by Lucja Mazur, thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312721 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312717 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
Summary: Looks like we are out of sync between the doc and the code. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37558 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312716 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 30, 2017
-
-
Krasimir Georgiev authored
Summary: This is an implementation for [bug 17362](https://bugs.llvm.org/attachment.cgi?bugid=17362) which adds support for indenting preprocessor statements inside if/ifdef/endif. This takes previous work from fmauch (https://github.com/fmauch/clang/tree/preprocessor_indent) and makes it into a full feature. The context of this patch is that I'm a VMware intern, and I implemented this because VMware needs the feature. As such, some decisions were made based on what VMware wants, and I would appreciate suggestions on expanding this if necessary to use-cases other people may want. This adds a new enum config option, `IndentPPDirectives`. Values are: * `PPDIS_None` (in config: `None`): ``` #if FOO #if BAR #include <foo> #endif #endif ``` * `PPDIS_AfterHash` (in config: `AfterHash`): ``` #if FOO # if BAR # include <foo> # endif #endif ``` This is meant to work whether spaces or tabs are used for indentation. Preprocessor indentation is independent of indentation for non-preprocessor lines. Preprocessor indentation also attempts to ignore include guards with the checks: 1. Include guards cover the entire file 2. Include guards don't have `#else` 3. Include guards begin with ``` #ifndef <var> #define <var> ``` This patch allows `UnwrappedLineParser::PPBranchLevel` to be decremented to -1 (the initial value is -1) so the variable can be used for indent tracking. Defects: * This patch does not handle the case where there's code between the `#ifndef` and `#define` but all other conditions hold. This is because when the #define line is parsed, `UnwrappedLineParser::Lines` doesn't hold the previous code line yet, so we can't detect it. This is out of the scope of this patch. * This patch does not handle cases where legitimate lines may be outside an include guard. Examples are `#pragma once` and `#pragma GCC diagnostic`, or anything else that does not change the meaning of the file if it's included multiple times. * This does not detect when there is a single non-preprocessor line in front of an include-guard-like structure where other conditions hold because `ScopedLineState` hides the line. * Preprocessor indentation throws off `TokenAnnotator::setCommentLineLevels` so the indentation of comments immediately before indented preprocessor lines is toggled on each run. Fixing this issue appears to be a major change and too much complexity for this patch. Contributed by @euhlmann! Reviewers: djasper, klimek, krasimir Reviewed By: djasper, krasimir Subscribers: krasimir, mzeren-vmw, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D35955 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312125 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 23, 2017
-
-
Krasimir Georgiev authored
Summary: This patch adds a `SortUsingDeclaration` style option and enables it for llvm style. Reviewers: klimek Reviewed By: klimek Subscribers: klimek Differential Revision: https://reviews.llvm.org/D34453 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306094 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
Summary: This updates the format options documentation script to indent the documentation of nested fields. The previous format caused some problems, as when a bulleted list ends with a multiline comment. See the buildbot failure http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/10020/steps/docs-clang-html/logs/stdio Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34552 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306093 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
Summary: Style documentation is generated automatically by `docs/tools/dump_format_style.py`. This hasn't been ran for a while. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D34457 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306089 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 15, 2017
-
-
Eric Fiselier authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305450 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 06, 2017
-
-
Sylvestre Ledru authored
Patch sent through github by Jason Hsu git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304776 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 08, 2017
-
-
Daniel Jasper authored
DontAlign This converts the clang-format option AlignEscapedNewlinesLeft from a boolean to an enum, named AlignEscapedNewlines, with options Left (prev. true), Right (prev. false), and a new option DontAlign. When set to DontAlign, the backslashes are placed just after the last token in each line: #define EXAMPLE \ do { \ int x = aaaaa; \ int b; \ int dddddddddd; \ } while (0) Patch by jtbandes. Thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302428 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 11, 2017
-
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: Eugene.Zelenko, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D31408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299919 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 05, 2017
-
-
Nico Weber authored
clang-format <<END auto c1 = u8'a'; auto c2 = u'a'; END Before: auto c1 = u8 'a'; auto c2 = u'a'; Now: auto c1 = u8'a'; auto c2 = u'a'; Patch from Denis Gladkikh <llvm@denis.gladkikh.email>! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299574 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 20, 2017
-
-
Jonathan Roelofs authored
... mostly having to do with code blocks which the syntax highlighter chokes on git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298275 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D30990 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298245 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 13, 2017
-
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30860 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297623 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 10, 2017
-
-
Andi-Bogdan Postelnicu authored
Differential Revision: https://reviews.llvm.org/D30487 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297467 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 09, 2017
-
-
Sylvestre Ledru authored
Summary: For example, "int\* a;" is displayed instead of "int* a;" Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30740 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297363 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 08, 2017
-
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30734 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297275 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 06, 2017
-
-
Sylvestre Ledru authored
Reviewers: klimek, djasper Reviewed By: djasper Subscribers: krasimir, kimgr, cfe-commits Differential Revision: https://reviews.llvm.org/D30532 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297025 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 01, 2017
-
-
Krasimir Georgiev authored
Summary: This patch enables namespace end comments under a new flag FixNamespaceComments, which is enabled for the LLVM and Google styles. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30405 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296632 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 09, 2016
-
-
Sylvestre Ledru authored
Summary: This is required for compliance with the Mozilla style guide. This is a rebase+minor change of Birunthan Mohanathas's patch Reviewers: djasper Subscribers: klimek, cfe-commits, opilarium Differential Revision: https://reviews.llvm.org/D23317 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278121 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 21, 2016
-
-
Daniel Jasper authored
This patch adds a regular expression to configure suffixes of an included file to check whether it is the "main" include of the current file. Previously, clang-format has allowed arbitrary suffixes on the formatted file, which is still the case when no IncludeMainRegex is specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263943 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 27, 2016
-
-
https://bugzilla.gnome.org/show_bug.cgi?id=506243Alexander Kornienko authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262138 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 23, 2016
-
-
Alexander Kornienko authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261646 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexander Kornienko authored
Use uniform style for inline code blocks, specify language for YAML code blocks, various formatting fixes etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261645 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexander Kornienko authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261643 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 14, 2016
-
-
Sylvestre Ledru authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260856 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 18, 2015
-
-
Zachary Turner authored
This changes the behavior of AlwaysBreakAfterDeclarationReturnType so that it supports breaking after declarations, definitions, or both. Differential Revision: http://reviews.llvm.org/D10370 Reviewed By: Daniel Jasper git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256046 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 27, 2015
-
-
Daniel Jasper authored
Summary: If this option is set, clang-format will always insert a line wrap, e.g. before the first parameter of a function call unless all parameters fit on the same line. This obviates the need to make a decision on the alignment itself. Use this style for Google's JavaScript style and add some minor tweaks to correctly handle nested blocks etc. with it. Don't use this option for for/while loops. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D14104 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251405 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 07, 2015
-
-
Daniel Jasper authored
Otherwise I will have to install sphinx ;).. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249542 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 06, 2015
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249394 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
This was made much easier by introducing an IncludeCategory struct to replace the previously used std::pair. Also, cleaned up documentation and added examples. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249392 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 05, 2015
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249312 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
statement. Specifically, we don't want people that have already written a patch to just write a style guide for their 1-person project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249290 91177308-0d34-0410-b5e6-96231b3b80d8
-