djasper added a comment.
Sorry :(... Review is easy enough.. Feel free to ping me more often in the
future.
Comment at: lib/Format/WhitespaceManager.cpp:95
@@ -97,2 +94,3 @@
std::sort(Changes.begin(), Changes.end(), Change::IsBeforeInFile(SourceMgr));
+ calculateScopeLevel(
djasper added a comment.
I think we should entirely drop this implementation of the check and let it
just check #includes with clang-format. clang-format's implementation isn't a
strict superset, e.g. won't sort between multiple blocks, but that's
intentional for now.
https://reviews.llvm.org
djasper added a comment.
I think we got confused. We once had tried to write an experimental separate
check to comply with Google's style guide. If you want to fiddle around with
that, contact me, I can send you pointers. But as I mentioned we moved away
from that. And I think it makes more sen
The check's implementation will be replaced by a simple call to clang tidy.
It will remain a check in clang tidy to continue to cater to both use cases.
On Aug 12, 2016 6:19 PM, "Zachary Turner" wrote:
> That's actually the reason I think it makes more sense in clang tidy. It
> can be a configur
I haven't read the patch, but if Alex is ok, so am I.. just wanted to make
sure that we don't spend much more time on this, as we are likely going to
remove most of the code..
On Aug 12, 2016 6:42 PM, "Zachary Turner" wrote:
> Ahh, I see. Just to be clear, is there an LGTM to get this path in?
On Fri, Aug 12, 2016 at 8:22 PM, Zachary Turner wrote:
> Sounds good. Just to be clear, you plan to delete the code from
> clang-tidy, then take the code from clang-format and move it to clang-tidy,
> and have clang-format call clang-tidy (or otherwise share the code somehow
> so they both use t
Author: djasper
Date: Mon Feb 1 05:20:55 2016
New Revision: 259351
URL: http://llvm.org/viewvc/llvm-project?rev=259351&view=rev
Log:
clang-format: Fix alignment of trailing multiline columns.
Modified:
cfe/trunk/lib/Format/WhitespaceManager.cpp
cfe/trunk/unittests/Format/FormatTest.cpp
Author: djasper
Date: Mon Feb 1 05:21:07 2016
New Revision: 259353
URL: http://llvm.org/viewvc/llvm-project?rev=259353&view=rev
Log:
clang-format: Fix incorrect pointer detection in lambdas in constructor
initializers.
Before:
Constructor() : member([](A *a, B * b) {}) {}
After:
Constructor
Author: djasper
Date: Mon Feb 1 05:20:47 2016
New Revision: 259350
URL: http://llvm.org/viewvc/llvm-project?rev=259350&view=rev
Log:
clang-format: [JS] Treat "in" as a proper operator.
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
cfe/trunk/unittests/Format/FormatTestJS.cpp
Modified
Author: djasper
Date: Tue Feb 2 04:28:11 2016
New Revision: 259487
URL: http://llvm.org/viewvc/llvm-project?rev=259487&view=rev
Log:
clang-format: Make AlignAfterOpenBracket also affect angle brackets.
Patch by Matthew Whitehead, thank you.
Modified:
cfe/trunk/lib/Format/ContinuationIndente
Author: djasper
Date: Tue Feb 2 23:33:44 2016
New Revision: 259628
URL: http://llvm.org/viewvc/llvm-project?rev=259628&view=rev
Log:
clang-format: [JS/TypeScript] Support "enum" as an optional property name, too.
Before:
enum?: string
[];
After:
enum?: string[];
Modified:
cfe/trunk/l
Author: djasper
Date: Wed Feb 3 05:33:18 2016
New Revision: 259640
URL: http://llvm.org/viewvc/llvm-project?rev=259640&view=rev
Log:
clang-tidy: [misc-unused-parameters] Ignore template instantiations.
No functional changes intended as we should already do the
corresponding fixes when visiting t
Author: djasper
Date: Wed Feb 3 08:29:55 2016
New Revision: 259648
URL: http://llvm.org/viewvc/llvm-project?rev=259648&view=rev
Log:
Provide match function to look over an entire TU again.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h
cfe/trunk/unittests/ASTMatchers/ASTM
Author: djasper
Date: Wed Feb 3 11:27:10 2016
New Revision: 259670
URL: http://llvm.org/viewvc/llvm-project?rev=259670&view=rev
Log:
clang-format: Fix formatting of ternary expressions with comments.
Before:
int i = aa ?
/*=*/bb
Author: djasper
Date: Fri Feb 5 08:17:16 2016
New Revision: 259884
URL: http://llvm.org/viewvc/llvm-project?rev=259884&view=rev
Log:
clang-format: Fix corner case in template detection.
Before:
f(a.operator() < A > ());
After:
f(a.operator()());
Modified:
cfe/trunk/lib/Format/Continuat
Author: djasper
Date: Sun Feb 7 15:22:16 2016
New Revision: 260057
URL: http://llvm.org/viewvc/llvm-project?rev=260057&view=rev
Log:
clang-format: [JS] Support @see annotations in JSDoc comments in Google
style.
Modified:
cfe/trunk/lib/Format/Format.cpp
Modified: cfe/trunk/lib/Format/Format
Author: djasper
Date: Sun Feb 7 16:17:13 2016
New Revision: 260060
URL: http://llvm.org/viewvc/llvm-project?rev=260060&view=rev
Log:
clang-format: [JS] Don't count shortened object literals as blocks.
Before:
f({a},
() => {
g(); //
});
After:
f({a}, () => {
g(); //
});
Author: djasper
Date: Mon Feb 8 03:52:54 2016
New Revision: 260080
URL: http://llvm.org/viewvc/llvm-project?rev=260080&view=rev
Log:
clang-format: Fix weird alignment when not aligning after brackets.
Before:
(, //
ccc(a, //
djasper added a subscriber: djasper.
djasper closed this revision.
djasper added a comment.
Submitted as r260378.
http://reviews.llvm.org/D16524
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/c
Author: djasper
Date: Wed Feb 10 06:42:58 2016
New Revision: 260378
URL: http://llvm.org/viewvc/llvm-project?rev=260378&view=rev
Log:
clang-format sort include use the source file name to determine the
"main include" that will be the 1st include (category 0).
Because the clang-format visual studi
Author: djasper
Date: Thu Feb 11 00:43:01 2016
New Revision: 260497
URL: http://llvm.org/viewvc/llvm-project?rev=260497&view=rev
Log:
clang-format: Make it more expensive to break template parameters.
In particular, make it more expensive than breaking after the return
type of a function definiti
Author: djasper
Date: Thu Feb 11 07:15:14 2016
New Revision: 260517
URL: http://llvm.org/viewvc/llvm-project?rev=260517&view=rev
Log:
clang-format: Make indentation after "<<" more consistent.
Before:
Diag(, )
<< (
Author: djasper
Date: Thu Feb 11 07:24:15 2016
New Revision: 260518
URL: http://llvm.org/viewvc/llvm-project?rev=260518&view=rev
Log:
clang-format: [JS] Support for (.. of ..) loops.
Before:
for (var i of[2, 3]) {}
After:
for (var i of [2, 3]) {}
Modified:
cfe/trunk/lib/Format/FormatTok
Author: djasper
Date: Mon Feb 22 09:06:53 2016
New Revision: 261528
URL: http://llvm.org/viewvc/llvm-project?rev=261528&view=rev
Log:
clang-format: [JS] treat forwardDeclare as an import/export statement.
Patch by Martin Probst. Thank you.
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
LG. Submitted as r261528.
http://reviews.llvm.org/D17439
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/
djasper added a comment.
I am missing a decent explanation here. In contrast to C++ #includes as well as
goog.require, etc. The import/export statements actually provide syntactic
structure and can name multiple entities. Why would it be a good idea to always
write them into a single line?
==
Author: djasper
Date: Mon Feb 22 14:24:11 2016
New Revision: 261563
URL: http://llvm.org/viewvc/llvm-project?rev=261563&view=rev
Log:
clang-format: [JS] Add @return to the supported JSDoc pragmas in Google
style.
Modified:
cfe/trunk/lib/Format/Format.cpp
Modified: cfe/trunk/lib/Format/Format
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1579
@@ +1578,3 @@
+ // The width of the extra \ escapes is taken into account in getNextToken.
+ void requoteJSStringLiterals(tooling::Replacements &Replaces,
+ FormatToken *Current)
djasper added a comment.
Thanks for looking at this.
Please also add a test in unittests/Format/FormatTest.cpp.
Comment at: lib/Format/TokenAnnotator.cpp:507
@@ -506,3 +506,3 @@
!Line.First->isOneOf(tok::kw_enum, tok::kw_case)) {
-if (Tok->Previous->is
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good. Do you have commit access?
http://reviews.llvm.org/D17621
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm
djasper added a comment.
Nice, the behavior now seems nicely isolated. Is this a purely stylistic kind
of change or do you think every JS developer working on any kind of codebase
will want it? Generally this feels like something we should carefully enable
with a dedicated style option. Where c
djasper added a comment.
Sounds like a good plan. Should also mention the corresponding style guide
reference in the commit message:
https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings
http://reviews.llvm.org/D17385
___
djasper added inline comments.
Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:22-24
@@ +21,5 @@
+
+using SymbolInfo = clang::find_all_symbols::SymbolInfo;
+using SymbolType = clang::find_all_symbols::SymbolInfo::SymbolType;
+using ContextType = clang::find_all_symbo
djasper accepted this revision.
djasper added a comment.
Looks good.
Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:39
@@ +38,3 @@
+} else {
+ const auto *RD = llvm::cast(Context);
+ Symbol->Contexts.emplace_back(SymbolInfo::Record, RD->getName().str
djasper added inline comments.
Comment at: lib/Format/AffectedRangeManager.h:68
@@ +67,2 @@
+#endif // LLVM_CLANG_LIB_FORMAT_AFFECTEDRANGEMANAGER_H
+#
??
http://reviews.llvm.org/D19587
___
cfe-commits mailing list
c
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Otherwise looks good.
http://reviews.llvm.org/D19587
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mail
djasper added inline comments.
Comment at: lib/Format/AffectedRangeManager.cpp:103
@@ -102,1 +102,3 @@
AnnotatedLine *Line, const AnnotatedLine *PreviousLine) {
+ assert(Line && "does not contain any line");
+
klimek wrote:
> Perhaps we should change this to
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D20054
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
Author: djasper
Date: Sun May 8 13:12:22 2016
New Revision: 268878
URL: http://llvm.org/viewvc/llvm-project?rev=268878&view=rev
Log:
clang-format: Support enum type template arguments.
Before:
template class A { public : E *f(); };
After:
template class A {
public:
E *f();
};
Mod
Author: djasper
Date: Sun May 8 13:14:01 2016
New Revision: 268879
URL: http://llvm.org/viewvc/llvm-project?rev=268879&view=rev
Log:
clang-format: Fix space after argument comments.
Before:
f(/*a=*/a, /*b=*/ ::b);
After:
f(/*a=*/a, /*b=*/::b);
Modified:
cfe/trunk/lib/Format/TokenAnnota
djasper added inline comments.
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:63
@@ +62,3 @@
+removeFromFoundDecls(Used->getCanonicalDecl());
+ } else if (const auto *DRE = Result.Nodes.getNodeAs("used")) {
+if (const auto *FD = dyn_cast(DRE->getDecl())) {
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1821
@@ +1820,3 @@
+ if (Line->Affected)
+checkConstructorInitList(*Line);
+}
Why are we restricting this to constructor initializers? I think we should
directly be more generic and
djasper added inline comments.
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:39
@@ +38,3 @@
+// Ignores using-declrations defined in class definition.
+if (isa(TargetDecl->getDeclContext()))
+ return;
We should also ignore using declarations i
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:39
@@ +38,3 @@
+// Ignores using-declarations defined in class definition.
+if (isa(TargetDecl->get
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:38
@@ -37,1 +37,3 @@
+// Ignores using-declarations defined in macro.
+if (Result.SourceManager->
djasper added inline comments.
Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:39
@@ +38,3 @@
+// Ignores using-declarations defined in macro.
+if (Result.SourceManager->isMacroBodyExpansion(TargetDecl->getLocStart()),
+Result.SourceManager->isMacroBodyExpans
djasper added a comment.
Just two high-level comments. Will review in more depth later.
Comment at: include/clang/Format/Format.h:770
@@ +769,3 @@
+/// ``export`` blocks are affected by ``Ranges``.
+tooling::Replacements sortJavaScriptIncludes(const FormatStyle &Style,
+
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D20200
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper added a comment.
I experimented a bit. What do you think of this?
Comment at: lib/Format/Format.cpp:1822
@@ +1821,3 @@
+cleanupRight(Line->First, Line->Last, tok::comma, tok::comma);
+checkConstructorInitList(*Line);
+ }
You could tu
djasper added inline comments.
Comment at: lib/Format/Format.cpp:21
@@ -19,1 +20,3 @@
#include "TokenAnnotator.h"
+#include "FormatTokenLexer.h"
+#include "TokenAnalyzer.h"
Use clang-format to fix the order :-)
Comment at: lib/Format/FormatToken
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
I think, this looks good.
Manuel: Are you fine with this, design-wise?
Comment at: lib/Format/SortJavaScriptImports.cpp:77
@@ +76,3 @@
+return false;
+ // NB: empty UR
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Nice.
http://reviews.llvm.org/D20208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good :-).
http://reviews.llvm.org/D19804
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/li
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good. I am not even certain whether we want to keep a separate
sortIncludes in the interface at all, but as this doesn't change the public
API, it doesn't hurt.
http://reviews.llvm.o
Author: djasper
Date: Thu May 19 01:19:17 2016
New Revision: 270027
URL: http://llvm.org/viewvc/llvm-project?rev=270027&view=rev
Log:
clang-format: Fix enumerator case ranges.
Before:
case a... b: break;
After:
case a ... b: break;
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
c
Author: djasper
Date: Thu May 19 01:30:48 2016
New Revision: 270028
URL: http://llvm.org/viewvc/llvm-project?rev=270028&view=rev
Log:
clang-format: Fix incorrect indentation in last line of macro definition
Before:
#define MACRO(a) \
if (a) { \
f(); \
} else
Author: djasper
Date: Thu May 19 02:18:07 2016
New Revision: 270029
URL: http://llvm.org/viewvc/llvm-project?rev=270029&view=rev
Log:
clang-format: [JS] Fix spacing in destructuring assignments.
Before:
const[a, b, c] = [1, 2, 3];
After:
const [a, b, c] = [1, 2, 3];
Modified:
cfe/trunk/
Author: djasper
Date: Fri May 20 01:16:01 2016
New Revision: 270188
URL: http://llvm.org/viewvc/llvm-project?rev=270188&view=rev
Log:
clang-format: [JS] Treat "for" as a reserved word after a ".".
Otherwise, clang-format can get confused with statements like:
x.for = 1;
Modified:
cfe/trun
djasper added inline comments.
Comment at: include/clang/Tooling/Refactoring.h:91
@@ +90,3 @@
+ Rewriter &Rewrite,
+ const format::FormatStyle &Style);
+
Do you have a use case where we'd want to
djasper added inline comments.
Comment at: include/clang/Tooling/Refactoring.h:91
@@ +90,3 @@
+ Rewriter &Rewrite,
+ const format::FormatStyle &Style);
+
ioeric wrote:
> djasper wrote:
> > Do you
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: include/clang/Tooling/Refactoring.h:93
@@ +92,3 @@
+///
+/// See also "clang/Tooling/Core/Replacements.h".
+bool formatAndApplyAllReplacements(const
djasper added inline comments.
Comment at: include/clang/Format/Format.h:770
@@ +769,3 @@
+/// \brief Returns the replacements corresponding to applying, fixing, and
+/// reformatting \p Replaces.
+tooling::Replacements fixReplacements(StringRef Code,
I think we s
Please use reviews.llvm.org to send out clang-format patches.
On Mon, Apr 4, 2016 at 10:03 AM, Jacek Sieka via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> Hello,
>
> Here's a little one-off patch that fixes
> https://llvm.org/bugs/show_bug.cgi?id=19986 for me, by allowing a few
> more thin
Author: djasper
Date: Tue Apr 5 06:46:06 2016
New Revision: 265385
URL: http://llvm.org/viewvc/llvm-project?rev=265385&view=rev
Log:
clang-format: Fix cast detection on "this".
Before:
auto x = (X) this;
After:
auto x = (X)this;
This fixes llvm.org/PR27198.
Modified:
cfe/trunk/lib/For
djasper added a comment.
Please add tests in unittests/Format/FormatTest.cpp.
Comment at: lib/Format/UnwrappedLineParser.cpp:1086
@@ +1085,3 @@
+ int parens = 0;
+ while (!eof()) {
+if (FormatTok->isOneOf(tok::l_paren, tok::l_square)) {
We need
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1654
@@ +1653,3 @@
+UnwrappedLines.push_back(SmallVector());
+ }
+
That I don't understand. Almost all fixers (cleaning up commas, constructor
initializers, etc.) will only ever look at a singl
Author: djasper
Date: Wed Apr 6 08:58:09 2016
New Revision: 265540
URL: http://llvm.org/viewvc/llvm-project?rev=265540&view=rev
Log:
clang-format: Fix incorrect function annotation detection.
Before:
MACRO(
abc).function() // wrap
<< abc;
After:
MACRO(abc).function() // wrap
Author: djasper
Date: Wed Apr 6 10:02:46 2016
New Revision: 265545
URL: http://llvm.org/viewvc/llvm-project?rev=265545&view=rev
Log:
clang-format: Support labels in brace-less ifs.
While I am not personally convinced about the usefulness of this
construct, we should break it.
Before:
if (a) l
Author: djasper
Date: Wed Apr 6 11:41:39 2016
New Revision: 265557
URL: http://llvm.org/viewvc/llvm-project?rev=265557&view=rev
Log:
clang-format: Fix label-in-if statement in macros where it is actually used.
Before:
#define A \
if (a) \
label: \
f()
After:
#define A \
if
djasper added inline comments.
Comment at: include/clang/Format/Format.h:769
@@ -768,1 +768,3 @@
+/// \brief Returns the replacements corresponding to applying and fixing
+/// \p Replaces.
I am actually not sure that fixReplacements is the right terminology here
djasper added inline comments.
Comment at: lib/Format/UnwrappedLineParser.cpp:708
@@ +707,3 @@
+ if (Line && Line->Tokens.size() > 1) {
+// If the token before the previous one is an '@', the previous token is an
+// annotation and can precede another identifier/value.
--
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: unittests/Format/FormatTestJS.cpp:689
@@ -688,1 +688,3 @@
"String");
+ verifyFormat("function f(@Foo bar) {}"
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
LG.
http://reviews.llvm.org/D18950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
djasper added inline comments.
Comment at: include/clang/Format/Format.h:800
@@ -793,1 +799,3 @@
+/// \brief Fix any erroneous/redundant code in the given \p Ranges in \p Code.
+///
Same as above, "fix" is probably not the right word. "cleanup" seems somewhat
b
djasper added a comment.
Can you elaborate more on what case this is actually addressing? Are you saying
that you have a one-line file without linebreaks that you want clang-format to
format?
http://reviews.llvm.org/D19031
___
cfe-commits mailing
djasper added a comment.
Passing snippets / single lines from an IDE does not make sense. Don't try to
go down this road. clang-format always needs the full file as context.
If you are already in an IDE, that IDE should control the line endings, not
clang-format. Write a thin wrapper that chang
djasper added a comment.
It has very basic newline detection, but if possible, I'd like to not
significantly increase that. Specifically, I don't think it is worth the
complexity of additional configuration options that users have to worry about,
if it can just do the right thing (which IMO, it
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1677
@@ +1676,3 @@
+
+class Formatter {
+public:
I think FormatStyle in the Processor should be const and Formatter should make
its own copy to modify it.
Comment at: lib/Format/Fo
djasper added a comment.
Please read
http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options.
The "template" option was discussed multiple times and I remain convinced that
the costs outweigh the benefit here.
For the other option:
- Can you make statements wrt
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1272
@@ +1271,3 @@
+// Casts are never binary operators, regardless of IsExpression
+if (NextToken->isOneOf(tok::r_paren, tok::greater))
+ return TT_PointerOrReference;
I think i
djasper added a comment.
Nice catch.
Comment at: unittests/Format/FormatTest.cpp:285
@@ +284,3 @@
+
+ EXPECT_EQ("class Foo\n"
+"{\n"
How does this break? I generally add an Before and After of one of the test
cases into my patch descriptions.
htt
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: include/clang/Format/Format.h:30
@@ +29,3 @@
+namespace vfs {
+
+class FileSystem;
nit: Remove this empty line.
http://reviews.llv
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D19065
___
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/UnwrappedLineParser.cpp:1388-1390
@@ -1372,3 +1387,5 @@
parseBlock(/*MustBeDeclaration=*/false);
-if (Style.BraceWrapping.BeforeElse)
+if (Style.BraceWrapping.BeforeElse ||
+Style.BraceWrapping.AfterControl
djasper added a comment.
Can you add a test?
Comment at: lib/Format/TokenAnnotator.h:143
@@ +142,3 @@
+ Tok = Tok->Next;
+return startsWithInternal(Tok, K1) &&
+ startsWithInternal(Tok->Next, Tokens...);
It's a bit subtle that this works even
Author: djasper
Date: Mon Apr 18 06:31:21 2016
New Revision: 266599
URL: http://llvm.org/viewvc/llvm-project?rev=266599&view=rev
Log:
clang-format: Improve heuristics to detect function declarations/definitions.
Specifically understand ellipses in parameter lists and treat trailing
reference qual
djasper created this revision.
djasper added a reviewer: alexfh.
djasper added a subscriber: cfe-commits.
http://reviews.llvm.org/D19259
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tidy/misc/UnusedUsingDeclsCheck
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: lib/Format/UnwrappedLineParser.cpp:1900
@@ +1899,3 @@
+ // to the terminating `;`. For everything else, just return and continue
+ // parsing the s
djasper added inline comments.
Comment at: lib/Format/UnwrappedLineParser.cpp:1016
@@ +1015,3 @@
+ unsigned StoredPosition = Tokens->getPosition();
+ FormatToken *Next = Tokens->getNextToken();
+ FormatTok = Tokens->setPosition(StoredPosition);
-
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D19206
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper added inline comments.
Comment at: unittests/Format/FormatTestJS.cpp:339
@@ +338,3 @@
+ "}");
+ verifyFormat("async function* f() {\n"
+ " yield fetch(x);\n"
What does the star mean here? Should we actually introduce a token t
djasper marked 3 inline comments as done.
Comment at: clang-tidy/misc/MiscTidyModule.cpp:123
@@ -121,1 +122,3 @@
+CheckFactories.registerCheck(
+"misc-unused-using-decls");
CheckFactories.registerCheck(
alexfh wrote:
> I think, all "misc-unused-"
djasper updated this revision to Diff 54183.
http://reviews.llvm.org/D19259
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/UnusedAliasDeclsCheck.h
clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tidy/misc/UnusedUsingDeclsCheck.h
docs/clang-tid
Author: djasper
Date: Tue Apr 19 08:48:39 2016
New Revision: 266735
URL: http://llvm.org/viewvc/llvm-project?rev=266735&view=rev
Log:
Initial version of misc-unused-using-decl check.
Added:
clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tools-extra/trunk/clang-tid
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D19240
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
djasper added inline comments.
Comment at: unittests/Format/FormatTestJS.cpp:339
@@ +338,3 @@
+TEST_F(FormatTestJS, AsyncFunctions) {
+ verifyFormat("async function f() {\n"
+ " let x = 1;\n"
Fundamentally, I think there is two things we might need
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
Comment at: lib/Format/TokenAnnotator.h:128
@@ +127,3 @@
+ bool startsWithInternal(const FormatToken *Tok, A K1) const {
+// Even though we skip comments in
Author: djasper
Date: Wed Apr 20 03:58:27 2016
New Revision: 266864
URL: http://llvm.org/viewvc/llvm-project?rev=266864&view=rev
Log:
clang-tidy: [misc-unused-using-decls] Always use the canonical decl to
identify things.
This fixes llvm.org/PR27430.
Modified:
clang-tools-extra/trunk/clang-t
Author: djasper
Date: Wed Apr 20 04:48:56 2016
New Revision: 266866
URL: http://llvm.org/viewvc/llvm-project?rev=266866&view=rev
Log:
clang-tidy: [misc-unused-using-decls] Support template types.
This fixes llvm.org/PR27429.
Modified:
clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsC
djasper added inline comments.
Comment at: lib/Format/Format.cpp:1544
@@ -1508,2 +1543,3 @@
deriveLocalStyle(AnnotatedLines);
-computeAffectedLines(AnnotatedLines.begin(), AnnotatedLines.end());
+AffectedRangeMgr.computeAffectedLines(AnnotatedLines.begin(),
+
401 - 500 of 731 matches
Mail list logo