summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Driver] Fix implicit config files from prefixed symlinksMartin Storsjo2018-04-253-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If -no-canonical-prefixes isn't used, the clang executable name used is the one of the actual executable, not the name of the symlink that the user invoked. In these cases, the target prefix was overridden based on the clang executable name. (On the other hand the implicit -target option that such a symlink adds, is added as an actual command line parameter in tools/driver/driver.cop, before resolving the symlink and finding the actual clang executable. Use the original ClangNameParts (set from argv[0] in tools/driver/driver.cpp) if it seems to be initialized propery. All existing tests of this feature used -no-canonical-prefixes (possibly because it also makes the driver look in the directory of the symlink instead of the directory of the executable); add another one that uses --config-user-dir= to specify the directory instead. (For actual users of such symlinks, outisde of the test suite, the directory is probably the same for both.) This makes this feature work more like what the documentation describes. Differential Revision: https://reviews.llvm.org/D45964 llvm-svn: 330871
* [TargetInfo] Sort target features before passing them to the backendEli Friedman2018-04-252-0/+7
| | | | | | | | | | | | | | | Passing the features in random order will lead to unpredictable results when some of the features are related (like the architecture-version features on ARM). It might be possible to fix this particular case in the ARM target code, to avoid adding overlapping target features. But we should probably be sorting in any case: the behavior shouldn't depend on StringMap's hashing algorithm. Differential Revision: https://reviews.llvm.org/D46030 llvm-svn: 330861
* [CMake] Enable libc++ for Fuchsia toolchain on DarwinPetr Hosek2018-04-251-10/+1
| | | | | | | | | This is necessary in order to get a working C++ compiler on Darwin since Clang expects libc++ headers to be part of the toolchain. Differential Revision: https://reviews.llvm.org/D46075 llvm-svn: 330855
* [ASTImporter] FriendDecl importing improvementsPeter Szecsi2018-04-257-5/+159
| | | | | | | | | | There are only a few cases of importing a frienddecl which is currently supported. This patch aims to improve the friend import process. Set FriendObjectKind in case of decls, insert friend into the friend chain correctly, checks structurally equivalent in a more advanced manner. Test cases added as well. llvm-svn: 330847
* [Builtins] Fix typos in a comment. NFCCraig Topper2018-04-251-1/+1
| | | | llvm-svn: 330842
* Make add_clang_unittest formatting a bit more consistent.Nico Weber2018-04-252-2/+4
| | | | llvm-svn: 330839
* [CodeComplete] Fix completion in the middle of ident in ctor lists.Ilya Biryukov2018-04-253-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The example that was broken before (^ designates completion points): class Foo { Foo() : fie^ld^() {} // no completions were provided here. int field; }; To fix it we don't cut off lexing after an identifier followed by code completion token is lexed. Instead we skip the rest of identifier and continue lexing. This is consistent with behavior of completion when completion token is right before the identifier. Reviewers: sammccall, aaron.ballman, bkramer, sepavloff, arphaman, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44932 llvm-svn: 330833
* [clang-format] Start formatting cpp code in raw strings in google styleKrasimir Georgiev2018-04-251-12/+31
| | | | | | | | | | | | | | Summary: This adds some delimiters to detect cpp code in raw strings. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46062 llvm-svn: 330832
* [HIP] Add predefined macros __HIPCC__ and __HIP_DEVICE_COMPILE__Yaxun Liu2018-04-252-2/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D45441 llvm-svn: 330824
* Fix failure in lit test kernel-call.cu due to name manglingYaxun Liu2018-04-251-2/+2
| | | | llvm-svn: 330821
* add check for long double for __builtin_dump_structPaul Semel2018-04-251-0/+24
| | | | llvm-svn: 330808
* Fix buildbot problems after rC330794Bjorn Pettersson2018-04-251-1/+2
| | | | | | | | | | | | | | Avoiding error: no matching function for call to 'makeArrayRef' at ../tools/clang/lib/Parse/ParseTemplate.cpp:373:17 By using a local C array as input to makeArrayRef. Not sure if this is the best solution, but it makes the code compile again. llvm-svn: 330802
* [NFC] Make dependent parameter non-deducible, so that we are forced to use ↵Faisal Vali2018-04-251-1/+2
| | | | | | | | the default template parameter. This might provide users with more graceful diagnostics if they should ever try and call this function with non-ConceptDecls. llvm-svn: 330798
* Fix rC330794 - a parameter that should have been dependent was inadvertently ↵Faisal Vali2018-04-251-2/+4
| | | | | | | | | | not - and compiled in MSVC - but not so for the other bots. The fix was to make it dependent as intended. llvm-svn: 330796
* Fix lit test kernel-call.cu failure on ps4 due to dso_localYaxun Liu2018-04-251-2/+2
| | | | llvm-svn: 330795
* [c++2a] [concepts] Add rudimentary parsing support for template concept ↵Faisal Vali2018-04-2533-72/+635
| | | | | | | | | | | | | | declarations This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of the 'concept' token is moved into the machinery that recognizes declaration-specifiers - this allows us to leverage the attribute handling machinery more seamlessly. See the test file to get a sense of the basic parsing that this patch supports. There is much more work to be done before concepts are usable... Thanks Changyu! llvm-svn: 330794
* Fix failure in lit test kernel-call.cuYaxun Liu2018-04-251-1/+1
| | | | | | There is signext on ppc64. Just remove check for function argument. llvm-svn: 330793
* [HIP] Add hip input kind and codegen for kernel launchingYaxun Liu2018-04-2513-67/+151
| | | | | | | | | | | | | | | | | | | | | | | HIP is a language similar to CUDA (https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md ). The language syntax is very similar, which allows a hip program to be compiled as a CUDA program by Clang. The main difference is the host API. HIP has a set of vendor neutral host API which can be implemented on different platforms. Currently there is open source implementation of HIP runtime on amdgpu target (https://github.com/ROCm-Developer-Tools/HIP). This patch adds support of input kind and language standard hip. When hip file is compiled, both LangOpts.CUDA and LangOpts.HIP is turned on. This allows compilation of hip program as CUDA in most cases and only special handling of hip program is needed LangOpts.HIP is checked. This patch also adds support of kernel launching of HIP program using HIP host API. When -x hip is not specified, there is no behaviour change for CUDA. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44984 llvm-svn: 330790
* [ODRHash] Hash template arguments of methods.Richard Trieu2018-04-254-1/+219
| | | | llvm-svn: 330789
* Revert "[Driver] Android triples are not aliases for other triples."Dan Albert2018-04-242-111/+50
| | | | | | | | Revering while I diagnose the failures. This reverts commit 82dc3bf2157da280420f80e654292cb05e0dc5f7. llvm-svn: 330780
* [Driver] Android triples are not aliases for other triples.Dan Albert2018-04-242-50/+111
| | | | | | | | | | | | | | | | Summary: Android targets should never use tools/libraries for non-Android targets or vice versa. Reviewers: srhines, george.burgess.iv, eugenis Reviewed By: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45597 llvm-svn: 330770
* [analyzer] Add support for the note diagnostic pieces to plist output format.Artem Dergachev2018-04-242-32/+127
| | | | | | | | | | | | | | | | | Note diagnostic pieces are an additional way of highlighting code sections to the user. They aren't part of the normal path diagnostic sequence. They can also be attached to path-insensitive reports. Notes are already supported by the text output and scan-build. Expanding our machine-readable plist output format to be able to represent notes opens up the possibility for various analyzer GUIs to pick them up. Patch by Umann Kristóf! Differential Revision: https://reviews.llvm.org/D45407 llvm-svn: 330766
* Improve -Warray-bounds to handle multiple array extents rather than only ↵Aaron Ballman2018-04-243-3/+26
| | | | | | | | handling the top-most array extent. Patch by Bevin Hansson. llvm-svn: 330759
* [CUDA] Enable CUDA compilation with CUDA-9.2Artem Belevich2018-04-244-2/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D45827 llvm-svn: 330753
* [HWASan] Update HWASan assembly snippet in the docsAlex Shlyapnikov2018-04-241-9/+10
| | | | | | | | | | | | Summary: To complement https://reviews.llvm.org/D45840 Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45996 llvm-svn: 330745
* [X86] Add recently added intrinsic headers to the module map.Craig Topper2018-04-241-0/+3
| | | | llvm-svn: 330744
* [X86] Consistently use double underscore at the beginning of the include ↵Craig Topper2018-04-249-27/+27
| | | | | | | | guards in our intrinsic headers. Most files used double underscore, but a few used single. This converges them all to double. llvm-svn: 330743
* [Attr] Print enum attributes at correct positionJoel E. Denny2018-04-242-12/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, given: void fn() { enum __attribute__((deprecated)) T *p; } -ast-print produced: void fn() { enum T __attribute__((deprecated(""))) *p; } -ast-print on that produced: void fn() { enum T *p __attribute__((deprecated(""))); } The attribute is on enum T in the first case, but it's on p in the other cases. Details: Within enum declarations, enum attributes were always printed after the tag and any member list. When no member list was present but the enum was a type specifier in a variable declaration, the attribute then applied to the variable not the enum, changing the semantics. This patch fixes that by always printing attributes between the enum's keyword and tag, as clang already does for structs, unions, and classes. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D45456 llvm-svn: 330722
* [OpenCL] Fix diagnostic of thread_localSven van Haastregt2018-04-241-0/+1
| | | | | | | | | | | | | Commit 08c258670c ("[OpenCL] Generic address space has been added in OpenCL v2.0.", 2014-11-26) did not mark the thread_local keyword as a storage class specifier, whereas it did mark _Thread_local as such. According to the C++14 spec s7.1.1, thread_local is a storage class specifier, so mark it as such. I will add a test for this in a follow-up commit that adds keyword restrictions to the OpenCL C++ language mode. llvm-svn: 330721
* [CodeComplete] Fix completion at the end of keywordsIlya Biryukov2018-04-2412-29/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make completion behave consistently no matter if it is run at the start, in the middle or at the end of an identifier that happens to be a keyword or a macro name. Since completion is often ran on incomplete identifiers, they may turn into keywords by accident. For example, we should produce same results for all of these completion points: // ^ is completion point. ^class cla^ss class^ Previously clang produced different results for the last case (as if the completion point was after a space: `class ^`). This change also updates some offsets in tests that (unintentionally?) relied on the old behavior. Reviewers: sammccall, bkramer, arphaman, aaron.ballman Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45887 llvm-svn: 330717
* [GCC] Don't keep a StringRef to a temporary std::stringMartin Storsjo2018-04-241-1/+1
| | | | | | | | | | This fixes failures in asan builds and possibly other buildbots as well, after SVN r330696. Prior to that revision, the std::string was stored in another variable, before assigning to a StringRef. llvm-svn: 330710
* [ASTImporter] Allow testing of import sequences; fix import of typedefs for ↵Aleksei Sidorin2018-04-246-72/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | anonymous decls This patch introduces the ability to test an arbitrary sequence of imports between a given set of virtual source files. This should finally allow us to write simple tests and fix annoying issues inside ASTImporter that cause failures in CSA CTU. This is done by refactoring ASTImporterTest functions and introducing `testImportSequence` facility. As a side effect, `testImport` facility was generalized a bit more. It should now allow import of non-decl AST nodes; however, there is still no test using this ability. As a "test for test", there is also a fix for import anonymous TagDecls referred by typedef. Before this patch, the setting of typedef for anonymous structure was delayed; however, this approach misses the corner case if an enum constant is imported directly. In this patch, typedefs for anonymous declarations are imported right after the anonymous declaration is imported, without any delay. Thanks to Adam Balogh for suggestions included into this patch. Differential Revision: https://reviews.llvm.org/D44079 llvm-svn: 330704
* [GCC] Match a GCC version with a patch suffix without a third version componentMartin Storsjo2018-04-246-3/+18
| | | | | | | | | | | | | | Previously it would only accept a string as a GCC version if it had either two components and no suffix, or three components with an optional suffix. Debian and ubuntu provided mingw compilers have lib/gcc/target entries like "5.3-posix" and "5.3-win32". This doesn't try to make any specific preference between them (other than lexical sorting of the suffix). Differential Revision: https://reviews.llvm.org/D45505 llvm-svn: 330696
* [test] Fix a typo in a test directory name. NFC.Martin Storsjo2018-04-241-0/+0
| | | | llvm-svn: 330695
* Link to AggressiveInstCombine in a few places. Unbreaks build for me.Roman Lebedev2018-04-242-0/+2
| | | | | | | | | | | | /usr/local/bin/ld.lld: error: undefined symbol: llvm::createAggressiveInstCombinerPass() >>> referenced by cc1_main.cpp >>> tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o:(_GLOBAL__sub_I_cc1_main.cpp) And so on The bot coverage is clearly missing. llvm-svn: 330694
* [libclang] Only mark CXCursors for explicit attributes with a typeErik Verbruggen2018-04-242-1/+21
| | | | | | | | | | | | | | | All attributes have a source range associated with it. However, implicit attributes are added by the compiler, and not added because the user wrote something in the input. So no token type should be set to CXCursor_*Attr. The problem was visible when a class gets marked by e.g. MSInheritanceAttr, which has the full CXXRecordDecl's range as its own range. The effect of marking that range as CXCursor_UnexposedAttr was that all cursors for the record decl, including all child decls, would become CXCursor_UnexposedAttr. llvm-svn: 330692
* [AST] Another attempt at fixing the ARM bots.Benjamin Kramer2018-04-241-3/+3
| | | | llvm-svn: 330690
* [AST] Use a bit of trickery to make test pass on platforms where wchar_t is ↵Benjamin Kramer2018-04-241-3/+5
| | | | | | unsigned. llvm-svn: 330689
* [X86] Remove '#ifdef __x86_64__' around mask_set1_epi64 intrinsics.Craig Topper2018-04-244-11/+0
| | | | | | The unmasked versions already didn't have this restrction. I don't think gcc or icc limit these to 64-bit mode so we shouldn't either. llvm-svn: 330681
* Make add_clang_tool() formatting a bit more consistent.Nico Weber2018-04-241-1/+3
| | | | llvm-svn: 330674
* Fix build break due to content moving from Scalar.h to InstCombine.h in LLVMDavid Blaikie2018-04-241-0/+1
| | | | llvm-svn: 330671
* [X86] Move the 32-bit versions of rdfsbase/rdgsbase/wrfsbase/wrgsbase to ↵Craig Topper2018-04-232-6/+4
| | | | | | | | BuiltinsX86_64.def. The 32-bit refers to their input/output type, but the instructions are only available in 64-bit mode. llvm-svn: 330658
* [X86] Move __builtin_ia32_movnti64 andd __builtin_ia32_rdrand64_step to ↵Craig Topper2018-04-232-2/+2
| | | | | | BuiltinsX86_64.def to make them unavailable in 32-bit mode. llvm-svn: 330657
* [AST] strcmp/memcmp always compares unsigned chars.Benjamin Kramer2018-04-232-2/+25
| | | | | | | This makes it return the right result in a couple of edge cases. The wide versions always do the comparison on the underlying wchar_t type. llvm-svn: 330656
* [Docs] Regenerate command line documentation.Craig Topper2018-04-231-0/+14
| | | | llvm-svn: 330654
* [Sema] Add -Wno-self-assign-overloadedRoman Lebedev2018-04-236-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It seems there isn't much enthusiasm for `-wtest` D45685. This is more conservative version, which i had in the very first revision of D44883, but that 'erroneously' got removed because of the review. **Based on some [irc] discussions, it must really be documented that we want all the new diagnostics to have their own flags, to ease rollouts, transitions, etc.** Please do note that i'm only adding `-Wno-self-assign-overloaded`, but not `-Wno-self-assign-field-overloaded`, because i'm honestly not aware of any false-positives from the `-field` variant, but i can just as easily add it if wanted. https://reviews.llvm.org/D44883#1068561 Reviewers: dblaikie, aaron.ballman, thakis, rjmccall, rsmith Reviewed By: dblaikie Subscribers: Quuxplusone, chandlerc, cfe-commits Differential Revision: https://reviews.llvm.org/D45766 llvm-svn: 330651
* [OPENMP] Formatting and code improvement, NFC.Alexey Bataev2018-04-231-88/+93
| | | | llvm-svn: 330634
* Fix typo in comment.Nico Weber2018-04-231-1/+1
| | | | llvm-svn: 330633
* DR727: remove wrong assertion for use of class-scope explicitRichard Smith2018-04-232-5/+28
| | | | | | specialization without -fms-extensions. llvm-svn: 330626
* Improve checks in test/Frontend/ftime-report-template-decl.cppBjorn Pettersson2018-04-231-2/+2
| | | | | | | | | | | | | | | | | Some buildbots seems to have problems with the CHECKs in test/Frontend/ftime-report-template-decl.cpp. I this the problem is that the order in which timers are printed is based on consumed wall time. So there is no guarantee in which order the timers are printed. This patch uses CHECK-DAG instead of CHECK to make the test case less sensitive to the actual time used by the different passes. The (sometimes) failing test cases where introduced in trunk@330571. llvm-svn: 330622
OpenPOWER on IntegriCloud