djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D19204
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper added inline comments.
Comment at: cfe/trunk/lib/Format/AffectedRangeManager.h:59
@@ +58,3 @@
+ const AnnotatedLine *PreviousLine);
+ SourceManager &SourceMgr;
+ const SmallVector Ranges;
And an empty line between functions and da
djasper added a comment.
Thinking some more, I think this is actually very close to what we do for
#include(-like) statements. That is done in TokenAnnotator::parseLine() and
TokenAnnotator::parseIncludeDirective(). Could you move the logic there?
http://reviews.llvm.org/D20632
djasper added a comment.
That's the same for #include directives (with <>). Just turn the tokens into
TT_ImplicitStringLiteral, same as is done for #includes. I am not saying it's
better, but I don't think we should have to different approaches..
http://reviews.llvm.org/D20632
_
Author: djasper
Date: Fri May 27 03:59:34 2016
New Revision: 270975
URL: http://llvm.org/viewvc/llvm-project?rev=270975&view=rev
Log:
clang-format: Allow splitting the line after /**/-comments.
While it might change the meaning of the comment in rare circumstances,
it is better than violating the
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D20737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper accepted this revision.
djasper added a comment.
Looks good.
http://reviews.llvm.org/D20632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1411
@@ +1410,3 @@
+int getIncludePriority(const FormatStyle &Style,
+ SmallVector &CategoryRegexs,
+ StringRef IncludeName) {
But you should pass it as an
Author: djasper
Date: Sun May 29 17:07:22 2016
New Revision: 271191
URL: http://llvm.org/viewvc/llvm-project?rev=271191&view=rev
Log:
clang-format: Fix segfault introduced by allowing wraps after comments.
Modified:
cfe/trunk/lib/Format/ContinuationIndenter.cpp
cfe/trunk/unittests/Format/
djasper added inline comments.
Comment at: include/clang/Format/Format.h:778
@@ -776,1 +777,3 @@
+/// replacement corresponding to the header insertion has offset UINT_MAX (i.e.
+/// -1U).
tooling::Replacements
Why don't we just stick with UINT_MAX everywhere?
=
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1284
@@ +1283,3 @@
+ // if \p CheckMainHeader is true and \p IncludeName is a main header, returns
+ // 0. Otherwise, returns INT_MAX if \p IncludeName does not match any
category
+ // pattern.
N
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1549
@@ -1408,3 +1548,3 @@
// We need to use lambda function here since there are two versions of
// `cleanup`.
auto Cleanup = [](const FormatStyle &Style, StringRef Code,
So, add a copy con
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1444
@@ +1443,3 @@
+ if (!llvm::Regex(IncludeRegexPattern).match(Replace.getReplacementText())) {
+llvm::errs() << "Insertions other than header #include insertion are "
+"not supported! "
--
djasper added inline comments.
Comment at: unittests/Format/CleanupTest.cpp:310
@@ +309,3 @@
+ Context.createInMemoryFile("fix.cpp", Code);
+ tooling::Replacements Replaces = {
+ tooling::Replacement("fix.cpp", UINT_MAX, 0, "#include \"b.h\"")};
Well, the o
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
A few nitpicks, but otherwise looks good.
Comment at: lib/Format/Format.cpp:1287
@@ +1286,3 @@
+int Ret = INT_MAX;
+for (unsigned I = 0, E = CategoryRegexs.size(); I
djasper added a comment.
In general, this is lacking test cases for imports that are wrapped over
multiple lines to start with. Should probably add those both for the old and
for the new behavior.
Comment at: lib/Format/Format.cpp:1229
@@ -1227,9 +1228,3 @@
// the entire bl
djasper accepted this revision.
This revision is now accepted and ready to land.
Comment at: include-fixer/SymbolIndexManager.cpp:25
@@ +24,3 @@
+ // First collect occurrences per header file.
+ std::map HeaderPopularity;
+ for (const SymbolInfo &Symbol : Symbols) {
---
djasper accepted this revision.
This revision is now accepted and ready to land.
Comment at: lib/Format/SortJavaScriptImports.cpp:248
@@ +247,3 @@
+// ... then the references in order ...
+for (JsImportedSymbol *I = Symbols.begin(), *E = Symbols.end(); I != E;) {
+ Bu
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D20817
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1472
@@ -1471,2 +1471,3 @@
llvm::Regex IncludeRegex(IncludeRegexPattern);
- llvm::Regex DefineRegex(R"(^[\t\ ]*#[\t\ ]*define[\t\ ]*[^\\]*$)");
+ llvm::Regex IfNDefRegex(R"(^[\t\ ]*#[\t\ ]*ifndef[\t\ ]*([^\\]*)$
djasper added a comment.
Could we very easily use the FormatTokenLexer for this? I.e. find the first
non-comment token an start from there?
http://reviews.llvm.org/D20898
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1484
@@ +1483,3 @@
+ Environment::CreateVirtualEnvironment(Code, FileName, /*Ranges=*/{});
+ FormatTokenLexer Lexer(Env->getSourceManager(), Env->getFileID(), Style,
+ encoding::detectEn
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D20898
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1441
@@ +1440,3 @@
+void skipComments(Lexer &Lex, Token &Tok) {
+ while (!Lex.LexFromRawLexer(Tok))
+if (Tok.isNot(tok::comment))
I'd modify this to:
while (Tok.is(comment))
if (Lex.LexFr
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1491
@@ -1471,3 +1490,3 @@
std::unique_ptr Env =
Environment::CreateVirtualEnvironment(Code, FileName, /*Ranges=*/{});
I think you should pull this part out into a separate function, poss
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1466
@@ +1465,3 @@
+getFormattingLangOpts(Style));
+ unsigned Ret = Code.size();
+ Token Tok;
Don't store this. Just inline Code.size() below.
Comment at: lib/Format/F
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Nice :-)
http://reviews.llvm.org/D20959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/
Author: djasper
Date: Wed Jun 8 03:23:46 2016
New Revision: 272124
URL: http://llvm.org/viewvc/llvm-project?rev=272124&view=rev
Log:
clang-format: Fix bug in function ref qualifier identification.
.. and simplify it.
Before:
void A::f()&& {}
void f() && {}
After:
void A::f() && {}
void
Author: djasper
Date: Wed Jun 8 04:45:08 2016
New Revision: 272125
URL: http://llvm.org/viewvc/llvm-project?rev=272125&view=rev
Log:
clang-format: Fix incorrect calculation of "length" of /**/ comments.
This could lead to column limit violations.
Modified:
cfe/trunk/lib/Format/ContinuationI
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
The change looks good, but can you add a before/after example to change
description?
http://reviews.llvm.org/D21206
___
cfe-commits mailing li
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2127
@@ +2126,3 @@
+// Postfix non-null assertion operator, as in `foo!.bar()`.
+if (Right.is(tok::exclaim) && Right.Next &&
+Right.Next->isNot(tok::identifier) && !Right.Next->Tok.isLiteral()
djasper accepted this revision.
This revision is now accepted and ready to land.
Comment at: lib/Format/TokenAnnotator.cpp:2128
@@ +2127,3 @@
+if (Right.is(tok::exclaim) &&
+(Left.isOneOf(tok::identifier, tok::r_paren, tok::r_square) ||
+ Left.Tok.isLiteral()))
djasper added inline comments.
Comment at: include/clang/Format/Format.h:631
@@ +630,3 @@
+ /// \brief Whether to wrap JavaScript import/export statements.
+ bool WrapJavaScriptImports;
+
Wondering whether we should call this JavaScriptWrapImports so that the
J
Author: djasper
Date: Mon Jun 13 02:49:35 2016
New Revision: 272538
URL: http://llvm.org/viewvc/llvm-project?rev=272538&view=rev
Log:
clang-format: Fix incorrect function type detection.
Before:
returnsFunction (¶m1, ¶m2)(param);
After:
returnsFunction(¶m1, ¶m2)(param);
Modified:
cfe/tr
Author: djasper
Date: Mon Jun 13 02:48:45 2016
New Revision: 272535
URL: http://llvm.org/viewvc/llvm-project?rev=272535&view=rev
Log:
clang-format: Don't indent lambda body relative to its return type.
Before:
[]() //
-> int {
return 1; //
};
After:
[]() //
-> in
Author: djasper
Date: Mon Jun 13 02:49:09 2016
New Revision: 272536
URL: http://llvm.org/viewvc/llvm-project?rev=272536&view=rev
Log:
clang-format: Fix incorrect cast detection.
Before:
auto s = sizeof...(Ts)-1;
After:
auto s = sizeof...(Ts) - 1;
Modified:
cfe/trunk/lib/Format/TokenAnno
Author: djasper
Date: Mon Jun 13 02:49:28 2016
New Revision: 272537
URL: http://llvm.org/viewvc/llvm-project?rev=272537&view=rev
Log:
clang-format: Don't merge const and &, e.g. in function ref qualifiers.
Before (when aligning & to the right):
SomeType MemberFunction(const Deleted &) const&;
djasper added a comment.
Could you upload a diff with full (i.e. the entire file as) context?
Repository:
rL LLVM
http://reviews.llvm.org/D21279
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinf
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:789
@@ -788,3 +788,3 @@
if (Style.Language == FormatStyle::LK_JavaScript &&
-CurrentToken->is(Keywords.kw_import))
+CurrentToken->is(Keywords.kw_import) && !Style.JavaScriptWrapImports)
Author: djasper
Date: Mon Jun 13 09:45:12 2016
New Revision: 272548
URL: http://llvm.org/viewvc/llvm-project?rev=272548&view=rev
Log:
clang-format: Restrict r272537 to function ref qualifiers.
Seems this isn't generally desirable.
Before:
int const * a;
After:
int const* a;
Modified:
c
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D21275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D21273
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
Author: djasper
Date: Tue Jun 14 06:28:02 2016
New Revision: 272654
URL: http://llvm.org/viewvc/llvm-project?rev=272654&view=rev
Log:
clang-format: [JS] Support annotated classes.
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
cfe/trunk/unittests/Format/FormatTestJS.cpp
Modified: cfe/
djasper added a comment.
I am happy to get this in for now, but I actually think the right solution
might be to let clang-format de-duplicate #includes in general. What do you
think?
http://reviews.llvm.org/D21323
___
cfe-commits mailing list
cfe-
djasper added a comment.
Well, it is easy to not see duplicated #includes when they aren't properly
sorted. When clang-format then goes in and sorts them, they end up next to each
other. And I think no user really wants that.
http://reviews.llvm.org/D21323
__
djasper added a comment.
Lets get this in for now. We can always remove it if we think it is no longer
useful.
Comment at: unittests/Format/CleanupTest.cpp:692
@@ +691,3 @@
+TEST_F(CleanUpReplacementsTest, SkipExistingHeaders) {
+ std::string Code = "#include \"a.h\"\n#include
djasper added inline comments.
Comment at: unittests/Format/CleanupTest.cpp:693
@@ +692,3 @@
+ std::string Code = "#include \"a.h\"\n#include \n";
+ std::string Expected = "#include \"a.h\"\n#include \n";
+ tooling::Replacements Replaces = {createInsertion("#include "),
---
Author: djasper
Date: Tue Jun 14 08:54:38 2016
New Revision: 272668
URL: http://llvm.org/viewvc/llvm-project?rev=272668&view=rev
Log:
clang-format: [JS] Fix failing format with TypeScript casts.
Before, this could be formatted at all (with BracketAlignmentStyle
AlwaysBreak):
foo = [
1, /*
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good :-)
http://reviews.llvm.org/D21323
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/lis
Author: djasper
Date: Mon Jun 20 13:20:38 2016
New Revision: 273179
URL: http://llvm.org/viewvc/llvm-project?rev=273179&view=rev
Log:
clang-format: [Proto] Don't do bad things if imports are missing ;.
Modified:
cfe/trunk/lib/Format/UnwrappedLineParser.cpp
cfe/trunk/unittests/Format/Forma
Author: djasper
Date: Mon Jun 20 15:39:53 2016
New Revision: 273196
URL: http://llvm.org/viewvc/llvm-project?rev=273196&view=rev
Log:
clang-format: [Proto] Fix "import public" after r273179.
Modified:
cfe/trunk/lib/Format/UnwrappedLineParser.cpp
cfe/trunk/unittests/Format/FormatTestProto.
djasper added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:68
@@ +67,3 @@
+/// \brief Less-than operator between two Ranges.
+bool operator<(const Range &LHS, const Range &RHS);
+
Can we keep these private for now?
Commen
djasper added a comment.
Nice :)
Comment at: include/clang/Tooling/Core/Replacement.h:62
@@ +61,3 @@
+ /// \brief Whether this range is less-than \p RHS or not.
+ bool operator<(const Range &RHS) const {
+if (Offset != RHS.getOffset())
Can we just add a la
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
A couple of small comments, otherwise looks good.
Comment at: lib/Tooling/Core/Replacement.cpp:284
@@ +283,3 @@
+ std::sort(Ranges.begin(), Ranges.end(),
+[](co
Author: djasper
Date: Tue Jun 21 12:00:20 2016
New Revision: 273285
URL: http://llvm.org/viewvc/llvm-project?rev=273285&view=rev
Log:
clang-format: [JS] Add a Closure Compiler JSDoc tags to the default
Google configuration so that it isn't line-wrapped.
Modified:
cfe/trunk/lib/Format/Format.c
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:480
@@ -471,1 +479,3 @@
+ void parseJSTypeDefinition() {
+// `type Name = Type Expression;`
Why is this necessary?
http://reviews.llvm.org/D21597
_
Author: djasper
Date: Thu Jun 23 04:40:19 2016
New Revision: 273553
URL: http://llvm.org/viewvc/llvm-project?rev=273553&view=rev
Log:
clang-format: [Proto] Use more compact format for text-formatted options
Before:
enum Type {
UNKNOWN = 0 [(some_options) = {
a: aa,
b: bb
}];
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Basically looks good.
Comment at: lib/Format/TokenAnnotator.cpp:155
@@ +154,3 @@
+} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous
&&
+
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1001
@@ -1000,3 +1000,3 @@
if (Style.Language == FormatStyle::LK_JavaScript &&
- Line.MustBeDeclaration) {
+ !Contexts.back().IsExpression) {
// In JavaScript, `interface X {
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good except that the patch description can now be updated.
http://reviews.llvm.org/D21658
___
cfe-commits mailing list
cfe-commits@lists.
The patch description seems wrong as this doesn't fix a build breakage
AFAICT. Do you mean a test failure? If so, it would be helpful to #include
what's actually changing (before/after or calling out the failing test case
or something).
On Fri, Jun 24, 2016 at 7:45 PM, Martin Probst via cfe-commi
djasper added a comment.
Sorry.. Really busy at the moment, but will try to get this reviewed and
submitted this week. If not, please ping again!
Repository:
rL LLVM
http://reviews.llvm.org/D21279
___
cfe-commits mailing list
cfe-commits@lists.l
djasper added a comment.
Sorry, I completely forgot about this. Will try to review today. Is this part
about the patch description accurate?
"This version only fixes the first discovered unidentified symbol.
In the long run, include-fixer should fix all unidentified symbols
with a same name at o
djasper added inline comments.
Comment at: include-fixer/IncludeFixer.cpp:234
@@ +233,3 @@
+ std::string MinimizedFilePath = minimizeInclude(
+ ((FilePath[0] == '"' || FilePath[0] == '<') ? FilePath
+ : "\"" + File
djasper added inline comments.
Comment at: include-fixer/IncludeFixer.cpp:224
@@ +223,3 @@
+ std::string MinimizedFilePath = minimizeInclude(
+ ((FilePath[0] == '"' || FilePath[0] == '<') ? FilePath
+ : "\"" + File
djasper added inline comments.
Comment at: include-fixer/IncludeFixer.cpp:166
@@ -159,1 +165,3 @@
QueryString = ExtendNestedNameSpecifier(Range);
+ SymbolRange =
tooling::Range(SM.getDecomposedLoc(Range.getBegin()).second,
+ QueryStri
djasper accepted this revision.
djasper added a comment.
Looks good.
http://reviews.llvm.org/D21603
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks Good.
http://reviews.llvm.org/D22147
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D22146
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
So, turns out top-level conditionals are actually used somewhat frequently.
Can I undo this change? It doesn't break any other tests. Do you have other
tests that I should run against?
On Fri, Jun 24, 2016 at 11:48 PM, Martin Probst wrote:
> Yes, test breakage. The problem was that with the chan
Author: djasper
Date: Tue Jul 12 10:45:53 2016
New Revision: 275183
URL: http://llvm.org/viewvc/llvm-project?rev=275183&view=rev
Log:
clang-format: [JS] Allow top-level conditionals again.
I am not sure exactly which test breakage Martin was trying to fix in
r273694. For now, fix the behavior for
djasper added a comment.
FWIW, I think I'd like this behavior as it shows me what is actually being
done. I can undo/redo to double-check or C-O to get back to where I was. Of
course making it configurable seems like the right thing to do.
Comment at: include-fixer/tool/clang-
djasper added inline comments.
Comment at: lib/Format/FormatTokenLexer.cpp:231
@@ -230,3 +230,3 @@
void FormatTokenLexer::tryParseTemplateString() {
FormatToken *BacktickToken = Tokens.back();
I think, this could now use an elaborate comment on what it is ac
Author: djasper
Date: Mon Feb 29 06:26:20 2016
New Revision: 262216
URL: http://llvm.org/viewvc/llvm-project?rev=262216&view=rev
Log:
clang-format: Don't format unrelated nested blocks.
With this change:
SomeFunction(
[] {
int i;
return i; // Format this line.
},
Author: djasper
Date: Mon Feb 29 22:19:47 2016
New Revision: 262291
URL: http://llvm.org/viewvc/llvm-project?rev=262291&view=rev
Log:
clang-format: [JS] Support quoted object literal keys.
Before:
var x = {
a: a,
b: b, 'c': c,
};
After:
var x = {
a: a,
b: b,
'c': c,
}
Author: djasper
Date: Mon Feb 29 22:19:55 2016
New Revision: 262292
URL: http://llvm.org/viewvc/llvm-project?rev=262292&view=rev
Log:
clang-format: Increase the penalty for breaking between array subscripts.
Before:
aa[aaa]
Author: djasper
Date: Mon Feb 29 22:19:59 2016
New Revision: 262293
URL: http://llvm.org/viewvc/llvm-project?rev=262293&view=rev
Log:
clang-format: Correctly apply wrap before multi-line RHS rule to
ternary expressions.
Before:
return a ? a :
Author: djasper
Date: Tue Mar 1 15:41:58 2016
New Revision: 262402
URL: http://llvm.org/viewvc/llvm-project?rev=262402&view=rev
Log:
[clang-format] Detect constructor initializers preceded by `noexcept`.
Patch by Erik Kessler, thank you.
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
djasper closed this revision.
djasper added a comment.
Submitted as r262402. Thank you.
http://reviews.llvm.org/D17621
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper added inline comments.
Comment at: include/clang/Format/Format.h:606
@@ +605,3 @@
+ /// \brief The QuoteStyle to use for JavaScript strings.
+ QuoteStyle Quotes;
+
As this only affects JavaScript and doesn't make any sense for Java or C++, I'd
like to h
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Sorry for the delayed reply. I think this looks good.
http://reviews.llvm.org/D15643
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ht
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1131
@@ +1130,3 @@
+// and adjust ColumnWidth to take the added escapes into account.
+FormatTok->ColumnWidth = ColumnWidth;
+
Maybe add a FIXME saying that we also need to modify the TokenTe
On Mon, Feb 29, 2016 at 8:49 AM, Manuel Klimek via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> On Mon, Feb 29, 2016 at 5:39 PM Chandler Carruth
> wrote:
>
>> On Mon, Feb 29, 2016 at 11:32 AM Manuel Klimek via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: klimek
>>> Dat
On Tue, Mar 1, 2016 at 9:12 PM, Daniel Jasper wrote:
>
>
> On Mon, Feb 29, 2016 at 8:49 AM, Manuel Klimek via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> On Mon, Feb 29, 2016 at 5:39 PM Chandler Carruth
>> wrote:
>>
>>> On Mon, Feb 29, 2016 at 11:32 AM Manuel Klimek via cfe-commits <
On Tue, Mar 1, 2016 at 9:30 PM, Manuel Klimek wrote:
>
>
> On Wed, Mar 2, 2016 at 6:20 AM Daniel Jasper wrote:
>
>> On Tue, Mar 1, 2016 at 9:12 PM, Daniel Jasper wrote:
>>
>>>
>>>
>>> On Mon, Feb 29, 2016 at 8:49 AM, Manuel Klimek via cfe-commits <
>>> cfe-commits@lists.llvm.org> wrote:
>>>
>>>
djasper added a comment.
I don't think this is the right abstraction:
- Formatting so far is fundamentally per file. Grouping replacements per file
is something that can be done outside of libFormat.
- The logic to sort and deduplicate Replacements is important independent of
whether formatting
Author: djasper
Date: Wed Mar 2 08:26:59 2016
New Revision: 262487
URL: http://llvm.org/viewvc/llvm-project?rev=262487&view=rev
Log:
test/Driver/cl-pch-errorhandling.cpp: Copy input file to a temporary
location as we cannot assume the location of the input file to be
writable.
Modified:
cfe/
Feel free to change. I have no idea what I am doing here.
On Wed, Mar 2, 2016 at 12:55 PM, Nico Weber wrote:
> (A different fix would've been to just add /Fp%.pch to set the output path
> to be not next to the inputs.)
>
> On Wed, Mar 2, 2016 at 6:27 AM, Daniel Jasper via cf
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: lib/Format/Format.cpp:1140
@@ +1139,3 @@
+
+ void insertReplacement(SourceLocation Start, unsigned Length,
+ StringRef Repla
Author: djasper
Date: Wed Mar 2 16:44:03 2016
New Revision: 262534
URL: http://llvm.org/viewvc/llvm-project?rev=262534&view=rev
Log:
clang-format: [JS] Optionally re-quote string literals.
Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow
djasper closed this revision.
djasper added a comment.
Submitted as r262534.
http://reviews.llvm.org/D17385
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: djasper
Date: Thu Mar 3 11:34:14 2016
New Revision: 262630
URL: http://llvm.org/viewvc/llvm-project?rev=262630&view=rev
Log:
clang-format: Use stable_sort when sorting #includes.
Otherwise, clang-format can output useless replacements in the presence
of identical #includes
Modified:
djasper added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:237
@@ +236,3 @@
+/// related to the same file entry are put into the same vector.
+FileToReplacementsMap groupReplacementsByFile(const Replacements &Replaces,
+
djasper added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:228
@@ -226,3 +227,3 @@
/// \pre Replacements must be for the same file.
-std::vector
-calculateChangedRangesInFile(const tooling::Replacements &Replaces);
+std::vector calculateChangedRangesInFil
Author: djasper
Date: Sat Mar 5 12:34:26 2016
New Revision: 262776
URL: http://llvm.org/viewvc/llvm-project?rev=262776&view=rev
Log:
clang-format: [JS] Support destructuring assignments in for loops.
Before:
for (let { a, b } of x) {
}
After:
for (let {a, b} of x) {
}
Modified:
cfe
djasper added inline comments.
Comment at: lib/Format/UnwrappedLineParser.cpp:665
@@ +664,3 @@
+// well known cases. It *must not* return true in speculative cases.
+bool UnwrappedLineParser::shouldInsertSemiBetween(FormatToken *Previous,
+
djasper added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:230
@@ +229,3 @@
+
+typedef std::map
+FileToReplacementsMap;
ioeric wrote:
> djasper wrote:
> > I think the key type in a map is always const, so no need for "const".
> I think
djasper added a comment.
Want me to run clang-format on the file/diff?
http://reviews.llvm.org/D18015
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper closed this revision.
djasper added a comment.
Formatted and submitted as r263302.
http://reviews.llvm.org/D18015
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper added a comment.
Looks good.
Comment at: lib/Format/UnwrappedLineParser.cpp:667
@@ +666,3 @@
+return true;
+ // FIXME(martinprobst): This returns true for C/C++ keywords like 'struct'.
+ return FormatTok->is(tok::identifier) &&
We don't usually put
501 - 600 of 731 matches
Mail list logo