Page MenuHomePhabricator
Feed Advanced Search

Mar 5 2020

krasimir created D75675: [clang-format] do not insert spaces around inline asm symbolic names.
Mar 5 2020, 4:56 AM · Restricted Project, Restricted Project

Mar 4 2020

krasimir accepted D75606: [clang-format] Improve identification of C# nullables.

Looks good with 1 suggestion.

Mar 4 2020, 7:52 AM · Restricted Project, Restricted Project
krasimir accepted D75473: [clang-format] parse C# object initialisers.

Thank you!

Mar 4 2020, 4:33 AM · Restricted Project, Restricted Project

Mar 3 2020

krasimir accepted D75517: [clang-format] Do not format C# array subscript operators as attributes.
Mar 3 2020, 1:13 PM · Restricted Project, Restricted Project
krasimir added a comment to D75194: [clang-format] Do not merge very long C# automatic properties.

Here's some empirical ideas about the approach: In clang-format, braces can be handled in two quite distinct ways, controlled by BraceBlockKind: BK_Block and BK_BracedInit.
BK_Block is for braces that open blocks that usually are at one level deeper and consist of a sequence of statements and other constructs.
BK_BracedInit is for initializer lists, dictionaries and other similar syntactics that are somewhat more appropriate to put together into a line.
The level of granularity of detailed formatting in clang-format is an unwrapped line, which is conceptually a sequence of tokens that "make sense together as a single line" (without going much into style details and ignoring column limits). Separate statements are for example put on separate unwrapped lines. The formatting information flowing between unwrapped lines includes just higher-level data such as the current nesting depth.
The brace detection is handled primarily in UnwrappedLineParser::calculateBraceTypes, which happens quite early during the parsing of the input sequence.

Mar 3 2020, 12:37 PM · Restricted Project, Restricted Project
krasimir added inline comments to D75473: [clang-format] parse C# object initialisers.
Mar 3 2020, 11:57 AM · Restricted Project, Restricted Project
krasimir accepted D75465: [clang-format] Do not merge target-name and : for C# attributes.

Thank you for the explanations! Looking good!

Mar 3 2020, 11:57 AM · Restricted Project, Restricted Project
krasimir accepted D75455: [clang-format] Allow nested [] in C# attributes.

That's a bit of a hack (we probably need to hook up full-fledged argument list parsing for complete handling), but this seems like a good trade-off between heuristics and results right now.

Mar 3 2020, 5:02 AM · Restricted Project, Restricted Project

Mar 2 2020

krasimir added inline comments to D75465: [clang-format] Do not merge target-name and : for C# attributes.
Mar 2 2020, 4:38 PM · Restricted Project, Restricted Project
krasimir added inline comments to D75465: [clang-format] Do not merge target-name and : for C# attributes.
Mar 2 2020, 4:38 PM · Restricted Project, Restricted Project
krasimir accepted D75456: [clang-format] Rename CSharpNullConditionalSq and add missing test.

Thank you!

Mar 2 2020, 7:24 AM · Restricted Project, Restricted Project
krasimir added a comment to D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#.

Sorry, did the last round of comments not make sense?

Mar 2 2020, 6:42 AM · Restricted Project, Restricted Project
krasimir accepted D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#.
Mar 2 2020, 5:29 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#.
Mar 2 2020, 3:53 AM · Restricted Project, Restricted Project

Feb 28 2020

krasimir accepted D75336: [clang-format] Improve C# handling of spaces in square brackets.
Feb 28 2020, 4:59 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75194: [clang-format] Do not merge very long C# automatic properties.
Feb 28 2020, 4:59 AM · Restricted Project, Restricted Project

Feb 27 2020

krasimir accepted D75261: [clang-format] Recognize C# nullable types.
Feb 27 2020, 11:35 AM · Restricted Project, Restricted Project
krasimir accepted D75244: [clang-format] Recognize C# named argument colons as a token type.

This is very nice! Brings the C# handling of the colon closer to other languages.

Feb 27 2020, 5:29 AM · Restricted Project, Restricted Project

Feb 26 2020

krasimir accepted D75182: [clang-format] Handle commas in [] in C#.
Feb 26 2020, 8:44 AM · Restricted Project, Restricted Project
krasimir accepted D75129: [clang-format] Special handling of spaces for C# code.
Feb 26 2020, 6:45 AM · Restricted Project, Restricted Project
krasimir added inline comments to D75129: [clang-format] Special handling of spaces for C# code.
Feb 26 2020, 5:06 AM · Restricted Project, Restricted Project

Feb 25 2020

krasimir added a comment to D75129: [clang-format] Special handling of spaces for C# code.

As a general comment, we should consider which of these special cases can already be simulated by a combination of existing style options:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
There are several Spaces* options there that can be used to independently control various spacing around parenthesis.

Feb 25 2020, 10:38 AM · Restricted Project, Restricted Project
krasimir added a comment to D74952: [clang-format] Align chained method invocations for C# code.

This works nice for many examples, however I want to point out some limitations of using WhitespaceManager for this.
The alignment code in WhitespaceManager is conceptually at the end of the formatting pipeline, where all of the formatting decisions (where to break a line and what indentation to use for the following line) have already been fixed.
The code here attempts to do a post-processing pass that re-arranges some tokens, without being able to "deeply" affect / fix formatting.
As such is usually used either for non-compound constructs (aligning trailing comments) or in cases where the alignment is best-effort.
The tricky part of this is that, if not careful, aligning using the WhitespaceManager could introduce instances of lines that start going over the column limit as a result of alignment.
If you attempt to re-format the resulting code then, clang-format might take different formatting decisions for such lines, resulting in unstable formatting.

Feb 25 2020, 8:01 AM · Restricted Project
krasimir accepted D75006: [clang-format] Wrap lines for C# property accessors.

This is pretty cool!

Feb 25 2020, 5:18 AM · Restricted Project, Restricted Project

Feb 20 2020

krasimir accepted D74894: [clang-format] Merge name and colon into a single token for C# named arguments.

Thank you!

Feb 20 2020, 10:29 AM · Restricted Project, Restricted Project
krasimir added inline comments to D74894: [clang-format] Merge name and colon into a single token for C# named arguments.
Feb 20 2020, 5:28 AM · Restricted Project, Restricted Project

Feb 11 2020

krasimir accepted D74265: [clang-format] Improve handling of C# attributes.
Feb 11 2020, 3:34 AM · Restricted Project, Restricted Project

Feb 5 2020

krasimir accepted D74043: [clang-format] Do not treat C# attribute targets as labels.
Feb 5 2020, 8:03 AM · Restricted Project, Restricted Project
krasimir accepted D74050: [clang-format] Do not merge short C# class definitions into one line.

Thanks! Looks like this is OK also for Java, I'm not sure about ObjC. If it happens to affect other languages negatively, we can restrict by adding language-specific checks.

Feb 5 2020, 7:53 AM · Restricted Project, Restricted Project
krasimir added a comment to D74043: [clang-format] Do not treat C# attribute targets as labels.

This seems OK, but it feels a bit messy that the text [target: becomes the opening square bracket. I think this might be just good enough for these attributes, so I'm ok with this for now. But a more principled solution (for later, if we hit any dead ends with this) would be to introduce a new AnnotateToken type, like TT_CSharpAttributeTarget and make sure these are annotated properly.

Feb 5 2020, 5:59 AM · Restricted Project, Restricted Project

Jan 31 2020

krasimir accepted D72401: Fixes for spaces around C# object initializers.

Thank you!

Jan 31 2020, 5:51 AM · Restricted Project, Restricted Project

Jan 30 2020

krasimir accepted D73622: [clang-format] Improve support for multiline C# strings.
Jan 30 2020, 4:49 AM · Restricted Project, Restricted Project

Jan 29 2020

krasimir accepted D73622: [clang-format] Improve support for multiline C# strings.
Jan 29 2020, 7:40 AM · Restricted Project, Restricted Project
krasimir added a comment to D73622: [clang-format] Improve support for multiline C# strings.

This is pretty cool! Just a couple of nits.

Jan 29 2020, 7:12 AM · Restricted Project, Restricted Project

Jan 28 2020

krasimir accepted D73492: [clang-format] Handle quotes and escaped braces in C# interpolated strings.
Jan 28 2020, 6:22 AM · Restricted Project, Restricted Project
krasimir added inline comments to D73492: [clang-format] Handle quotes and escaped braces in C# interpolated strings.
Jan 28 2020, 3:00 AM · Restricted Project, Restricted Project

Jan 27 2020

krasimir added inline comments to D73354: clang-format: insert trailing commas into containers..
Jan 27 2020, 8:25 AM · Restricted Project, Restricted Project
krasimir committed rG36a8f7f6d8f5: [clang-format] Handle escaped " in C# string-literals (authored by krasimir).
[clang-format] Handle escaped " in C# string-literals
Jan 27 2020, 3:58 AM
krasimir closed D73353: [clang-format] Handle escaped " in C# string-literals.
Jan 27 2020, 3:58 AM · Restricted Project, Restricted Project
krasimir added a comment to D73354: clang-format: insert trailing commas into containers..

An alternative approach (I'm not endorsing this) that would *in theory* circumvent non-idempotency issue (but would be more fiddly~fiddly to implement and spill across different layers of the formatter):
This is just a rough idea and can have multiple issues in itself. In general the trick is that if we can teach the token penalty computer and the format outputter about this, we should be able to use it together with other formatting decisions.

  • add a new synthetic (annotated) token type, something like TT_PossiblyMissingTrailingComma, that would capture the length-0 text range where this could be inserted;
  • use the algorithm here to splay it into the annotated token stream;
  • mark it so that no newline can be inserted before such a token
  • modify the penalty calculation algorithm to penalize for inserting a newline after this token: if we're inserting a newline after this token and if this token was inserted at a position at or past the maximal number of columns, add a PenaltyExcessCharacter for it.
  • during outputting, if this token is followed by a newline, output it as ,; otherwise output it as an empty string or do not output it.
Jan 27 2020, 3:58 AM · Restricted Project, Restricted Project

Jan 24 2020

krasimir accepted D73353: [clang-format] Handle escaped " in C# string-literals.

Thank you!
Should I commit this for you?

Jan 24 2020, 8:13 AM · Restricted Project, Restricted Project
krasimir accepted D73335: clang-format: [JS] options for arrow functions..
Jan 24 2020, 8:06 AM · Restricted Project, Restricted Project
krasimir added a comment to D73354: clang-format: insert trailing commas into containers..

General comment:

Jan 24 2020, 7:55 AM · Restricted Project, Restricted Project
krasimir added a reviewer for D73354: clang-format: insert trailing commas into containers.: sammccall.
Jan 24 2020, 7:46 AM · Restricted Project, Restricted Project
krasimir requested changes to D73335: clang-format: [JS] options for arrow functions..
Jan 24 2020, 7:44 AM · Restricted Project, Restricted Project
krasimir added inline comments to D73353: [clang-format] Handle escaped " in C# string-literals.
Jan 24 2020, 7:27 AM · Restricted Project, Restricted Project
krasimir added inline comments to D73353: [clang-format] Handle escaped " in C# string-literals.
Jan 24 2020, 7:26 AM · Restricted Project, Restricted Project
krasimir added a comment to D73335: clang-format: [JS] options for arrow functions..

FYI I've started a conversation on whether SLS_All should be the default Google style. But the option I think is useful in either case.

Jan 24 2020, 5:37 AM · Restricted Project, Restricted Project

Jan 23 2020

MyDeveloperDay awarded rG1e0174a93cfd: Treat C# `using` as a control statement a Like token.
Jan 23 2020, 4:59 AM
krasimir committed rG1e0174a93cfd: Treat C# `using` as a control statement (authored by krasimir).
Treat C# `using` as a control statement
Jan 23 2020, 4:23 AM
krasimir closed D72144: Treat C# `using` as a control statement.
Jan 23 2020, 4:23 AM · Restricted Project, Restricted Project
krasimir accepted D72144: Treat C# `using` as a control statement.

I'll submit this for you.

Jan 23 2020, 3:26 AM · Restricted Project, Restricted Project
krasimir requested changes to D72144: Treat C# `using` as a control statement.

I looked up the C# reference and all the examples are top-level, so having top-level test cases here would be useful, as people would expect copy-pasting an example snippet to just work.
Sorry about asking you to go back-and-forth.

Jan 23 2020, 3:20 AM · Restricted Project, Restricted Project

Jan 22 2020

krasimir accepted D72144: Treat C# `using` as a control statement.
Jan 22 2020, 8:31 AM · Restricted Project, Restricted Project

Jan 20 2020

krasimir accepted D73026: clang-format: [JS] fix `??` opreator wrapping..
Jan 20 2020, 7:53 AM · Restricted Project, Restricted Project

Jan 17 2020

krasimir accepted D72907: clang-format: [JS] pragmas for tslint, tsc..
Jan 17 2020, 4:37 AM · Restricted Project
krasimir committed rG33463cfba2be: clang-format: fix spacing in `operator const char*()` (authored by krasimir).
clang-format: fix spacing in `operator const char*()`
Jan 17 2020, 4:35 AM
krasimir closed D72911: clang-format: fix spacing in `operator const char*()`.
Jan 17 2020, 4:35 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Fix typo
Jan 17 2020, 4:26 AM · Restricted Project
krasimir added inline comments to D72911: clang-format: fix spacing in `operator const char*()`.
Jan 17 2020, 4:25 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Fix typo
Jan 17 2020, 4:25 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Address review comments
Jan 17 2020, 4:25 AM · Restricted Project
krasimir updated the diff for D72911: clang-format: fix spacing in `operator const char*()`.
  • Add more tests
Jan 17 2020, 3:57 AM · Restricted Project
krasimir added a reviewer for D72911: clang-format: fix spacing in `operator const char*()`: mprobst.
Jan 17 2020, 3:51 AM · Restricted Project
krasimir created D72911: clang-format: fix spacing in `operator const char*()`.
Jan 17 2020, 3:51 AM · Restricted Project

Jan 16 2020

krasimir accepted D72827: clang-format: [JS] Handle keyword-named methods..

How about if and try? Is there a list somewhere for all such valid identifiers?

Jan 16 2020, 6:19 AM · Restricted Project, Restricted Project

Jan 14 2020

krasimir added a comment to D67843: [clang-format] DisableFormat also now disables SortIncludes.

I also am worried that this makes it impossible to just sort includes.

Jan 14 2020, 2:52 AM · Restricted Project, Restricted Project, Restricted Project

Jan 13 2020

krasimir accepted D70377: clang-format: [JS] tests for async wrapping..
Jan 13 2020, 12:06 AM · Restricted Project
krasimir added inline comments to D72401: Fixes for spaces around C# object initializers.
Jan 13 2020, 12:06 AM · Restricted Project, Restricted Project

Jan 11 2020

krasimir added inline comments to D72401: Fixes for spaces around C# object initializers.
Jan 11 2020, 2:42 AM · Restricted Project, Restricted Project
krasimir requested changes to D72401: Fixes for spaces around C# object initializers.
Jan 11 2020, 2:41 AM · Restricted Project, Restricted Project
krasimir accepted D72150: Allow space after C-style cast in C# code.
Jan 11 2020, 2:32 AM · Restricted Project, Restricted Project
krasimir requested changes to D72144: Treat C# `using` as a control statement.
Jan 11 2020, 2:25 AM · Restricted Project, Restricted Project

Jan 8 2020

krasimir added a comment to D72396: [InstCombine] fold zext of masked bit set/clear.

The original code seems ubsan-clean.

Jan 8 2020, 8:37 AM · Restricted Project
krasimir added a comment to D72396: [InstCombine] fold zext of masked bit set/clear.

Internally, I can see that either (1) this causes the following code to miscompile, or (2) the code is UB:
https://github.com/grpc/grpc/blob/master/src/core/ext/transport/chttp2/transport/frame_settings.cc#L48
Note that in that code the two checks on lines 57 and 64 are related if that helps.

Jan 8 2020, 7:12 AM · Restricted Project

Oct 18 2019

krasimir added inline comments to D69164: [clang-format] fix regression recognizing casts in Obj-C calls.
Oct 18 2019, 11:34 AM · Restricted Project
krasimir committed rGeff2a2ab2b51: [clang-format] fix regression recognizing casts in Obj-C calls (authored by krasimir).
[clang-format] fix regression recognizing casts in Obj-C calls
Oct 18 2019, 8:20 AM
krasimir closed D69164: [clang-format] fix regression recognizing casts in Obj-C calls.
Oct 18 2019, 8:20 AM · Restricted Project
krasimir committed rL375247: [clang-format] fix regression recognizing casts in Obj-C calls.
[clang-format] fix regression recognizing casts in Obj-C calls
Oct 18 2019, 8:20 AM
krasimir added a reviewer for D69164: [clang-format] fix regression recognizing casts in Obj-C calls: MyDeveloperDay.
Oct 18 2019, 5:56 AM · Restricted Project
krasimir updated the summary of D69164: [clang-format] fix regression recognizing casts in Obj-C calls.
Oct 18 2019, 5:56 AM · Restricted Project
krasimir created D69164: [clang-format] fix regression recognizing casts in Obj-C calls.
Oct 18 2019, 5:56 AM · Restricted Project

Oct 9 2019

krasimir committed rGae1b7859cbd6: [clang-format] Update noexcept reference qualifiers detection (authored by krasimir).
[clang-format] Update noexcept reference qualifiers detection
Oct 9 2019, 7:49 AM
krasimir committed rL374172: [clang-format] Update noexcept reference qualifiers detection.
[clang-format] Update noexcept reference qualifiers detection
Oct 9 2019, 7:49 AM
krasimir closed D68695: [clang-format] Update noexcept reference qualifiers detection.
Oct 9 2019, 7:49 AM · Restricted Project, Restricted Project
krasimir added inline comments to D68695: [clang-format] Update noexcept reference qualifiers detection.
Oct 9 2019, 6:03 AM · Restricted Project, Restricted Project
krasimir added inline comments to D68695: [clang-format] Update noexcept reference qualifiers detection.
Oct 9 2019, 5:22 AM · Restricted Project, Restricted Project
krasimir added reviewers for D68695: [clang-format] Update noexcept reference qualifiers detection: AndWass, MyDeveloperDay.
Oct 9 2019, 5:16 AM · Restricted Project, Restricted Project
krasimir created D68695: [clang-format] Update noexcept reference qualifiers detection.
Oct 9 2019, 5:16 AM · Restricted Project, Restricted Project

Oct 1 2019

krasimir accepted D68227: [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed.

Thank you!

Oct 1 2019, 11:58 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
krasimir added inline comments to D68227: [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed.
Oct 1 2019, 2:05 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project

Sep 30 2019

krasimir added inline comments to D68227: [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed.
Sep 30 2019, 1:09 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project

Sep 18 2019

krasimir committed rG2f1bba7fd077: Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize" (authored by krasimir).
Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize"
Sep 18 2019, 7:49 AM
krasimir committed rL372228: Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize".
Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize"
Sep 18 2019, 7:40 AM
krasimir closed D67710: Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize".
Sep 18 2019, 7:40 AM · Restricted Project
krasimir added a reviewer for D67710: Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize": bkramer.
Sep 18 2019, 7:40 AM · Restricted Project
krasimir retitled D67710: Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize" from Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize" This reverts commit r372204. This change appears to cause build bot failures under msan: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/35236/steps/check... to Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize".
Sep 18 2019, 7:40 AM · Restricted Project
krasimir created D67710: Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize".
Sep 18 2019, 7:40 AM · Restricted Project
krasimir added a comment to rL372204: [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize.

This change appears to cause build bot failures under msan:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/35236/steps/check-llvm%20msan/logs/stdio

FAIL: LLVM :: DebugInfo/AArch64/asan-stack-vars.mir (19531 of 33579)
******************** TEST 'LLVM :: DebugInfo/AArch64/asan-stack-vars.mir' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llc -O0 -start-before=livedebugvalues -filetype=obj -o - /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/DebugInfo/AArch64/asan-stack-vars.mir | /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llvm-dwarfdump -v - | /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/DebugInfo/AArch64/asan-stack-vars.mir
--
Exit Code: 2
Sep 18 2019, 7:31 AM
krasimir committed rG98c0dc39de24: [lldb] Fix a test assertion after r372192 (authored by krasimir).
[lldb] Fix a test assertion after r372192
Sep 18 2019, 5:41 AM