| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations prevents breaking code during development, which greatly
improves usability.
JS code should still use semicolons, and ASI code should be flagged by
a compiler or linter.
Patch by Martin Probst. Thank you.
llvm-svn: 263470
|
|
|
|
|
|
| |
MSVC-built bots.
llvm-svn: 263041
|
|
|
|
|
|
|
|
| |
binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr.
Patch by Aleksei Sidorin.
llvm-svn: 263027
|
|
|
|
|
|
| |
2015 Win64 Debug due to the section limit.
llvm-svn: 262938
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
object pointers.
Summary: Add test for Objective-C object pointer matching.
Reviewers: aaron.ballman
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D17489
llvm-svn: 262806
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (let { a, b } of x) {
}
After:
for (let {a, b} of x) {
}
llvm-svn: 262776
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use it to calculate UserLabelPrefix, instead of specifying it (often
incorrectly).
Note that the *actual* user label prefix has always come from the
DataLayout, and is handled within LLVM. The main thing clang's
TargetInfo::UserLabelPrefix did was to set the #define value. Having
these be different from each-other is just silly.
Differential Revision: http://reviews.llvm.org/D17183
llvm-svn: 262737
|
|
|
|
|
|
|
| |
Otherwise, clang-format can output useless replacements in the presence
of identical #includes
llvm-svn: 262630
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow the Google JavaScript style
guide:
https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings
This functionality is behind the option "JavaScriptQuotes", which can be:
* "leave" (no re-quoting)
* "single" (change to single quotes)
* "double" (change to double quotes)
This also changes single quoted JavaScript string literals to be treated
as tok::string_literal, not tok::char_literal, which fixes two unrelated
tests.
Patch by Martin Probst. Thank you.
llvm-svn: 262534
|
|
|
|
|
|
| |
Patch by Erik Kessler, thank you.
llvm-svn: 262402
|
|
|
|
| |
llvm-svn: 262329
|
|
|
|
| |
llvm-svn: 262324
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a commonly useful feature to have, and we have implemented it
multiple times with different kinds of bugs. This implementation
centralizes the idea in a set of functions that we can then use from the various
tools.
Reverts r262234, which is a revert of r262232, and puts the functions
into FOrmat.h, as they are closely coupled to clang-format, and we
otherwise introduce a cyclic dependency between libFormat and
libTooling.
Patch by Eric Liu.
llvm-svn: 262323
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This behavior is enabled when the new CXTranslationUnit_KeepGoing
option is passed to clang_parseTranslationUnit{,2}. It is geared
towards use by IDEs and similar consumers of the clang-c API where
fatal errors may arise when parsing incomplete code mid-edit, or
when include paths are not properly configured yet. In such situations
one still wants to get as much information as possible about a TU.
Previously, the semantic analysis would not instantiate templates
or report additional fatal errors after the first fatal error was
encountered.
Fixes PR24268.
Patch by Milian Wolff.
llvm-svn: 262318
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ternary expressions.
Before:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb +
cccccccccccccccc;
After:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
aaaaa :
bbbbbbbbbbbbbbb + cccccccccccccccc;
llvm-svn: 262293
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa]
[a].aaaaaaaaaaaaaaaaaaaaaa();
After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a]
.aaaaaaaaaaaaaaaaaaaaaa();
llvm-svn: 262292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var x = {
a: a,
b: b, 'c': c,
};
After:
var x = {
a: a,
b: b,
'c': c,
};
llvm-svn: 262291
|
|
|
|
|
|
|
|
| |
replacements."
This reverts commit r262232.
llvm-svn: 262234
|
|
|
|
|
|
| |
Patch by Eric Liu.
llvm-svn: 262232
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change:
SomeFunction(
[] {
int i;
return i; // Format this line.
},
[] {
return 2; // Don't "fix" this.
});
llvm-svn: 262216
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
call to getVFSFromYAML in unittests"
This reverts commit r261552 and r261556 because of failing unittests on
windows:
Failing Tests (4):
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName
llvm-svn: 261613
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change getString() to return Optional<StringRef>, and change
lookupFilename() to return an empty string if either one of the prefix
and suffix can't be found.
This is a more robust follow-up to r261461, but it's still not entirely
satisfactory. Ideally we'd report that the header map is corrupt;
perhaps something for a follow-up.
llvm-svn: 261596
|
|
|
|
|
|
|
|
| |
Switch to using `isPowerOf2_32()` to check whether the buckets are a
power of two, and as a side benefit reject loading a header map with no
buckets. This is a follow-up to r261448.
llvm-svn: 261585
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17163
llvm-svn: 261574
|
|
|
|
|
|
| |
Follow up from r261552
llvm-svn: 261556
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 261528
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a header map file is corrupt, the strings in the string table may not
be null-terminated. The logic here previously relied on `MemoryBuffer`
always being null-terminated, but this isn't actually guaranteed by the
class AFAICT. Moreover, we're seeing a lot of crash traces at calls to
`strlen()` inside of `lookupFilename()`, so something is going wrong
there.
Instead, use `strnlen()` to get the length, and check for corruption.
Also remove code paths that could call `StringRef(nullptr)`. r261459
made these rather obvious (although they'd been there all along).
llvm-svn: 261461
|
|
|
|
|
|
|
|
| |
Add a simple test for `HeaderMap::lookupFileName()`. I'm planning to
add better error checking in a moment, and I'll add more tests like this
then.
llvm-svn: 261455
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check up front whether the header map buffer has space for all of its
declared buckets.
There was already a check in `getBucket()`, but it had UB (comparing
pointers that were outside of objects in the error path) and was
insufficient (only checking for a single byte of the relevant bucket).
I fixed the check, moved it to `checkHeader()`, and left a fixed version
behind as an assertion.
llvm-svn: 261449
|
|
|
|
|
|
|
|
| |
If the number of buckets is not a power of two, immediately recognize
the header map as corrupt, rather than waiting for the first lookup. I
converted the later check to an assert.
llvm-svn: 261448
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split the implementation of `HeaderMap` into `HeaderMapImpl` so that we
can write unit tests that don't depend on the `FileManager`, and then
write a few tests that cover the types of corrupt header maps already
detected.
This also moves type and constant definitions from HeaderMap.cpp to
HeaderMapTypes.h so that the test can access them.
llvm-svn: 261446
|
|
|
|
|
|
| |
Cleanup for upcoming Clang warning -Wcomma. No functionality change intended.
llvm-svn: 261271
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using Backend_EmitLL attemps to create a file with an empty filename.
This is problematic in certain environments: an empty filename may be
illegal, or the default output path may not be writable (in the case
where an empty filename would otherwise have some non-failing
semantics). This patch switches to use Backend_EmitMCNull, which
allows CodeGen to run, but does not attempt to create or write an
output file.
Differential Revision: http://reviews.llvm.org/D17405
llvm-svn: 261252
|
|
|
|
| |
llvm-svn: 261223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Llvm module object is shared between CodeGenerator and BackendConsumer,
in both classes it is stored as std::unique_ptr, which is not a good
design solution and can cause double deletion error. Usually it does
not occur because in BackendConsumer::HandleTranslationUnit the
ownership of CodeGenerator over the module is taken away. If however
this method is not called, the module is deleted twice and compiler crashes.
As the module owned by BackendConsumer is always the same as CodeGenerator
has, pointer to llvm module can be removed from BackendGenerator.
Differential Revision: http://reviews.llvm.org/D15450
llvm-svn: 261222
|
|
|
|
|
|
| |
double, but not complex.
llvm-svn: 261221
|
|
|
|
| |
llvm-svn: 261009
|
|
|
|
|
|
| |
constants in one matcher.
llvm-svn: 261008
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.
Reviewers: rsmith, rnk
Subscribers: rnk, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17214
llvm-svn: 261005
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623.
Reviewers: alexfh, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15819
llvm-svn: 260872
|
|
|
|
|
|
|
| |
This will be needed for the next commit that allows to switch the default
C++ library which would otherwise make these tests fail.
llvm-svn: 260661
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (var i of[2, 3]) {}
After:
for (var i of [2, 3]) {}
llvm-svn: 260518
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
<< aaa;
After:
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
<< aaa;
llvm-svn: 260517
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, make it more expensive than breaking after the return
type of a function definition/declaration.
Before:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
After:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
llvm-svn: 260497
|
|
|
|
|
|
|
|
|
| |
that type from the global scope.
Patch by Sterling Augustine, derived (with permission) from code from Cling by
Vassil Vassilev and Philippe Canal.
llvm-svn: 260278
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For an explicit specialization, we first build a FunctionDecl, and then
we call SubstDecl() on it to build a second FunctionDecl, which has the
first FunctionDecl as canonical decl.
The address of an explicit specialization of function template used to be the
canonical decl of the FunctionDecl. This is different from all the other
DeduceTemplateArguments() calls in SemaOverload, and since the canonical decl
isn't visited by ParentMap while the redecl is, it also made ParentMap assert
when computing the parent of a address-of-explicit-specialization-fun-template.
To fix, remove the getCanonicalDecl() call. No behavior difference for clang,
but it fixes an assert in ParentMap (which is e.g. used by libTooling).
llvm-svn: 260159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, //
ccccccc(aaaaaaaaaaaaaaaaa, //
b));
After:
bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, //
ccccccc(aaaaaaaaaaaaaaaaa, //
b));
This fixes llvm.org/PR24905.
llvm-svn: 260080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
f({a},
() => {
g(); //
});
After:
f({a}, () => {
g(); //
});
llvm-svn: 260060
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Allow hasName() to look through inline namespaces.
This will fix the interaction between some clang-tidy checks and libc++.
libc++ defines names in an inline namespace named std::<version_#>.
When we try to match a name using hasName("std::xxx") it fails to match and the clang-tidy check does not work.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D15506
llvm-svn: 259898
|
|
|
|
|
|
|
|
|
|
| |
Before:
f(a.operator() < A > ());
After:
f(a.operator()<A>());
llvm-svn: 259884
|