[PATCH] D91996: [clang-format] Remove double trim

2020-12-13 Thread Björn Schäpers via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG36306403d492: [clang-format] Remove double trim (authored by 
HazardyKnusperkeks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91996/new/

https://reviews.llvm.org/D91996

Files:
  clang/lib/Format/BreakableToken.cpp


Index: clang/lib/Format/BreakableToken.cpp
===
--- clang/lib/Format/BreakableToken.cpp
+++ clang/lib/Format/BreakableToken.cpp
@@ -773,10 +773,7 @@
 OriginalPrefix.resize(Lines.size());
 for (size_t i = FirstLineIndex, e = Lines.size(); i < e; ++i) {
   Lines[i] = Lines[i].ltrim(Blanks);
-  // We need to trim the blanks in case this is not the first line in a
-  // multiline comment. Then the indent is included in Lines[i].
-  StringRef IndentPrefix =
-  getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
+  StringRef IndentPrefix = getLineCommentIndentPrefix(Lines[i], Style);
   assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
  "unsupported line comment prefix, '//' and '#' are supported");
   OriginalPrefix[i] = Prefix[i] = IndentPrefix;


Index: clang/lib/Format/BreakableToken.cpp
===
--- clang/lib/Format/BreakableToken.cpp
+++ clang/lib/Format/BreakableToken.cpp
@@ -773,10 +773,7 @@
 OriginalPrefix.resize(Lines.size());
 for (size_t i = FirstLineIndex, e = Lines.size(); i < e; ++i) {
   Lines[i] = Lines[i].ltrim(Blanks);
-  // We need to trim the blanks in case this is not the first line in a
-  // multiline comment. Then the indent is included in Lines[i].
-  StringRef IndentPrefix =
-  getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
+  StringRef IndentPrefix = getLineCommentIndentPrefix(Lines[i], Style);
   assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
  "unsupported line comment prefix, '//' and '#' are supported");
   OriginalPrefix[i] = Prefix[i] = IndentPrefix;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91996: [clang-format] Remove double trim

2020-11-28 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision.
MyDeveloperDay added a comment.

In D91996#2417892 , @klimek wrote:

> Isn't the comment incorrect after this patch?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91996/new/

https://reviews.llvm.org/D91996

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91996: [clang-format] Remove double trim

2020-11-27 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 308134.
HazardyKnusperkeks added a comment.

Formatted and now superfluous comment removed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91996/new/

https://reviews.llvm.org/D91996

Files:
  clang/lib/Format/BreakableToken.cpp


Index: clang/lib/Format/BreakableToken.cpp
===
--- clang/lib/Format/BreakableToken.cpp
+++ clang/lib/Format/BreakableToken.cpp
@@ -773,10 +773,7 @@
 OriginalPrefix.resize(Lines.size());
 for (size_t i = FirstLineIndex, e = Lines.size(); i < e; ++i) {
   Lines[i] = Lines[i].ltrim(Blanks);
-  // We need to trim the blanks in case this is not the first line in a
-  // multiline comment. Then the indent is included in Lines[i].
-  StringRef IndentPrefix =
-  getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
+  StringRef IndentPrefix = getLineCommentIndentPrefix(Lines[i], Style);
   assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
  "unsupported line comment prefix, '//' and '#' are supported");
   OriginalPrefix[i] = Prefix[i] = IndentPrefix;


Index: clang/lib/Format/BreakableToken.cpp
===
--- clang/lib/Format/BreakableToken.cpp
+++ clang/lib/Format/BreakableToken.cpp
@@ -773,10 +773,7 @@
 OriginalPrefix.resize(Lines.size());
 for (size_t i = FirstLineIndex, e = Lines.size(); i < e; ++i) {
   Lines[i] = Lines[i].ltrim(Blanks);
-  // We need to trim the blanks in case this is not the first line in a
-  // multiline comment. Then the indent is included in Lines[i].
-  StringRef IndentPrefix =
-  getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
+  StringRef IndentPrefix = getLineCommentIndentPrefix(Lines[i], Style);
   assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
  "unsupported line comment prefix, '//' and '#' are supported");
   OriginalPrefix[i] = Prefix[i] = IndentPrefix;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91996: [clang-format] Remove double trim

2020-11-27 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment.

In D91996#2417892 , @klimek wrote:

> Isn't the comment incorrect after this patch?

I actually thought the same after I saw the diff here, but had no time yet to 
modify it. I will now also remove the comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91996/new/

https://reviews.llvm.org/D91996

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91996: [clang-format] Remove double trim

2020-11-26 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment.

Isn't the comment incorrect after this patch?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91996/new/

https://reviews.llvm.org/D91996

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91996: [clang-format] Remove double trim

2020-11-26 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision.
MyDeveloperDay added a comment.
This revision is now accepted and ready to land.

Can you please clang format, but apart from that this looks fine


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91996/new/

https://reviews.llvm.org/D91996

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D91996: [clang-format] Remove double trim

2020-11-23 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks created this revision.
HazardyKnusperkeks added reviewers: MyDeveloperDay, krasimir, klimek.
HazardyKnusperkeks added a project: clang-format.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
HazardyKnusperkeks requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91996

Files:
  clang/lib/Format/BreakableToken.cpp


Index: clang/lib/Format/BreakableToken.cpp
===
--- clang/lib/Format/BreakableToken.cpp
+++ clang/lib/Format/BreakableToken.cpp
@@ -776,7 +776,7 @@
   // We need to trim the blanks in case this is not the first line in a
   // multiline comment. Then the indent is included in Lines[i].
   StringRef IndentPrefix =
-  getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
+  getLineCommentIndentPrefix(Lines[i], Style);
   assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
  "unsupported line comment prefix, '//' and '#' are supported");
   OriginalPrefix[i] = Prefix[i] = IndentPrefix;


Index: clang/lib/Format/BreakableToken.cpp
===
--- clang/lib/Format/BreakableToken.cpp
+++ clang/lib/Format/BreakableToken.cpp
@@ -776,7 +776,7 @@
   // We need to trim the blanks in case this is not the first line in a
   // multiline comment. Then the indent is included in Lines[i].
   StringRef IndentPrefix =
-  getLineCommentIndentPrefix(Lines[i].ltrim(Blanks), Style);
+  getLineCommentIndentPrefix(Lines[i], Style);
   assert((TokenText.startswith("//") || TokenText.startswith("#")) &&
  "unsupported line comment prefix, '//' and '#' are supported");
   OriginalPrefix[i] = Prefix[i] = IndentPrefix;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits