summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-072-5/+9
| | | | | | rdar://19369529 llvm-svn: 241557
* C++ support for Objective-C lightweight generics.Douglas Gregor2015-07-072-8/+13
| | | | | | | | | | | | | | | | | | | Teach C++'s tentative parsing to handle specializations of Objective-C class types (e.g., NSArray<NSString *>) as well as Objective-C protocol qualifiers (id<NSCopying>) by extending type-annotation tokens to handle this case. As part of this, remove Objective-C protocol qualifiers from the declaration specifiers, which never really made sense: instead, provide Sema entry points to make them part of the type annotation token. Among other things, this properly diagnoses bogus types such as "<NSCopying> id" which should have been written as "id <NSCopying>". Implements template instantiation support for, e.g., NSArray<T>* in C++. Note that parameterized classes are not templates in the C++ sense, so that cannot (for example) be used as a template argument for a template template parameter. Part of rdar://problem/6294649. llvm-svn: 241545
* Handle Objective-C type arguments.Douglas Gregor2015-07-072-1/+44
| | | | | | | | | | | | | | | | | | | | | Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id<NSCopying>), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray<T> inherits from NSArray<T>). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray<NSString *> *) and unspecialized types (NSArray *) are represented, separately. llvm-svn: 241542
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-071-0/+2
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* [CMake] clang-*.*: Prevent versioning if the buildhost is targeting for Win32.NAKAMURA Takumi2015-07-051-1/+5
| | | | | | | | | | | | | | CMake-2.8.12 is hardcoded to create symlinked clang.exe if the target property VERSION is present and the host is not Win32. Then clang.exe-*.* is generated and clang.exe is symlinked to it. lrwxrwxrwx. 1 bb bb 13 Jul 5 18:04 clang.exe -> clang.exe-3.7 -rwxr-x---. 1 bb bb 244763 Jul 5 18:04 clang++.exe -rwxr-x---. 1 bb bb 244763 Jul 5 18:04 clang.exe-3.7 It made me unhappy when built binaries were copied to the Windows target. FIXME: Could we just remove the target property VERSION in add_llvm_executable() ? llvm-svn: 241403
* Switch users of the 'for (StmtRange range = stmt->children(); range; ↵Benjamin Kramer2015-07-021-2/+2
| | | | | | | | | ++range)‘ pattern to range for loops. The pattern was born out of the lack of range-based for loops in C++98 and is somewhat obscure. No functionality change intended. llvm-svn: 241300
* [OPENMP 4.0] Initial support for 'omp cancel' construct.Alexey Bataev2015-07-022-0/+10
| | | | | | Implemented parsing/sema analysis + (de)serialization. llvm-svn: 241253
* [analyzer] Prevent ccc/c++-analyzer from hanging on Windows.Anton Yartsev2015-07-012-62/+48
| | | | | | 'fork'+'exec' combination made scan-build and ccc-analyzer hang under Windows. The patch replaces 'fork'+'exec' with more reliable 'system' (ccc-analyzer) and piped 'open' (scan-build). See http://reviews.llvm.org/D8774 and http://reviews.llvm.org/D9357 for more details. llvm-svn: 241201
* [OPENMP 4.0] Initial support for 'omp cancellation point' construct.Alexey Bataev2015-07-012-0/+12
| | | | | | Add parsing and sema analysis for 'omp cancellation point' directive. llvm-svn: 241145
* [clang-fuzzer] Update clang-fuzzer to API change in r240225.Alexey Samsonov2015-06-251-1/+4
| | | | llvm-svn: 240685
* [OPENMP] Initial support for 'depend' clause (4.0).Alexey Bataev2015-06-231-0/+3
| | | | | | Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0). llvm-svn: 240409
* Update for LLVM api change.Rafael Espindola2015-06-231-3/+2
| | | | llvm-svn: 240406
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-2219-34/+30
| | | | llvm-svn: 240353
* Update for LLVM API change to return by InputArgList directly (rather than ↵David Blaikie2015-06-222-40/+40
| | | | | | by pointer) from ParseArgs llvm-svn: 240349
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-2219-30/+34
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* ArrayRef-ify ParseArgsDavid Blaikie2015-06-212-6/+5
| | | | llvm-svn: 240237
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-206-29/+39
| | | | | | | | | | | | | | | | A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
* clang-format: Add TypeScript detection to git-clang-format.Daniel Jasper2015-06-191-0/+1
| | | | llvm-svn: 240128
* Fix a typo.Adrian Prantl2015-06-181-1/+1
| | | | llvm-svn: 240025
* [OPENMP] Support for '#pragma omp taskgroup' directive.Alexey Bataev2015-06-182-0/+11
| | | | | | | | | | | | | Added parsing, sema analysis and codegen for '#pragma omp taskgroup' directive (OpenMP 4.0). The code for directive is generated the following way: #pragma omp taskgroup <body> void __kmpc_taskgroup(<loc>, thread_id); <body> void __kmpc_end_taskgroup(<loc>, thread_id); llvm-svn: 240011
* [analyzer] Cleanup: $Status is always 0 here.Anton Yartsev2015-06-171-2/+0
| | | | llvm-svn: 239971
* [analyzer] Close file handle before output to file from external command.Anton Yartsev2015-06-171-1/+1
| | | | | | An old code caused problems under Windows - additional temporary file was created for clang preprocessor output while the right output file remained empty. llvm-svn: 239970
* Recommit r239721: Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | InitMCObjectFileInfo. NFC. Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239812
* Revert r239721 - Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-151-2/+2
| | | | | | | | InitMCObjectFileInfo. NFC. It appears to cause sparc-little-endian.s to assert on Windows and Darwin. llvm-svn: 239724
* Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.Daniel Sanders2015-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239721
* Update for llvm api change.Rafael Espindola2015-06-131-14/+4
| | | | llvm-svn: 239670
* scan-build: Remove useless whitespace in File pathSylvestre Ledru2015-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Honggyu Kim Summary: This patch removes useless whitespace in File path in index.html Previously, a File directory path is copied and pasted as below: arch /arm /kernel /stacktrace.c It just removes the whitespace between directories and makes the copied string as below: arch/arm/kernel/stacktrace.c The output looks same in html format, but the copied directory path can be pasted as it looks. Reviewers: krememek, zaks.anna, sylvestre.ledru Reviewed By: sylvestre.ledru Subscribers: aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D10354 llvm-svn: 239609
* push_back() loop -> append() for random access iterators.Benjamin Kramer2015-06-121-3/+1
| | | | | | | append will resize the vector to the optimal size. No functional change intended. llvm-svn: 239607
* Implementing C99 partial re-initialization behavior (DR-253)Yunzhong Gao2015-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Based on previous discussion on the mailing list, clang currently lacks support for C99 partial re-initialization behavior: Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm This patch attempts to fix this problem. Given the following code snippet, struct P1 { char x[6]; }; struct LP1 { struct P1 p1; }; struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' }; // this example is adapted from the example for "struct fred x[]" in DR-253; // currently clang produces in l: { "\0\0x" }, // whereas gcc 4.8 produces { "fox" }; // with this fix, clang will also produce: { "fox" }; Differential Review: http://reviews.llvm.org/D5789 llvm-svn: 239446
* Removing spurious semi colons; NFC.Aaron Ballman2015-06-091-1/+1
| | | | llvm-svn: 239400
* range-for'ify Args->filtered_begin(...) loopsSean Silva2015-06-091-4/+2
| | | | | | | We already have Args->filtered(...) which is a drop-in range-for replacement. llvm-svn: 239381
* Fix terrible python goof in clang-format.py which broke my vimChandler Carruth2015-06-041-1/+1
| | | | | | | | | integration. Nothing is more important in life than clang-format integration with vim. ;] llvm-svn: 239098
* Make vim also output a helpful message in some error cases.Manuel Klimek2015-06-021-0/+2
| | | | | | | | When clang-format encounters a syntax error, it will not format that line; we're now using the same mechanism we're already using in emacs to show a helpful error message to the user. llvm-svn: 238823
* Revert r237339 as sanitizer-ppc64-linux1 does not like it.Yaron Keren2015-05-141-7/+6
| | | | | | | | | | | | | | | | | | | Complains: /home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:829:30: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat] I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm not sure now how this should be fixed. %lld is non-standard and not accepted by mingw on Windows while PRId64 is bad for this bot. Is long long longer than 64 bits here? if not, why is PRId64 incompatible with it? something seems wrong. Probably all the datatypes should be replaced to unsigned or uint64_t depending upin requirements instead of the non standard long long. llvm-svn: 237346
* Replace non-standard %lld printf usage with PRId64.Yaron Keren2015-05-141-6/+7
| | | | | | See also r180024. llvm-svn: 237339
* Fix clang-format build from the solution; the underlying path has changed to ↵Manuel Klimek2015-05-121-2/+2
| | | | | | include the VS directory structure. llvm-svn: 237136
* [OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.Alexey Bataev2015-05-121-0/+1
| | | | | | 'schedule' clause for combined directives requires additional processing. Special helper variable is generated, that is captured in the outlined parallel region for 'parallel for' region. This captured variable is used to store chunk expression from the 'schedule' clause in this 'parallel for' region. llvm-svn: 237100
* revert r237081 -- bad idea (-lcrypt may not be present)Kostya Serebryany2015-05-122-2/+0
| | | | llvm-svn: 237086
* add -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)Kostya Serebryany2015-05-122-1/+3
| | | | llvm-svn: 237081
* Reapply r236854 and fixed r236867.Daniel Jasper2015-05-102-10/+21
| | | | | | | Makes emacs show a different message when clang-format encountered a syntax error. llvm-svn: 236943
* Revert "Make emacs show when clang-format encountered a syntax error."Tobias Grosser2015-05-082-22/+11
| | | | | | | | | | | This reverts commit 236854, which caused clang-format to always print '{ "IncompleteFormat": false }' at the top of an incompletely formatted file. This output causes problems e.g. in Polly's automatic formatting checks. Daniel tried to fix this in 236867, but this fix had to be reverted due to buildbot failures. I revert this change as well for now as it is Friday night and unlikely to be fixed immediately. llvm-svn: 236908
* Revert "clang-format: Only output IncompleteFormat if -cursor is given."Renato Golin2015-05-081-6/+6
| | | | | | | This reverts commit r236867, as it was breaking multiple buildbots. Daniel will look into it later. llvm-svn: 236882
* clang-format: Only output IncompleteFormat if -cursor is given.Daniel Jasper2015-05-081-6/+6
| | | | | | This is only for editor integrations. llvm-svn: 236867
* Make emacs show when clang-format encountered a syntax error.Manuel Klimek2015-05-082-11/+22
| | | | | | | Propagate the 'incomplete-format' state back through clang-format's command line interace and adapt the emacs integration to show a better result. llvm-svn: 236854
* fix clang-fuzzer and clang-format-fuzzer Kostya Serebryany2015-05-072-2/+2
| | | | llvm-svn: 236691
* clang-format: Don't allow -i when reading from stdin.Daniel Jasper2015-05-061-1/+3
| | | | llvm-svn: 236592
* Revert "[analyzer] scan-build: support spaces in compiler path and arguments."Ahmed Bougacha2015-05-061-5/+1
| | | | | | | | This reverts commit r236423 and its followup r236533, as indiscriminate quoting makes for too much quoting (and clang doesn't like both '"-c"' and -D"FOO=bar"). llvm-svn: 236562
* [analyzer] This eliminates regression caused by r236423.Anton Yartsev2015-05-051-1/+5
| | | | | | Wrap an argument with quotes only if it has spaces. llvm-svn: 236533
* [clang-fuzzer] make clang-fuzzer slightly faster by removing one redundant ↵Kostya Serebryany2015-05-041-2/+2
| | | | | | directory scan llvm-svn: 236459
* [analyzer] scan-build: support spaces in compiler path and arguments.Anton Yartsev2015-05-041-2/+2
| | | | | | This fixes errors that occur if a path to the default compiler has spaces or if an argument with spaces is given to compiler (e.g. via -I). (http://reviews.llvm.org/D9357) llvm-svn: 236423
OpenPOWER on IntegriCloud