summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "PR17164: Change clang's default behavior from ↵Mitch Phillips2020-01-2310-40/+23
| | | | | | | | | | | | -flax-vector-conversions=all to -flax-vector-conversions=integer." This patch broke the Sanitizer buildbots. Please see the commit's differential revision for more information (https://reviews.llvm.org/D67678). This reverts commit b72a8c65e4e34779b6bc9e466203f553f5294486. (cherry picked from commit edd4398f4cd33a305afbca76ac4e6590e9337f4d)
* [Sema] Avoid Wrange-loop-analysis false positivesMark de Wever2020-01-232-0/+78
| | | | | | | | | | | | | | | | When Wrange-loop-analysis issues a diagnostic on a dependent type in a template the diagnostic may not be valid for all instantiations. Therefore the diagnostic is suppressed during the instantiation. Non dependent types still issue a diagnostic. The same can happen when using macros. Therefore the diagnostic is disabled for macros. Fixes https://bugs.llvm.org/show_bug.cgi?id=44556 Differential Revision: https://reviews.llvm.org/D73007 (cherry picked from commit 41fcd17250fa0526e4b7fd2c7df7721b0f79b683)
* Clang] Fix expansion of response files in -Wp after integrated-cc1 changeAlexandre Ganea2020-01-233-10/+24
| | | | | | | | | | After rGb4a99a061f517e60985667e39519f60186cbb469, passing a response file such as -Wp,@a.rsp wasn't working anymore because .rsp expansion happens inside clang's main() function. This patch adds response file expansion in the -cc1 tool. Differential Revision: https://reviews.llvm.org/D73120 (cherry picked from commit 68d7f06092e56b17eb0cddf560a9d9fe8afb7dd8)
* Revert "[cmake] Fix clang builds with BUILD_SHARED=ON and ↵Tom Stellard2020-01-231-9/+1
| | | | | | | | | | | CLANG_LINK_CLANG_DYLIB=ON" This reverts commit df839cfda09dbadc26b8be635f27da75f1f27190. This change used cmake's list filter operation which was not added until cmake 3.6. (cherry picked from commit 4751e4f8c24bc07fdb668dc49ee559b97c1e3c22)
* [cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ONTom Stellard2020-01-231-1/+9
| | | | | | | | | | | | | | | | | | | Summary: We were linking all the clang objects and shared libraries into libclang-cpp.so, which was causing the command line options to be registered twice. Reviewers: beanz, mgorny Reviewed By: beanz, mgorny Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68520 (cherry picked from commit df839cfda09dbadc26b8be635f27da75f1f27190)
* [PATCH] Reland [Clang] Un-break scan-build after integrated-cc1 changeAlexandre Ganea2020-01-226-9/+10
| | | | | | | | | | | | The issue was reported by @xazax.hun here: https://reviews.llvm.org/D69825#1827826 "This patch (D69825) breaks scan-build-py which parses the output of "-###" to get -cc1 command. There might be other tools with the same problems. Could we either remove (in-process) from CC1Command::Print or add a line break? Having the last line as a valid invocation is valuable and there might be tools relying on that." Differential Revision: https://reviews.llvm.org/D72982 (cherry picked from commit 133a7e631cee97965e310f0d110739217427fd3d)
* [HIP] use GetProgramPath for executable discoveryHolger Wünsche2020-01-221-15/+8
| | | | | | | | | | | This change replaces the manual building of executable paths using llvm::sys::path::append with GetProgramPath. This enables adding other paths in case executables reside in different directories and makes the code easier to read. Differential Revision: https://reviews.llvm.org/D72903 (cherry picked from commit 24d7a0935bea390fc444f6ac8cf02447fe8d6917)
* [clang-format] Expand the SpacesAroundConditions option to include catch ↵mydeveloperday2020-01-212-1/+2
| | | | | | | | | | | | | | statements Summary: This diff expands the SpacesAroundConditions option added in D68346 to include adding spaces to catch statements. Reviewed By: MyDeveloperDay Patch by: timwoj Differential Revision: https://reviews.llvm.org/D72793 (cherry picked from commit ea2be452542c81b04621e26c0d5e83be565f07e2)
* Revert 9007f06af0e "Revert "Allow system header to provide their own ↵Hans Wennborg2020-01-176-1/+58
| | | | | | | implementation of some builtin"" This should no longer be necessary after cd4c65f91d5 "Add __warn_memset_zero_len builtin as a workaround for glibc issue"
* Revert "Allow system header to provide their own implementation of some builtin"Amy Huang2020-01-176-58/+1
| | | | | | | | | This reverts commit 921f871ac438175ca8fcfcafdfcfac4d7ddf3905 because it causes libc++ code to trigger __warn_memset_zero_len. See https://reviews.llvm.org/D71082. (cherry picked from commit 3d210ed3d1880c615776b07d1916edb400c245a6)
* Revert "[OPENMP]Do not use RTTI by default for NVPTX devices."Alexey Bataev2020-01-172-22/+1
| | | | | | | This reverts commit 23058f9dd4d7e18239fd63b6da52549514b45fda. It breaks builds of cuda code somehow in some cases. (cherry picked from commit 6b29aa21180cf14bfb619d38fc4826913cabfb66)
* Add __warn_memset_zero_len builtin as a workaround for glibc issueserge-sans-paille2020-01-173-0/+12
| | | | | | | | | Glibc issue: https://sourceware.org/bugzilla/show_bug.cgi?id=25399 The fix consist in considering the missing function as a builtin lowered to a nop. Differential Revision: https://reviews.llvm.org/D72869 (cherry picked from commit d293417931d3a9d46799b42795988ca3b5cfd766)
* Add extra test file forgotten in 45d7080.Richard Smith2020-01-171-0/+62
| | | | (cherry picked from commit b78e8e0d79c47a6698a0abc10a37b8a253cb6064)
* PR42694 Support explicit(bool) in older language modes as an extension.Richard Smith2020-01-176-16/+91
| | | | | | | | This needs somewhat careful disambiguation, as C++2a explicit(bool) is a breaking change. We only enable it in cases where the source construct could not possibly be anything else. (cherry picked from commit 45d70806f4386adfb62b0d75949a8aad58e0576f)
* Fix pack deduction to only deduce the arity of packs that are actuallyRichard Smith2020-01-172-20/+48
| | | | | | | | | | expanded by the deduced pack. We recently started also deducing the arity of separately-expanded packs that are merely mentioned within the pack in question, which is incorrect. (cherry picked from commit e8f198dd9e9dabed8d50276465906e7c8827cada)
* PR17164: Change clang's default behavior from -flax-vector-conversions=all ↵Richard Smith2020-01-1711-23/+64
| | | | | | | | | | | | | | | | | | to -flax-vector-conversions=integer. Summary: See proposal on cfe-dev: http://lists.llvm.org/pipermail/cfe-dev/2019-April/062030.html Reviewers: SjoerdMeijer, eli.friedman Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67678 (cherry picked from commit b72a8c65e4e34779b6bc9e466203f553f5294486)
* Work around PR43337: don't try to use the vec_sel overloads for vector long ↵Richard Smith2020-01-171-2/+2
| | | | | | long, since clang's <altivec.h> doesn't provide it yet! (cherry picked from commit 388eaa1270c2762d61b756759b6db8cf15bd3a83)
* Replace CLANG_SPAWN_CC1 env var with a driver mode flagNico Weber2020-01-165-28/+62
| | | | | | | | | | | | | | | | | | Flags are clang's default UI is flags. We can have an env var in addition to that, but in D69825 nobody has yet mentioned why this needs an env var, so omit it for now. If someone needs to set the flag via env var, the existing CCC_OVERRIDE_OPTIONS mechanism works for it (set CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1 for example). Also mention the cc1-in-process change in the release notes. Also spruce up the test a bit so it actually tests something :) Differential Revision: https://reviews.llvm.org/D72769 (cherry picked from commit 8e5018e990b701391e6c33ba85b012343df67272)
* Fix Wdocumentation warning. NFC.Simon Pilgrim2020-01-151-2/+0
|
* [Lexer] Allow UCN for dollar symbol '\u0024' in identifiers when using ↵Scott Egerton2020-01-152-2/+3
| | | | | | | | | | | | | | | | | | | | -fdollars-in-identifiers flag. Summary: Previously, the -fdollars-in-identifiers flag allows the '$' symbol to be used in an identifier but the universal character name equivalent '\u0024' is not allowed. This patch changes this, so that \u0024 is valid in identifiers. Reviewers: rsmith, jordan_rose Reviewed By: rsmith Subscribers: dexonsmith, simoncook, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71758
* Revert "[RISCV] Add Clang frontend support for Bitmanip extension"Scott Egerton2020-01-154-19/+1
| | | | This reverts commit 57cf6ee9c84434161088c39a6f8dd2aae14eb12d.
* Fix up ms-pch-macro.c test to pass on non-WindowsReid Kleckner2020-01-141-5/+5
|
* [Driver][X86] Add -malign-branch* and -mbranches-within-32B-boundariesFangrui Song2020-01-145-2/+114
| | | | | | | | These driver options perform some checking and delegate to MC options -x86-align-branch* and -x86-branches-within-32B-boundaries. Reviewed By: skan Differential Revision: https://reviews.llvm.org/D72463
* [ODRHash] Fix wrong error message with bitfields and mutable.Weverything2020-01-142-9/+33
| | | | | Add a check to bitfield mismatches that may have caused Clang to give an error about the bitfield instead of being mutable.
* Relax the rules around objc_alloc and objc_alloc_init optimizations.Pierre Habouzit2020-01-142-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today the optimization is limited to: - `[ClassName alloc]` - `[self alloc]` when within a class method However it means that when code is written this way: ``` @interface MyObject - (id)copyWithZone:(NSZone *)zone { return [[self.class alloc] _initWith...]; } @end ``` ... then the optimization doesn't kick in and `+[NSObject alloc]` ends up in IMP caches where it could have been avoided. It turns out that `+alloc` -> `+[NSObject alloc]` is the most cached SEL/IMP pair in the entire platform which is rather silly). There's two theoretical risks allowing this optimization: 1. if the receiver is nil (which it can't be today), but it turns out that `objc_alloc()`/`objc_alloc_init()` cope with a nil receiver, 2. if the `Clas` type for the receiver is a lie. However, for such a code to work today (and not fail witn an unrecognized selector anyway) you'd have to have implemented the `-alloc` **instance method**. Fortunately, `objc_alloc()` doesn't assume that the receiver is a Class, it basically starts with a test that is similar to `if (receiver->isa->bits & hasDefaultAWZ) { /* fastpath */ }`. This bit is only set on metaclasses by the runtime, so if an instance is passed to this function by accident, its isa will fail this test, and `objc_alloc()` will gracefully fallback to `objc_msgSend()`. The one thing `objc_alloc()` doesn't support is tagged pointer instances. None of the tagged pointer classes implement an instance method called `'alloc'` (actually there's a single class in the entire Apple codebase that has such a method). Differential Revision: https://reviews.llvm.org/D71682 Radar-Id: rdar://problem/58058316 Reviewed-By: Akira Hatanaka Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
* PR44540: Prefer an inherited default constructor over an initializerRichard Smith2020-01-143-39/+59
| | | | | | | | | list constructor when initializing from {}. We would previously pick between calling an initializer list constructor and calling a default constructor unstably in this situation, depending on whether the inherited default constructor had already been used elsewhere in the program.
* Modify test to use -S instead of -c so that it works when an external ↵Douglas Yung2020-01-141-4/+4
| | | | assembler is used that is not present.
* [Concepts] Type ConstraintsSaar Raz2020-01-1540-315/+1566
| | | | | | | Add support for type-constraints in template type parameters. Also add support for template type parameters as pack expansions (where the type constraint can now contain an unexpanded parameter pack). Differential Revision: https://reviews.llvm.org/D44352
* [X86] ABI compat bugfix for MSVC vectorcallReid Kleckner2020-01-143-81/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, X86_32ABIInfo::classifyArgument would be called twice on vector arguments to vectorcall functions. This function has side effects to track GPR register usage, and this would lead to incorrect GPR usage in some cases. The specific case I noticed is from running out of XMM registers with mixed FP and vector arguments and no aggregates of any kind. Consider this prototype: void __vectorcall vectorcall_indirect_vec( double xmm0, double xmm1, double xmm2, double xmm3, double xmm4, __m128 xmm5, __m128 ecx, int edx, __m128 mem); classifyArgument has no effects when called on a plain FP type, but when called on a vector type, it modifies FreeRegs to model GPR consumption. However, this should not happen during the vector call first pass. I refactored the code to unify vectorcall HVA logic with regcall HVA logic. The conventions pass HVAs in registers differently (expanded vs. not expanded), but if they do not fit in registers, they both pass them indirectly by address. Reviewers: erichkeane, craig.topper Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72110
* Allow /D flags absent during PCH creation under msvc-compatZachary Henkel2020-01-142-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch adding a new /D flag when compiling a source file that consumed a PCH with clang-cl would issue a diagnostic and then fail. With the patch, the diagnostic is still issued but the definition is accepted. This matches the msvc behavior. The fuzzy-pch-msvc.c is a clone of the existing fuzzy-pch.c tests with some msvc specific rework. msvc diagnostic: warning C4605: '/DBAR=int' specified on current command line, but was not specified when precompiled header was built Output of the CHECK-BAR test prior to the code change: <built-in>(1,9): warning: definition of macro 'BAR' does not match definition in precompiled header [-Wclang-cl-pch] #define BAR int ^ D:\repos\llvm\llvm-project\clang\test\PCH\fuzzy-pch-msvc.c(12,1): error: unknown type name 'BAR' BAR bar = 17; ^ D:\repos\llvm\llvm-project\clang\test\PCH\fuzzy-pch-msvc.c(23,4): error: BAR was not defined # error BAR was not defined ^ 1 warning and 2 errors generated. Reviewers: rnk, thakis, hans, zturner Subscribers: mikerice, aganea, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72405
* Fix windows bot failures in c410adb092c9cb51ddb0b55862b70f2aa8c5b16fRong Xu2020-01-141-1/+1
| | | | (clang diagnostic handler for IR input files)
* [remark][diagnostics] Using clang diagnostic handler for IR input filesRong Xu2020-01-145-18/+132
| | | | | | | | | | | | | | | | | | | | | | | | For IR input files, we currently use LLVM diagnostic handler even the compilation is from clang. As a result, we are not able to use -Rpass to get the transformation reports. Some warnings are not handled properly either: We found many mysterious warnings in our ThinLTO backend compilations in SamplePGO and CSPGO. An example of the warning: "warning: net/proto2/public/metadata_lite.h:51:21: 0.02% (1 / 4999)" This turns out to be a warning by Wmisexpect, which is supposed to be filtered out by default. But since the filter is in clang's diagnostic hander, we emit these incomplete warnings from LLVM's diagnostic handler. This patch uses clang diagnostic handler for IR input files. We create a fake backendconsumer just to install the diagnostic handler. With this change, we will have proper handling of all the warnings and we can use -Rpass* options in IR input files compilation. Also note that with is patch, LLVM's diagnostic options, like "-mllvm -pass-remarks=*", are no longer be able to get optimization remarks. Differential Revision: https://reviews.llvm.org/D72523
* [OPENMP]Do not use RTTI by default for NVPTX devices.Alexey Bataev2020-01-142-1/+22
| | | | NVPTX does not support RTTI, so disable it by default.
* make -fmodules-codegen and -fmodules-debuginfo work also with PCHsLuboš Luňák2020-01-156-11/+60
| | | | | | | | | | Allow to build PCH's (with -building-pch-with-obj and the extra .o file) with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code into the extra .o file, similarly to how it works with modules. A bit of a misnomer, but the underlying functionality is the same. This saves up to 20% of build time here. Differential Revision: https://reviews.llvm.org/D69778
* fix recent -fmodules-codegen fix testLuboš Luňák2020-01-143-2/+2
|
* -fmodules-codegen should not emit extern templatesLuboš Luňák2020-01-144-2/+25
| | | | | | | | | | | | If a header contains 'extern template', then the template should be provided somewhere by an explicit instantiation, so it is not necessary to generate a copy. Worse, this can lead to an unresolved symbol, because the codegen's object file will not actually contain functions from such a template because of the GVA_AvailableExternally, but the object file for the explicit instantiation will not contain them either because it will be blocked by the information provided by the module. Differential Revision: https://reviews.llvm.org/D69779
* [OPENMP]Do not emit special virtual function for NVPTX target.Alexey Bataev2020-01-142-1/+40
| | | | | | There are no special virtual function handlers (like __cxa_pure_virtual) defined for NVPTX target, so just emit such functions as null pointers to prevent issues with linking and unresolved references.
* Remove trailing `;`. NFC.Michael Liao2020-01-141-1/+1
|
* [Driver][test] Fix Driver/hexagon-toolchain-elf.c for ↵Fangrui Song2020-01-141-1/+2
| | | | | | | | -DCLANG_DEFAULT_LINKER=lld builds Reviewed By: nathanchance, sidneym Differential Revision: https://reviews.llvm.org/D72668
* [clang][test][NFC] Use more widely supported sanitizer for file dependency testsJan Korous2020-01-142-6/+6
| | | | | | | | The tests aren't concerned at all by the actual sanitizer - only by blacklist being reported as a dependency. We're unfortunately limited by platform support for any particular sanitizer but we can at least use one that is widely supported. Post-commit review: https://reviews.llvm.org/D72729
* [DebugInfo] Add option to clang to limit debug info that is emitted for classes.Amy Huang2020-01-142-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds an option to limit debug info by only emitting complete class type information when its constructor is emitted. This applies to classes that have nontrivial user defined constructors. I implemented the option by adding another level to `DebugInfoKind`, and a flag `-flimit-debug-info-constructor`. Total object file size on Windows, compiling with RelWithDebInfo: before: 4,257,448 kb after: 2,104,963 kb And on Linux before: 9,225,140 kb after: 4,387,464 kb According to the Windows clang.pdb files, here is a list of types that are no longer complete with this option enabled: https://reviews.llvm.org/P8182 Reviewers: rnk, dblaikie Subscribers: aprantl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72427
* [analyzer] Fix SARIF column locationsJoe Ranieri2020-01-144-27/+141
| | | | Differential revision: https://reviews.llvm.org/D70689
* [Driver] Ignore -fno-semantic-interpositionFangrui Song2020-01-142-0/+2
| | | | | | | | | | | | | | | | | | Fedora wants to build projects with -fno-semantic-interposition (e.g. https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup), which is supported by GCC>=5. Clang's current behavior is similar to -fno-semantic-interposition and the end goal is to make it more so (https://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html). Ignore this option. We should let users know -fsemantic-interposition is not currently supported, so it should remain a hard error. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D72724
* [OPENMP]Improve handling of possibly incorrectly mapped types.Alexey Bataev2020-01-142-12/+41
| | | | | Need to analayze the type of the expression for mapping, not the type of the declaration.
* Fix NetBSD bot after b4a99a061f517e60985667e39519f60186cbb469 ↵Alexandre Ganea2020-01-141-1/+1
| | | | ([Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation)
* Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic ↵Dmitri Gribenko2020-01-148-20/+20
| | | | template
* [RISCV] Add Clang frontend support for Bitmanip extensionScott Egerton2020-01-144-1/+19
| | | | | | | | | | | | | | Summary: This adds the __riscv_bitmanip macro and the 'b' target feature to enable it. Reviewers: asb, simoncook, lewis-revill, PaoloS, lenary Reviewed By: lenary Subscribers: Jim, rbar, johnrusso, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71553
* Fix "pointer is null" static analyzer warnings. NFCI.Simon Pilgrim2020-01-141-20/+17
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.
* Fix "pointer is null" clang static analyzer warnings. NFCI.Simon Pilgrim2020-01-141-23/+14
| | | | Use cast<>/castAs<> instead of dyn_cast<>/getAs<> since the pointers are always dereferenced and cast<>/castAs<> will perform the null assertion for us.
* [clang][OpenCL] Fix covered switch warningJinsong Ji2020-01-141-3/+1
| | | | | | | | | | | | | | | -Werror clang build is broken now. tools/clang/lib/Sema/OpenCLBuiltins.inc:11824:5: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default] default: We don't need default now, since all enumeration values are covered. Reviewed By: svenvh Differential Revision: https://reviews.llvm.org/D72707
OpenPOWER on IntegriCloud