- Mar 22, 2016
-
-
Daniel Jasper authored
"import ... from '...';" and "export ... from '...';" should be treated the same as goog.require/provide/module/forwardDeclare calls. Patch by Martin Probst. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264055 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexander Kornienko authored
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue). Reviewers: klimek, sbenza Subscribers: xazax.hun, klimek, cfe-commits Patch by Ádám Balogh! Differential Revision: http://reviews.llvm.org/D17986 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264037 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 21, 2016
-
-
Daniel Jasper authored
The operators | and & in types, as opposed to the bitwise operators, should not have whitespace around them (e.g. `Foo<Bar|Baz>`). Patch by Martin Probst. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263961 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
This patch adds a regular expression to configure suffixes of an included file to check whether it is the "main" include of the current file. Previously, clang-format has allowed arbitrary suffixes on the formatted file, which is still the case when no IncludeMainRegex is specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263943 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 20, 2016
-
-
Bruno Cardoso Lopes authored
This reapplies r261552 and r263748. Fixed testcase to reapply. The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263893 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 17, 2016
-
-
Bruno Cardoso Lopes authored
Tests failing on http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/46102 This reverts commit a1683cd6c9e07359c09f86e98a4db6b4e1bc51fc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263750 91177308-0d34-0410-b5e6-96231b3b80d8
-
Bruno Cardoso Lopes authored
This reapplies r261552. The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263748 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
change affected ranges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263713 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: x.of (); After: x.of(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263710 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
If a call takes a single argument, using AlwaysBreak can lead to lots of wasted lines and additional indentation without improving the readability in a significant way. Before: caaaaaaaaaaaall( caaaaaaaaaaaall( caaaaaaaaaaaall( caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa)))); After: caaaaaaaaaaaall(caaaaaaaaaaaall(caaaaaaaaaaaall( caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa)))); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263709 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 14, 2016
-
-
Daniel Jasper authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263470 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 09, 2016
-
-
Aaron Ballman authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263041 91177308-0d34-0410-b5e6-96231b3b80d8
-
Aaron Ballman authored
Adding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr. Patch by Aleksei Sidorin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263027 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 08, 2016
-
-
Aaron Ballman authored
Turning on the /bigobj flag for two more files that will not link with MSVC 2015 Win64 Debug due to the section limit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262938 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 06, 2016
-
-
Felix Berger authored
Summary: Add test for Objective-C object pointer matching. Reviewers: aaron.ballman Subscribers: klimek Differential Revision: http://reviews.llvm.org/D17489 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262806 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 05, 2016
-
-
Daniel Jasper authored
Before: for (let { a, b } of x) { } After: for (let {a, b} of x) { } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262776 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 04, 2016
-
-
James Y Knight authored
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262737 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 03, 2016
-
-
Daniel Jasper authored
Otherwise, clang-format can output useless replacements in the presence of identical #includes git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262630 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 02, 2016
-
-
Daniel Jasper authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262534 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 01, 2016
-
-
Daniel Jasper authored
Patch by Erik Kessler, thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262402 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262329 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262324 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262323 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262318 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
ternary expressions. Before: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb + cccccccccccccccc; After: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb + cccccccccccccccc; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262293 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa] [a].aaaaaaaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a] .aaaaaaaaaaaaaaaaaaaaaa(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262292 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: var x = { a: a, b: b, 'c': c, }; After: var x = { a: a, b: b, 'c': c, }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262291 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 29, 2016
-
-
Manuel Klimek authored
This reverts commit r262232. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262234 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
Patch by Eric Liu. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262232 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
With this change: SomeFunction( [] { int i; return i; // Format this line. }, [] { return 2; // Don't "fix" this. }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262216 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 23, 2016
-
-
Bruno Cardoso Lopes authored
Revert "[VFS] Add 'overlay-relative' field to YAML files" and "[VFS] Fix 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261613 91177308-0d34-0410-b5e6-96231b3b80d8
-
Duncan P. N. Exon Smith authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261596 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 22, 2016
-
-
Duncan P. N. Exon Smith authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261585 91177308-0d34-0410-b5e6-96231b3b80d8
-
Samuel Benzaquen authored
Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...) Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D17163 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261574 91177308-0d34-0410-b5e6-96231b3b80d8
-
Bruno Cardoso Lopes authored
Follow up from r261552 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261556 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Patch by Martin Probst. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261528 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 21, 2016
-
-
Duncan P. N. Exon Smith authored
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261461 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 20, 2016
-
-
Duncan P. N. Exon Smith authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261455 91177308-0d34-0410-b5e6-96231b3b80d8
-
Duncan P. N. Exon Smith authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261449 91177308-0d34-0410-b5e6-96231b3b80d8
-
Duncan P. N. Exon Smith authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261448 91177308-0d34-0410-b5e6-96231b3b80d8
-