summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix compilation warning from GCC7. NFC.Michael Liao2019-12-091-0/+2
|
* Fix build bot fails due to the patch here:Zahira Ammarguellat2019-12-091-0/+1
| | | | | https://reviews.llvm.org/D70691 Fixed the LIT test case. Added the REQUIRES instruction.
* [Parser] Don't crash on MS assembly if target desc/asm parser isn't linked in.Sam McCall2019-12-091-4/+24
| | | | | | | | | | | | | | | | | | Summary: Instead, emit a diagnostic and return an empty ASM node, as we do if the target is missing. Filter this diagnostic out in clangd, where it's not meaningful. Fixes https://github.com/clangd/clangd/issues/222 Reviewers: kadircet Subscribers: mgorny, ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71189
* [Attr] Add missing header for clang example.David Green2019-12-091-0/+1
| | | | The examples are easy to miss.
* [ARM][MVE] Add complex vector intrinsicsMikhail Maltsev2019-12-095-0/+1704
| | | | | | | | | | | | | | | | | | | | Summary: This patch adds intrinsics for the following MVE instructions: * VCADD, VHCADD * VCMUL * VCMLA Each of the above 3 groups has a corresponding new LLVM IR intrinsic. Reviewers: simon_tatham, MarkMurrayARM, ostannard, dmgreen Reviewed By: MarkMurrayARM Subscribers: merge_guards_bot, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71190
* [clang][Tooling] Fix potential UB in ExpandResponseFilesCompilationDatabaseSam McCall2019-12-091-1/+3
| | | | | | | | | | | | | | | | | Summary: `vector::assign` will cause UB at here. fixes: https://github.com/clangd/clangd/issues/223 Reviewers: kadircet, sammccall, hokein Reviewed By: sammccall Subscribers: merge_guards_bot, ilya-biryukov, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71172
* [OpenCL] Handle address space conversions for constexpr (PR44177)Sven van Haastregt2019-12-093-5/+35
| | | | | | | | | | | | The AST for the constexpr.cl test contains address space conversion nodes to cast through the implicit generic address space. These caused the evaluator to reject the input as constexpr in C++ for OpenCL mode, whereas the input was considered constexpr in plain C++ mode as the AST won't have address space cast nodes then. Fixes PR44177. Differential Revision: https://reviews.llvm.org/D71015
* Reland "[AST] Traverse the class type loc inside the member type loc.""Haojian Wu2019-12-093-2/+60
| | | | | | | | | | | | Summary: added a unittest which causes "TL.getClassTInfo" is null. Reviewers: ilya-biryukov Subscribers: mgorny, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71186
* [c++20] Synthesis of defaulted comparison functions.Richard Smith2019-12-0816-59/+743
| | | | | | Array members are not yet handled. In addition, defaulted comparisons can't yet find comparison operators by unqualified lookup (only by member lookup and ADL). These issues will be fixed in follow-on changes.
* Fix for build bot failure. For more details see:Zahira Ammarguellat2019-12-091-5/+5
| | | | | https://reviews.llvm.org/D70691 Upated LIT test.
* [Frontend] Allow OpenMP offloading to aarch64Bryan Chan2019-12-082-2/+4
| | | | | | | | | | | | | | | | | | | | | Summary: D30644 added OpenMP offloading to AArch64 targets, then D32035 changed the frontend to throw an error when offloading is requested for an unsupported target architecture. However the latter did not include AArch64 in the list of supported architectures, causing the following unit tests to fail: libomptarget :: api/omp_get_num_devices.c libomptarget :: mapping/pr38704.c libomptarget :: offloading/offloading_success.c libomptarget :: offloading/offloading_success.cpp Reviewers: pawosm01, gtbercea, jdoerfert, ABataev Subscribers: kristof.beyls, guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70804
* Fix typo in the AST Matcher Reference doc Closes: #54Sylvestre Ledru2019-12-082-2/+2
|
* Revert "Driver: Don't look for libc++ headers in the install directory on ↵David Zarzycki2019-12-083-29/+16
| | | | | | | | Android." This reverts commit 198fbcb817492ff45946e3f7517de15e8cdf0607. This breaks Fedora 31.
* [OpenMP] Require trivially copyable type for mappingJonas Hahnfeld2019-12-0731-161/+161
| | | | | | | | | | | | | A trivially copyable type provides a trivial copy constructor and a trivial copy assignment operator. This is enough for the runtime to memcpy the data to the device. Additionally there must be no virtual functions or virtual base classes and the destructor is guaranteed to be trivial, ie performs no action. The runtime does not require trivial default constructors because on alloc the memory is undefined. Thus, weaken the warning to be only issued if the mapped type is not trivially copyable. Differential Revision: https://reviews.llvm.org/D71134
* Driver: Don't look for libc++ headers in the install directory on Android.Peter Collingbourne2019-12-063-16/+29
| | | | | | | | | | | | | | | | The NDK uses a separate set of libc++ headers in the sysroot. Any headers in the installation directory are not going to work on Android, not least because they use a different name for the inline namespace (std::__1 instead of std::__ndk1). This effectively makes it impossible to produce a single toolchain that is capable of targeting both Android and another platform that expects libc++ headers to be installed in the installation directory, such as Mac. In order to allow this scenario to work, stop looking for headers in the install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* [c++20] Determine whether a defaulted comparison should be deleted orRichard Smith2019-12-0616-218/+1126
| | | | constexpr.
* Add matchDynamic convenience functionsStephen Kelly2019-12-072-0/+51
| | | | | | | | | | Summary: These correspond to the existing match() free functions. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54406
* Revert "[Sema][X86] Consider target attribute into the checks in ↵Reid Kleckner2019-12-0610-145/+84
| | | | | | | | | validateOutputSize and validateInputSize." This reverts commit e1578fd2b79fe5af5f80c0c166a8abd0f816c022. It introduces a dependency on Attr.h which I am removing from ASTContext.h.
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-0610-84/+145
| | | | | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch copies some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Probably need some refactoring here to share more code with Codegen. Is there a good place to do that? Also need to support the cpu_specific attribute as well. Differential Revision: https://reviews.llvm.org/D68627
* Remove Expr.h include from ASTContext.h, NFCReid Kleckner2019-12-0624-49/+66
| | | | | | | ASTContext.h is popular, prune its includes. Expr.h brings in Attr.h, which is also expensive. Move BlockVarCopyInit to Expr.h to accomplish this.
* Make it possible control matcher traversal kind with ASTContextStephen Kelly2019-12-068-37/+278
| | | | | | | | | | | | | | | | Summary: This will eventually allow traversal of an AST while ignoring invisible AST nodes. Currently it depends on the available enum values for TraversalKinds. That can be extended to ignore all invisible nodes in the future. Reviewers: klimek, aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61837
* [WebAssebmly][MC] Support .import_name/.import_field asm directivesSam Clegg2019-12-061-4/+4
| | | | | | | | Convert the MC test to use asm rather than bitcode. This is a precursor to https://reviews.llvm.org/D70520. Differential Revision: https://reviews.llvm.org/D70877
* [ObjC] Make sure that the implicit arguments for direct methods have been setupAlex Lorenz2019-12-067-22/+27
| | | | | | | | | | | | | | | | | | | | This commit sets the Self and Imp declarations for ObjC method declarations, in addition to the definitions. It also fixes a bunch of code in clang that had wrong assumptions about when getSelfDecl() would be set: - CGDebugInfo::getObjCMethodName and AnalysisConsumer::getFunctionName would assume that it was set for method declarations part of a protocol, which they never were, and that self would be a Class type, which it isn't as it is id for a protocol. Also use the Canonical Decl to index the set of Direct methods so that when calls and implementations interleave, the same llvm::Function is used and the same symbol name emitted. Radar-Id: rdar://problem/57661767 Patch by: Pierre Habouzit Differential Revision: https://reviews.llvm.org/D71091
* [analyzer] Fix false positive on introspection of a block's internal layout.Artem Dergachev2019-12-062-1/+11
| | | | | | When implementation of the block runtime is available, we should not warn that block layout fields are uninitialized simply because they're on the stack.
* [OPENMP50]Add if clause in distribute simd directive.Alexey Bataev2019-12-067-32/+240
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* Stop checking whether std::strong_* has ::equivalent members.Richard Smith2019-12-062-9/+6
| | | | | Any attempt to use these would be a bug, so we shouldn't even look for them.
* clang/AMDGPU: Fix default for frame-pointer attributeMatt Arsenault2019-12-072-0/+10
| | | | Enabling optimization should allow frame pointer elimination.
* [OPENMP]Reorganize OpenMP warning groups.Alexey Bataev2019-12-066-40/+50
| | | | | openmp-mapping group is a subgroup of openmp-target warning group. Also, added global openmp group to control all other OpenMP warning groups.
* Add `QualType::hasAddressSpace`. NFC.Michael Liao2019-12-067-12/+19
| | | | | - Add that as a shorthand of <T>.getQualifiers().hasAddressSpace(). - Simplify related code.
* [ASTImporter] Implicitly declare parameters for imported ObjCMethodDeclsRaphael Isemann2019-12-063-1/+35
| | | | | | | | | | | | | | | | | | | | Summary: When Sema encounters a ObjCMethodDecl definition it declares the implicit parameters for the ObjCMethodDecl. When importing such a method with the ASTImporter we need to do the same for the imported method otherwise we will crash when generating code (where CodeGen expects that this was called by Sema). Note I had to implement Objective-C[++] support in Language.cpp as this is the first test for Objective-C and this would otherwise just hit this 'not implemented' assert when running the unit test. Reviewers: martong, a.sidorin, shafik Reviewed By: martong Subscribers: rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71112
* update string comparison in clang-format.pymydeveloperday2019-12-061-1/+1
| | | | | | | | | | | | | | Summary: Python 3.8 introduces a SyntaxWarning about string comparisons with 'is'. This commit updates the string comparison in clang-format.py that is done with 'is not' to '!='. This should not break compatibility with older python versions (tested 3.4.9, 2.7.17, 2.7.5, 3.8.0). Reviewers: MyDeveloperDay, klimek, llvm-commits, cfe-commits Reviewed By: MyDeveloperDay, klimek Patch By: pseyfert Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D70664
* [clang-format] update trailing newline treatment in clang-format.pymydeveloperday2019-12-061-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current clang-format.py does not handle trailing newlines at the end of a file correctly. Trailing empty lines get removed except one. As far as I understand this is because clang-format gets fed from stdin and writes to stdout when called from clang-format.py. In a "normal" file (with no trailing empty lines) the string that gets passed to clang-format does not contain a trailing '\n' after the '\n'.join from python. The clang-format binary does not add a trailing newline to input from stdin, but (if there are multiple trailing '\n', all except one get removed). When reading back this means that we see in python from a "normal" file a string with no trailing '\n'. From a file with (potentially multiple) empty line(s) at the end, we get a string with one trailing '\n' back in python. In the former case all is fine, in the latter case split('\n') makes one empty line at the end of the file out of the clang-format output. Desired would be instead that the **file** ends with a newline, but not with an empty line. For the case that a user specifies a range to format (and wants to keep trailing empty lines) I did **not** try to fix this by simply removing all trailing newlines from the clang-format output. Instead, I add a '\n' to the unformatted file content (i.e. newline-terminate what is passed to clang-format) and then strip off the last newline from the output (which itself is now for sure the newline termination of the clang-format output). (Should this get approved, I'll need someone to help me land this.) Reviewers: klimek, MyDeveloperDay Reviewed By: MyDeveloperDay Patch By: pseyfert Subscribers: cfe-commits, llvm-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D70864 update trailing newline treatment in clang-format.py
* [OPENMP]Moved warning fo mapping non-trivially copiable types into aAlexey Bataev2019-12-0677-549/+549
| | | | | | | separate group. Need to move this warning into a separate group to make easier to disable this warning, if required.
* Fix for PR44000. Optimization record for bytecode input missing.Zahira Ammarguellat2019-12-062-25/+65
| | | | Review is here: https://reviews.llvm.org/D70691
* Fix crash if a user-defined conversion is applied in the middle of aRichard Smith2019-12-054-1/+27
| | | | rewrite of an operator in terms of operator<=>.
* Tighten up CHECK lines added in a9f10ebffa to work on ARM.Douglas Yung2019-12-051-1/+1
| | | | On ARM platforms, the compiler generates an additional line containing `-CXXRecordDecl which is not the intended line, but preceeds the intended match causing the test to fail.
* Revert "[AST] Traverse the class type loc inside the member type loc."Sterling Augustine2019-12-053-51/+2
| | | | | | | This reverts commit 7f93cb62280a73e3e899d49c45be8bfbac634b7d. The assertion at RecursiveASTVisitor.h:1169 fails when passed a TypeLocNode. Not sure if the correct fix is to use getTypeLocClass or something else.
* Handle two corner cases in creduce-clang-crash.pyReid Kleckner2019-12-051-0/+3
| | | | | | | | | | | | | | | | | | Summary: First, call os.path.normpath on the filename argument. I passed in ./foo-asdf.cpp, and this meant that the script failed to find the filename, and bad things happened. Second, call os.path.abspath on binaries. CReduce runs the interestingness test in a temp dir, so relative paths will not work. Reviewers: akhuang Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71098
* [Concepts] Fix build failures in D41569Saar Raz2019-12-061-2/+2
| | | | Fix build failures in previous commit.
* [Concepts] Constraint Enforcement & DiagnosticsSaar Raz2019-12-0623-133/+1060
| | | | | | | | | Part of the C++20 concepts implementation effort. - Associated constraints (requires clauses, currently) are now enforced when instantiating/specializing templates and when considering partial specializations and function overloads. - Elaborated diagnostics give helpful insight as to why the constraints were not satisfied. Phabricator: D41569 Re-commit, after fixing some memory bugs.
* Properly convert all declaration non-type template arguments whenRichard Smith2019-12-054-94/+118
| | | | | | | | | | | | forming non-type template parameter values. This reverts commit 93cc9dddd82f9e971f382ade6acf6634c5914966, which reverted commit 11d10527852b4d3ed738aa90d8bec0f398160593. We now always form `&x` when forming a pointer to a function rather than trying to use function-to-pointer decay. This matches the behavior of the old code in this case, but not the intent as described by the comments.
* Debug Info: Apply a default location for cleanups if none is available.Adrian Prantl2019-12-052-1/+5
| | | | | | | | | This unbreaks the debuginfo-tests testsuite by replacing the assertion with a default location. There are cleanups in helper functions that don't have a valid source location such as block copy helpers and it's not worth tracking each of them down. rdar://57630879
* Debug Info: Assert that location is available for cleanupsAdrian Prantl2019-12-054-4/+32
| | | | | | rdar://57630879 Differential Revision: https://reviews.llvm.org/D71042
* Set a source location for Objective-C accessor stubsAdrian Prantl2019-12-052-4/+29
| | | | | | | | | | | | even when there is no explicit synthesize statement. This fixes a regression introduced in https://reviews.llvm.org/D68108 that could lead to missing debug locations in cleanup code in synthesized Objective-C++ properties. rdar://57630879 Differential Revision: https://reviews.llvm.org/D71084
* Add documentation headings for the OpenCL attributes.Aaron Ballman2019-12-051-0/+5
| | | | This fixes the documentation build.
* [OpenMP50] Add parallel master constructcchen2019-12-0537-18/+2984
| | | | | | | | | | | | Reviewers: ABataev, jdoerfert Reviewed By: ABataev Subscribers: rnk, jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem Tags: #clang Differential Revision: https://reviews.llvm.org/D70726
* [OPENMP50]Add support for if clause for simd part in distribute parallel for ↵Alexey Bataev2019-12-053-9/+39
| | | | | | | simd directive. According to OpenMP 5.0, the if clause can be applied to simd subdirective in the combined directives.
* [scan-build-py] Set of small fixesGabor Horvath2019-12-052-8/+26
| | | | | | | * Unhandled exceptions * Typos Differential Revision: https://reviews.llvm.org/D70693
* [ASTImporter] Various source location and range import fixes.Balázs Kéri2019-12-057-20/+64
| | | | | | | | | | | | | | | | | | | | Summary: ASTImporter contained wrong or missing imports of SourceLocation and SourceRange for some objects. At least a part of such errors is fixed now. Source location import fixes in namespace, enum, record, class template specialization declarations and DeclRefExpr, UnresolvedLookupExpr, UnresolvedMemberExpr, NestedNameSpecifierLoc. Reviewers: martong, a.sidorin, shafik Reviewed By: shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60499
* [OPENMP50]Add support for if clause for simd part in parallel master ↵Alexey Bataev2019-12-053-13/+48
| | | | | | | taskloop simd directive. According to OpenMP 5.0, the if clause can be applied to simd subdirective in the combined directives.
OpenPOWER on IntegriCloud