summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* NFC: Get rid of an unused parameter to CGObjCMac::EmitSelectorAddr.Erik Pilkington2019-12-101-12/+10
|
* Revert "[analyzer] Keep track of escaped locals"Gabor Horvath2019-12-102-25/+3
| | | | | | | | | | | | | | | It was a step in the right direction but it is not clear how can this fit into the checker API at this point. The pre-escape happens in the analyzer core and the checker has no control over it. If the checker is not interestd in a pre-escape it would need to do additional work on each escape to check if the escaped symbol is originated from an "uninteresting" pre-escaped memory region. In order to keep the checker API simple we abandoned this solution for now. We will reland this once we have a better answer for what to do on the checker side. This reverts commit f3a28202ef58551db15818f8f51afd21e0f3e231.
* Remove debugging printf and reformat code.Eric Christopher2019-12-101-4/+2
|
* [OPENMP50]Do not mark the function as used if referenced only in declareAlexey Bataev2019-12-102-4/+16
| | | | | | | | | variant directive. If the function is used only in declare variant directive as a variant function, it should not be marked as used to prevent emission of the target-specific functions. Build the reference in the unevaluated context.
* [c++20] Return type deduction for defaulted three-way comparisons.Richard Smith2019-12-103-47/+113
|
* [OPENMP50]Add if clause in target simd directive.Alexey Bataev2019-12-101-1/+7
| | | | | | 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.
* [Wdocumentation] Use C2x/C++14 deprecated attributeMark de Wever2019-12-101-10/+27
| | | | | | | | | This replaces the non-standard __attribute__((deprecated)) with the standard [[deprecated]] when compiling in C2x/C++14 mode. Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71141
* [Wdocumentation] Properly place deprecated attributeMark de Wever2019-12-101-5/+5
| | | | | | | | | | It is now placed before the function: - allows to replace __attribute__((deprecated)) with [[deprecated]]. - required for trailing returns. Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71140
* [Wdocumentation] Use the command marker.Mark de Wever2019-12-101-3/+2
| | | | | | | | | Use the proper marker for -Wdocumentation-deprecated-sync instead of hard-coded the backslash. Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71139
* Fix bug 44190 - wrong code with #pragma pack(1)Yaxun (Sam) Liu2019-12-101-3/+2
| | | | | | | | | | | https://github.com/llvm/llvm-project/commit/5b330e8d6122c336d81dfd11c864e6c6240a381e caused a regression on s390: https://bugs.llvm.org/show_bug.cgi?id=44190 we need to copy if if either the argument is non-byval or the argument is underaligned. Differential Revision: https://reviews.llvm.org/D71282
* [FPEnv] clang support for constrained FP builtinsKevin P. Neal2019-12-101-34/+147
| | | | | | | | Change the IRBuilder and clang so that constrained FP intrinsics will be emitted for builtins when appropriate. Only non-target-specific builtins are affected in this patch. Differential Revision: https://reviews.llvm.org/D70256
* [OPENMP50]Add if clause in target parallel for simd directive.Alexey Bataev2019-12-101-1/+7
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause is false, the non-vectorized version of the loop must be executed.
* [analyzer] Keep track of escaped localsGabor Horvath2019-12-102-3/+25
| | | | | | | | We want to escape all symbols that are stored into escaped regions. The problem is, we did not know which local regions were escaped. Until now. This should fix some false positives like the one in the tests. Differential Revision: https://reviews.llvm.org/D71152
* [DebugInfo] Support to emit debugInfo for extern variablesYonghong Song2019-12-109-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extern variable usage in BPF is different from traditional pure user space application. Recent discussion in linux bpf mailing list has two use cases where debug info types are required to use extern variables: - extern types are required to have a suitable interface in libbpf (bpf loader) to provide kernel config parameters to bpf programs. https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t - extern types are required so kernel bpf verifier can verify program which uses external functions more precisely. This will make later link with actual external function no need to reverify. https://lore.kernel.org/bpf/87eez4odqp.fsf@toke.dk/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed This patch added clang support to emit debuginfo for extern variables with a TargetInfo hook to enable it. The debuginfo for the extern variable is emitted only if that extern variable is referenced in the current compilation unit. Currently, only BPF target enables to generate debug info for extern variables. The emission of such debuginfo is disabled for C++ at this moment since BPF only supports a subset of C language. Emission with C++ can be enabled later if an appropriate use case is identified. -fstandalone-debug permits us to see more debuginfo with the cost of bloated binary size. This patch did not add emission of extern variable debug info with -fstandalone-debug. This can be re-evaluated if there is a real need. Differential Revision: https://reviews.llvm.org/D70696
* [Alignment][NFC] CreateMemSet use MaybeAlignGuillaume Chatelet2019-12-103-10/+11
| | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: arsenm, jvesely, nhaehnle, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71213
* Only Remove implicit conversion for the target that support fp16Jim Lin2019-12-101-1/+2
| | | | | | Remove implicit conversion that promotes half to double for the target that support fp16. If the target doesn't support fp16, fp16 will be converted to fp16 intrinsic.
* [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.hJohannes Doerfert2019-12-1016-49/+59
| | | | | | | | | | | | | | | | | | | Summary: The new OpenMPConstants.h is a location for all OpenMP related constants (and helpers) to live. This patch moves the directives there (the enum OpenMPDirectiveKind) and rewires Clang to use the new location. Initially part of D69785. Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: jholewinski, ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69853
* Remove implicit conversion that promotes half to other larger precision ↵Jim Lin2019-12-101-1/+15
| | | | | | | | | | | | | | | | | | | | types for fp classification builtins Summary: It shouldn't promote half to double or any larger precision types for fp classification builtins. Because fp classification builtins would get incorrect result with promoted argument. For example, __builtin_isnormal with a subnormal half value should return false, but it is not. That the subnormal half value is promoted to a normal double value. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71049
* [Remarks][Driver] Error on -foptimization-record-file with multiple -arch ↵Francis Visoiu Mistrih2019-12-091-79/+128
| | | | | | | | | options This adds a check for the usage of -foptimization-record-file with multiple -arch options. This is not permitted since it would require us to rename the file requested by the user to avoid overwriting it for the second cc1 invocation.
* [c++20] Fix handling of unqualified lookups from a defaulted comparisonRichard Smith2019-12-097-47/+197
| | | | | | | | | | function. We need to perform unqualified lookups from the context of a defaulted comparison, but not until we implicitly define the function, at which point we can't do those lookups any more. So perform the lookup from the end of the class containing the =default declaration and store the lookup results on the defaulted function until we synthesize the body.
* Revert "[ARM][MVE] Add intrinsics for immediate shifts."Eric Christopher2019-12-091-29/+0
| | | | | | | | | | | | | | and two follow-on commits: one warning fix and one functionality. As it's breaking at least the lto bot: http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15132/steps/test-stage1-compiler/logs/stdio This reverts commits: 8d70f3c933a5b81a87a5ab1af0e3e98ee2cd7c67 ff4dceef9201c5ae3924e92f6955977f243ac71d d97b3e3e65cd77a81b39732af84a1a4229e95091
* Avoid Attr.h includes, CodeGen editionReid Kleckner2019-12-0927-25/+56
| | | | This saves around 20 includes of Attr.h. Not much.
* [c++20] Defaulted comparison support for array members.Richard Smith2019-12-091-10/+131
|
* Also synthesize _cmd and self for propertiesPierre Habouzit2019-12-091-0/+6
| | | | | | Patch by: Pierre Habouzit Differential Revision: https://reviews.llvm.org/D71226
* [Attr] Move ParsedTargetAttr out of the TargetAttr classCraig Topper2019-12-096-16/+14
| | | | | | Need to forward declare it in ASTContext.h for D68627, so it can't be a nested struct. Differential Revision: https://reviews.llvm.org/D71159
* [c++20] Fix incorrect assumptions in checks for comparison category types.Richard Smith2019-12-092-22/+29
| | | | | | In the presence of modules, we can have multiple lookup results for the same entity, and we need to re-check for completeness each time we consider a type.
* [clang][IFS] Allow 2 output files when using -o and -c with clang IFS stubs.Puyan Lotfi2019-12-092-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | This patch allows for -o to be used with -c when compiling with clang interface stubs enabled. This is because the second file will be an intermediate ifs stubs file that is the text stub analog of the .o file. Both get produces in this case, so two files. Why are we doing this? Because we want to support the case where interface stubs are used bu first invoking clang like so: clang -c <other flags> -emit-interface-stubs foo.c -o foo.o ... clang -emit-interface-stubs <.o files> -o libfoo.so This should generate N .ifs files, and one .ifso file. Prior to this patch, using -o with the -c invocation was not possible. Currently the clang driver supports generating a a.out/.so file at the same time as a merged ifs file / ifso file, but this is done by checking that the final job is the IfsMerge job. When -c is used, the final job is a Compile job so what this patch does is check to figure out of the job type is TY_IFS_CPP. Differential Revision: https://reviews.llvm.org/D70763
* Fix clang -Wcovered-switch-default after llvmorg-10-init-11484-g6626e5a06a9Fangrui Song2019-12-091-2/+2
| | | | | We need to place llvm_unreachable after switch to work around the GCC warning.
* Reland 198fbcb8, "Driver: Don't look for libc++ headers in the install ↵Peter Collingbourne2019-12-091-11/+16
| | | | | | | | | | | | | | | | | | | | | | directory on Android.", which was reverted in b3249027. Fixed the test case to set --sysroot, which lets it succeed in the case where a directory named "/usr/include/c++/v1" or "/usr/local/include/c++/v1" exists. Original commit message: > 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
* Fix the compiler warnings: "-Winconsistent-missing-override", ↵Haojian Wu2019-12-091-2/+2
| | | | | | "-Wunused-variable" for d97b3e3e65cd77a81b39732af84a1a4229e95091
* [ARM][MVE] Add intrinsics for immediate shifts.Simon Tatham2019-12-091-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds the family of `vshlq_n` and `vshrq_n` ACLE intrinsics, which shift every lane of a vector left or right by a compile-time immediate. They mostly work by expanding to the IR `shl`, `lshr` and `ashr` operations, with their second operand being a vector splat of the immediate. There's a fiddly special case, though. ACLE specifies that the immediate in `vshrq_n` can take values up to //and including// the bit size of the vector lane. But LLVM IR thinks that shifting right by the full size of the lane is UB, and feels free to replace the `lshr` with an `undef` half way through the optimization pipeline. Hence, to keep this legal in source code, I have to detect it at codegen time. Logical (unsigned) right shifts by the element size are handled by simply emitting the zero vector; arithmetic ones are converted into a shift of one bit less, which will always give the same output. In order to do that check, I also had to enhance the tablegen MveEmitter so that it can cope with converting a builtin function's operand into a bare integer to pass to a code-generating subfunction. Previously the only bare integers it knew how to handle were flags generated from within `arm_mve.td`. Reviewers: dmgreen, miyuki, MarkMurrayARM, ostannard Reviewed By: MarkMurrayARM Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71065
* Fix compilation warning from GCC7. NFC.Michael Liao2019-12-091-0/+2
|
* [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
* [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-091-0/+7
| | | | | | | | | | | | 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
* [c++20] Synthesis of defaulted comparison functions.Richard Smith2019-12-085-27/+499
| | | | | | 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.
* [Frontend] Allow OpenMP offloading to aarch64Bryan Chan2019-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | 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
* Revert "Driver: Don't look for libc++ headers in the install directory on ↵David Zarzycki2019-12-081-16/+11
| | | | | | | | Android." This reverts commit 198fbcb817492ff45946e3f7517de15e8cdf0607. This breaks Fedora 31.
* [OpenMP] Require trivially copyable type for mappingJonas Hahnfeld2019-12-071-1/+1
| | | | | | | | | | | | | 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-061-11/+16
| | | | | | | | | | | | | | | | 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-063-148/+557
| | | | constexpr.
* Revert "[Sema][X86] Consider target attribute into the checks in ↵Reid Kleckner2019-12-067-98/+82
| | | | | | | | | 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-067-82/+98
| | | | | | | | | | | | | | | | 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-0618-16/+44
| | | | | | | 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-063-31/+87
| | | | | | | | | | | | | | | | 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
* [ObjC] Make sure that the implicit arguments for direct methods have been setupAlex Lorenz2019-12-066-22/+10
| | | | | | | | | | | | | | | | | | | | 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-061-1/+2
| | | | | | 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-063-15/+27
| | | | | | 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-061-6/+3
| | | | | 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-071-0/+2
| | | | Enabling optimization should allow frame pointer elimination.
OpenPOWER on IntegriCloud