History log of /llvm-project/clang/lib/Format/WhitespaceManager.cpp (Results 126 – 150 of 183)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-4.0.1-rc1
# 92b397fb 23-Mar-2017 Nikola Smiljanic <popizdeh@gmail.com>

Fix issues in clang-format's AlignConsecutive modes.

Patch by Ben Harper.

llvm-svn: 298574


Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2
# d105b72d 03-Feb-2017 Krasimir Georgiev <krasimir@google.com>

[clang-format] Re-align broken comment lines where appropriate.

Summary:
The comment aligner was skipping over newly broken comment lines. This patch fixes that.

source:
```
int ab; // line
int a;

[clang-format] Re-align broken comment lines where appropriate.

Summary:
The comment aligner was skipping over newly broken comment lines. This patch fixes that.

source:
```
int ab; // line
int a; // long long
```

format with column limit 15 before:
```
int ab; // line
int a; // long
// long
```

format with column limit 15 after:
```
int ab; // line
int a; // long
// long
```

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 293997

show more ...


# 7d42f3f7 31-Jan-2017 Daniel Jasper <djasper@google.com>

[clang-format] Refactor WhitespaceManager and friends

The main motivation behind this is to cleanup the WhitespaceManager and
make it more extensible for future alignment etc. features.
Specifically

[clang-format] Refactor WhitespaceManager and friends

The main motivation behind this is to cleanup the WhitespaceManager and
make it more extensible for future alignment etc. features.
Specifically, WhitespaceManager has started to copy more and more code
that is already present in FormatToken. Instead, I think it makes more
sense to actually store a reference to each FormatToken for each change.

This has as a consequence led to a change in the calculation of indent
levels. Now, we actually compute them for each Token ahead of time,
which should be more efficient as it removes an unsigned value for the
ParenState, which is used during the combinatorial exploration of the
solution space.

No functional changes intended.

Review: https://reviews.llvm.org/D29300
llvm-svn: 293616

show more ...


# 91834227 25-Jan-2017 Krasimir Georgiev <krasimir@google.com>

[clang-format] Implement comment reflowing.

Summary:
This presents a version of the comment reflowing with less mutable state inside
the comment breakable token subclasses. The state has been pushed

[clang-format] Implement comment reflowing.

Summary:
This presents a version of the comment reflowing with less mutable state inside
the comment breakable token subclasses. The state has been pushed into the
driving breakProtrudingToken method. For this, the API of BreakableToken is enriched
by the methods getSplitBefore and getLineLengthAfterSplitBefore.

Reviewers: klimek

Reviewed By: klimek

Subscribers: djasper, klimek, mgorny, cfe-commits, ioeric

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

llvm-svn: 293055

show more ...


Revision tags: llvmorg-4.0.0-rc1
# 1ec383c7 23-Dec-2016 Piotr Padlewski <piotr.padlewski@gmail.com>

Use after move bug fixes

Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy.

Reviewers: rsmith, mboehme

Subscribers: cfe-commits, klimek

Differential Revision:

Use after move bug fixes

Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy.

Reviewers: rsmith, mboehme

Subscribers: cfe-commits, klimek

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

llvm-svn: 290424

show more ...


# 353395e3 19-Dec-2016 Benjamin Kramer <benny.kra@googlemail.com>

[Format] Remove dead code.

No functionality change.

llvm-svn: 290135


Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1
# a9a8fdee 26-Oct-2016 Andi-Bogdan Postelnicu <andi@mozilla.com>

Bug 28065 - clang-format incorrectly aligns backslash.

llvm-svn: 285178


Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2
# 40ef2fb3 01-Aug-2016 Eric Liu <ioeric@google.com>

Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
control how replacements for a single file are combined and provid

Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
control how replacements for a single file are combined and provide guarantee
on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
Use std::map<std::string, tooling::Replacements> to represent multi-file
replacements.
- Error handling for the interface change will be improved in followup patches.

Reviewers: djasper, klimek

Subscribers: cfe-commits

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

llvm-svn: 277335

show more ...


Revision tags: llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1
# 51fe279f 14-Apr-2016 Marianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>

clang-format: Implemented tab usage for continuation and indentation

Use tabs to fill whitespace at the start of a line.

Patch by Maxime Beaulieu

Differential Revision: http://reviews.llvm.org/D19

clang-format: Implemented tab usage for continuation and indentation

Use tabs to fill whitespace at the start of a line.

Patch by Maxime Beaulieu

Differential Revision: http://reviews.llvm.org/D19028

llvm-svn: 266320

show more ...


Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2
# bb37a2f6 01-Feb-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix alignment of trailing multiline columns.

llvm-svn: 259351


Revision tags: llvmorg-3.8.0-rc1
# dab50463 11-Jan-2016 Benjamin Kramer <benny.kra@googlemail.com>

[clang-format] Fix comment aligning when there are changes within the comment

As soon as a comment had whitespace changes inside of the token, we
couldn't identify the whole comment as a trailing co

[clang-format] Fix comment aligning when there are changes within the comment

As soon as a comment had whitespace changes inside of the token, we
couldn't identify the whole comment as a trailing comment anymore and
alignment stopped working. Add a new boolean to Change for this special
case and fix trailing comment identification to use it.

This also changes WhitespaceManager to sum the length of all Changes
inside of a token into the first Change.

Before this fix

int xy; // a
int z; //b

became

int xy; // a
int z; // b

with this patch we immediately get to:

int xy; // a
int z; // b

Differential Revision: http://reviews.llvm.org/D16058

llvm-svn: 257341

show more ...


# 417fc815 09-Jan-2016 Daniel Jasper <djasper@google.com>

clang-format: Improve selective comment formatting.

Starting here:
int x; // Format this line only.
int xx; //
int xxxxx; //

Before:
int x; // Format this line only.
int xx; //
int

clang-format: Improve selective comment formatting.

Starting here:
int x; // Format this line only.
int xx; //
int xxxxx; //

Before:
int x; // Format this line only.
int xx; //
int xxxxx; //

After:
int x; // Format this line only.
int xx; //
int xxxxx; //

llvm-svn: 257258

show more ...


# ec90e51c 01-Dec-2015 Daniel Jasper <djasper@google.com>

This fixes https://llvm.org/bugs/show_bug.cgi?id=25329, as well as
misalignments like the following:

int a, b = 2;
int c = 3;

Patch by Beren Minor, thanks!

llvm-svn: 254406


Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1
# 39828256 07-Oct-2015 Daniel Jasper <djasper@google.com>

[clang-format] Stop alignment sequences on open braces and parens when
aligning assignments.

This was done correctly when aligning the declarations, but not when
aligning assignments.

FIXME: The co

[clang-format] Stop alignment sequences on open braces and parens when
aligning assignments.

This was done correctly when aligning the declarations, but not when
aligning assignments.

FIXME: The code between assignments and declarations alignment is
roughly duplicated and
would benefit from factorization.

Bug 25090: https://llvm.org/bugs/show_bug.cgi?id=25090

Patch by Beren Minor. Thank you.

llvm-svn: 249552

show more ...


# e335f259 04-Oct-2015 Craig Topper <craig.topper@gmail.com>

SourceRanges are small and trivially copyable, don't them by reference.

llvm-svn: 249259


# e12597cc 01-Oct-2015 Daniel Jasper <djasper@google.com>

[clang-format] Add support of consecutive declarations alignment

This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code

[clang-format] Add support of consecutive declarations alignment

This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code
in the same way the alignment of assignations is.

The code is a slightly modified version of the consecutive assignment
alignment code. Currently only the identifiers are aligned, and there is
no support of alignment of the pointer star or reference symbol.

The patch also solve the issue of alignments not being possible due to
the ColumnLimit for both the existing AlignConsecutiveAligments and the
new AlignConsecutiveDeclarations.

Patch by Beren Minor, thank you.

Review: http://reviews.llvm.org/D12362
llvm-svn: 248999

show more ...


# bbfd20d7 22-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix alignConsecutiveAssignments.

It wasn't correctly handling this case:

int oneTwoThree = 123;
int oneTwo = 12;
method();

Review: http://reviews.llvm.org/D12369
Patch by

clang-format: Fix alignConsecutiveAssignments.

It wasn't correctly handling this case:

int oneTwoThree = 123;
int oneTwo = 12;
method();

Review: http://reviews.llvm.org/D12369
Patch by Beren Minor. Thank you!

llvm-svn: 248254

show more ...


Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1
# ddf1cda2 28-May-2015 Benjamin Kramer <benny.kra@googlemail.com>

[Format] Skip creating temporary std::strings when filling another string.

No functional change intended.

llvm-svn: 238466


Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1
# a4499133 29-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: Add ability to align assignment operators.

In Objective-C some style guides use a style where assignment operators are
aligned, in an effort to increase code readability. This patch ad

clang-format: Add ability to align assignment operators.

In Objective-C some style guides use a style where assignment operators are
aligned, in an effort to increase code readability. This patch adds an option
to the format library which allows this functionality. It is disabled by
default for all the included styles, so it must be explicitly enabled.

The option will change code such as:
- (void)method {
NSNumber *one = @1;
NSNumber *twentyFive = @25;
}

to:
- (void)method {
NSNumber *one = @1;
NSNumber *twentyFive = @25;
}

Patch by Matt Oakes. Thank you!

Accidentally reformatted all the tests...

llvm-svn: 236100

show more ...


Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1
# 2d293400 03-Mar-2015 Manuel Klimek <klimek@google.com>

Make sure we initialize all values in WhitespaceManager::Change.

llvm-svn: 231067


# 0391e556 03-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix access to uninitialized memory.

With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can

clang-format: Fix access to uninitialized memory.

With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can continue a preprocessor directive and initialize values
accordingly.

llvm-svn: 231066

show more ...


Revision tags: llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2
# 47b35aea 29-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix crasher caused by not properly setting dry-run.

llvm-svn: 227427


Revision tags: llvmorg-3.6.0-rc1
# 49532104 07-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Understand single-line comments at the end of blocks.

This prevents clang-format from moving/aligning the comment in the
snippet:
void f() {
int i; // some comment
// some un

clang-format: Understand single-line comments at the end of blocks.

This prevents clang-format from moving/aligning the comment in the
snippet:
void f() {
int i; // some comment
// some unrelated comment
}

llvm-svn: 225352

show more ...


Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1
# a98b7b01 25-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Refactoring.

Re-apply r222638 and r222641 without variadic templates.

llvm-svn: 222747


# 484ee9b4 24-Nov-2014 Aaron Ballman <aaron@aaronballman.com>

Reverting r222638; it broke the MSVC build bots because Visual Studio 2012 does not support variadic templates. Also reverting r222641 because it was relying on 222638.

llvm-svn: 222656


12345678