summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix missing memcpy builtin on ppc64beGuillaume Chatelet2019-10-292-0/+2
| | | | See D68028
* [clang] Add no_builtin attributeGuillaume Chatelet2019-10-293-0/+116
| | | | | | | | | | | | | | | | Summary: This is a follow up on https://reviews.llvm.org/D61634 This patch is simpler and only adds the no_builtin attribute. Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert Subscribers: mgrang, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68028 This is a re-submit after it got reverted in https://reviews.llvm.org/rGbd8791610948 since the breakage doesn't seem to come from this patch.
* [OPENMP]Fix PR43772: No warning in non-combined target regions.Alexey Bataev2019-10-294-4/+20
| | | | | | Need to analyze inner target regions in case of implicit mapping of the data members when target region is created in one of the class member functions.
* [clang][clang-scan-deps] Add -fcxx-modules to test for Darwin.Michael Spencer2019-10-281-2/+2
|
* [Builtins] Teach Clang about memccpyDávid Bolvanský2019-10-282-0/+19
| | | | | | | | | | | | | | Summary: Hopefully, -fno-builtin-memccpy will work now. Required for https://reviews.llvm.org/D67986. Reviewers: aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: RKSimon, kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68377
* Revert "[clang] Add no_builtin attribute"Vlad Tsyrklevich2019-10-283-116/+0
| | | | | This reverts commit bd87916109483d33455cbf20da2309197b983cdd. It was causing ASan/MSan failures on the sanitizer buildbots.
* Revert "[Concepts] Constraint Enforcement & Diagnostics"Vlad Tsyrklevich2019-10-284-233/+0
| | | | | This reverts commit ffa214ef22892d75340dc6720271863901dc2c90, it was causing ASAN test failures on sanitizer-x86_64-linux-bootstrap.
* Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"Reid Kleckner2019-10-281-16/+0
| | | | | | | This reverts commit 9d4806a387892972fd544c0dcaefb0926126220c. There seem to be bugs in llvm-cov --path-equivalence that are causing Chromium problems. Revert this until they are understood or fixed.
* [Driver] Enable ShadowCallStack, not SafeStack, by default on AArch64 FuchsiaLeonard Chan2019-10-281-4/+5
| | | | | | | | | | | Submitted for mcgrathr. On AArch64, Fuchsia fully supports both SafeStack and ShadowCallStack ABIs. The latter is now preferred and will be the default. It's possible to enable both simultaneously, but ShadowCallStack is believed to have most of the practical benefit of SafeStack with less cost. Differential Revision: https://reviews.llvm.org/D66712
* [OPENMP]Fix PR43771: Do not capture contexprs variables.Alexey Bataev2019-10-281-0/+21
| | | | If the variable is a constexpr variable, it should not be captured in the OpenMP region.
* [clang] Add no_builtin attributeGuillaume Chatelet2019-10-283-0/+116
| | | | | | | | | | | | | | Summary: This is a follow up on https://reviews.llvm.org/D61634 This patch is simpler and only adds the no_builtin attribute. Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert Subscribers: mgrang, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68028
* Add Windows Control Flow Guard checks (/guard:cf).Andrew Paverd2019-10-283-9/+17
| | | | | | | | | | | | | | | | | | | Summary: A new function pass (Transforms/CFGuard/CFGuard.cpp) inserts CFGuard checks on indirect function calls, using either the check mechanism (X86, ARM, AArch64) or or the dispatch mechanism (X86-64). The check mechanism requires a new calling convention for the supported targets. The dispatch mechanism adds the target as an operand bundle, which is processed by SelectionDAG. Another pass (CodeGen/CFGuardLongjmp.cpp) identifies and emits valid longjmp targets, as required by /guard:cf. This feature is enabled using the `cfguard` CC1 option. Reviewers: thakis, rnk, theraven, pcc Subscribers: ychen, hans, metalcanine, dmajor, tomrittervg, alex, mehdi_amini, mgorny, javed.absar, kristof.beyls, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65761
* [ARM][AArch64] Implement __cls, __clsl and __clsll intrinsics from ACLEvhscampos2019-10-283-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Writing support for three ACLE functions: unsigned int __cls(uint32_t x) unsigned int __clsl(unsigned long x) unsigned int __clsll(uint64_t x) CLS stands for "Count number of leading sign bits". In AArch64, these two intrinsics can be translated into the 'cls' instruction directly. In AArch32, on the other hand, this functionality is achieved by implementing it in terms of clz (count number of leading zeros). Reviewers: compnerd Reviewed By: compnerd Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69250
* [ARM][AArch64] Implement __arm_rsrf, __arm_rsrf64, __arm_wsrf & __arm_wsrf64vhscampos2019-10-281-0/+49
| | | | | | | | | | | | | | | | | Summary: Adding support for ACLE intrinsics. Patch by Michael Platings. Reviewers: chill, t.p.northover, efriedma Reviewed By: chill Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69297
* [c++20] Enforce rule that a union-like class or class with referenceRichard Smith2019-10-271-0/+70
| | | | members cannot have defaulted comparisons.
* PR43775: don't produce a bogus 'auto' -Wc++98-compat warning for CTADRichard Smith2019-10-271-0/+17
|
* OpenMP: Add convergent to more runtime functionsMatt Arsenault2019-10-271-6/+10
| | | | | Several of these other functions are probably also convergent, but these two seem obviously convergent.
* PR43400: Add test that we can instantiate a friend function that isRichard Smith2019-10-271-0/+7
| | | | | | defined as deleted. The actual bug was fixed in commit d052a578.
* PR43762: when implicitly changing the active union member for anRichard Smith2019-10-271-0/+42
| | | | | assignment during constant evaluation, only start the lifetime of trivially-default-constructible union members.
* Reland "[Clang][Bundler] Error reporting improvements"Sergey Dmitriev2019-10-251-16/+16
| | | | | | | | - Changed FileHandler read/write methods to return llvm::Error - Using unified way of reporting errors - Removed trailing '.' from the error messages Differential Revision: https://reviews.llvm.org/D67031
* Revert "[Clang][Bundler] Error reporting improvements"Sergey Dmitriev2019-10-251-16/+16
| | | | This reverts commit dd501045cdea1c80b6788f0266d2a79f8b412eea.
* [Clang][Bundler] Error reporting improvementsSergey Dmitriev2019-10-251-16/+16
| | | | | | | | - Changed FileHandler read/write methods to return llvm::Error - Using unified way of reporting errors - Removed trailing '.' from the error messages Differential Revision: https://reviews.llvm.org/D67031
* [Sema][Typo Correction] Fix another infinite loop on ambiguityDavid Goldman2019-10-251-0/+14
| | | | | | | | | | | See also: D67515 - For the given call expression we would end up repeatedly trying to transform the same expression over and over again - Fix is to keep the old TransformCache when checking for ambiguity Differential Revision: https://reviews.llvm.org/D69060
* [clang] Switch arm-mve-intrinsics tests to use %clang_cc1.Simon Tatham2019-10-257-11/+11
| | | | | | | | | | | | | | It isn't really necessary for them to run the clang driver, and it's more efficient not to (and also more stable against driver changes). Now they invoke cc1 directly, more like the analogous NEON tests. Reviewers: dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69426
* [hip] Allow the declaration of functions with variadic arguments in HIP.Michael Liao2019-10-252-6/+6
| | | | | | | | | | | | | | | | | Summary: - As variadic parameters have the lowest rank in overload resolution, without real usage of `va_arg`, they are commonly used as the catch-all fallbacks in SFINAE. As the front-end still reports errors on calls to `va_arg`, the declaration of functions with variadic arguments should be allowed in general. Reviewers: jlebar, tra, yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69389
* [clang][ThinLTO] Promote cc1 -fthin_link_bitcode to driver ↵Yuanfang Chen2019-10-241-0/+4
| | | | | | | | | | | | | | | | | -fthinlto_link_bitcode Summary: A necessary step to let build system caching work for its output. Reviewers: tejohnson, steven_wu Reviewed by: tejohnson Subscribers: mehdi_amini, inglorion, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69406
* Revert "Recommit "[Clang] Pragma vectorize_width() implies vectorize(enable)""Jordan Rupprecht2019-10-242-30/+9
| | | | | | | | | | | | | | This reverts commit 80371c74ae63d2f260bcc75408be9c6f81e38465. Given the following source: ``` void a() { for (;;) ; } ``` It incorrectly enables vectorization (with vector width 1), as well as generating a warning that vectorization could not be performed.
* [clang-scan-deps] Add basic support for modules.Michael Spencer2019-10-243-0/+61
| | | | | | | | | | | | | | | | | | | | This fixes two issues that prevent simple uses of modules from working. * We would previously minimize _every_ file opened by clang, even module maps and module pcm files. Now we only minimize files with known extensions. It would be better if we knew which files clang intended to open as a source file, but this works for now. * We previously cached every lookup, even failed lookups. This is a problem because clang stats the module cache directory before building a module and creating that directory. If we cache that failure then the subsequent pcm load doesn't see the module cache and fails. Overall this still leaves us building minmized modules on disk during scanning. This will need to be improved eventually for performance, but this is correct, and works for now. Differential Revision: https://reviews.llvm.org/D68835
* When diagnosing an ambiguity, only note the candidates that contributeRichard Smith2019-10-2419-62/+58
| | | | to the ambiguity, rather than noting all viable candidates.
* [Concepts] Constraint Enforcement & DiagnosticsSaar Raz2019-10-254-0/+233
| | | | | | 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
* [ARM] Fixup MVE intrinsic tests with no assert buildsDavid Green2019-10-247-11/+11
| | | | The labels will be missing, so -fno-discard-value-names is added to the tests.
* Add AIX toolchain and basic linker functionalitystevewan2019-10-2410-0/+177
| | | | | | | | | | | | | | | | Summary: This patch adds AIX toolchain infrastructure into driver, and enables AIX system linker invocation with some basic functionality support Reviewers: daltenty, hubert.reinterpretcast, jasonliu, Xiangling_L Reviewed By: jasonliu Subscribers: Xiangling_L, jasonliu, ormris, wuzish, nemanjai, mgorny, kbarton, jfb, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68340
* [clang,ARM] Initial ACLE intrinsics for MVE.Simon Tatham2019-10-247-0/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit sets up the infrastructure for auto-generating <arm_mve.h> and doing clang-side code generation for the builtins it relies on, and demonstrates that it works by implementing a representative sample of the ACLE intrinsics, more or less matching the ones introduced in LLVM IR by D67158,D68699,D68700. Like NEON, that header file will provide a set of vector types like uint16x8_t and C functions with names like vaddq_u32(). Unlike NEON, the ACLE spec for <arm_mve.h> includes a polymorphism system, so that you can write plain vaddq() and disambiguate by the vector types you pass to it. Unlike the corresponding NEON code, I've arranged to make every user- facing ACLE intrinsic into a clang builtin, and implement all the code generation inside clang. So <arm_mve.h> itself contains nothing but typedefs and function declarations, with the latter all using the new `__attribute__((__clang_builtin))` system to arrange that the user- facing function names correspond to the right internal BuiltinIDs. So the new MveEmitter tablegen system specifies the full sequence of IRBuilder operations that each user-facing ACLE intrinsic should translate into. Where possible, the ACLE intrinsics map to standard IR operations such as vector-typed `add` and `fadd`; where no standard representation exists, I call down to the sample IR intrinsics introduced in an earlier commit. Doing it like this means that you get the polymorphism for free just by using __attribute__((overloadable)): the clang overload resolution decides which function declaration is the relevant one, and _then_ its BuiltinID is looked up, so by the time we're doing code generation, that's all been resolved by the standard system. It also means that you get really nice error messages if the user passes the wrong combination of types: clang will show the declarations from the header file and explain why each one doesn't match. (The obvious alternative approach would be to have wrapper functions in <arm_mve.h> which pass their arguments to the underlying builtins. But that doesn't work in the case where one of the arguments has to be a constant integer: the wrapper function can't pass the constantness through. So you'd have to do that case using a macro instead, and then use C11 `_Generic` to handle the polymorphism. Then you have to add horrible workarounds because `_Generic` requires even the untaken branches to type-check successfully, and //then// if the user gets the types wrong, the error message is totally unreadable!) Reviewers: dmgreen, miyuki, ostannard Subscribers: mgorny, javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67161
* [clang] New __attribute__((__clang_arm_mve_alias)).Simon Tatham2019-10-242-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to declare a function with a name of your choice (say `foo`), but have clang treat it as if it were a builtin function (say `__builtin_foo`), by writing static __inline__ __attribute__((__clang_arm_mve_alias(__builtin_foo))) int foo(args); I'm intending to use this for the ACLE intrinsics for MVE, which have to be polymorphic on their argument types and also need to be implemented by builtins. To avoid having to implement the polymorphism with several layers of nested _Generic and make error reporting hideous, I want to make all the user-facing intrinsics correspond directly to clang builtins, so that after clang resolves __attribute__((overloadable)) polymorphism it's already holding the right BuiltinID for the intrinsic it selected. However, this commit itself just introduces the new attribute, and doesn't use it for anything. To avoid unanticipated side effects if this attribute is used to make aliases to other builtins, there's a restriction mechanism: only (BuiltinID, alias) pairs that are approved by the function ArmMveAliasValid() will be permitted. At present, that function doesn't permit anything, because the Tablegen that will generate its list of valid pairs isn't yet implemented. So the only test of this facility is one that checks that an unapproved builtin _can't_ be aliased. Reviewers: dmgreen, miyuki, ostannard Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67159
* Don't add -fsplit-lto-unit for thin LTO builds with PS4 and Darwin toolchainsevgeny2019-10-241-0/+4
| | | | | These toolchains use legacy thin LTO API, which is not capable of unit splitting Differential revision: https://reviews.llvm.org/D69173
* [analyzer] Fix off-by-one in operator call parameter binding.Artem Dergachev2019-10-231-0/+16
| | | | | | | | | | | | | | Member operator declarations and member operator expressions have different numbering of parameters and arguments respectively: one of them includes "this", the other does not. Account for this inconsistency when figuring out whether the parameter needs to be manually rebound from the Environment to the Store when entering a stack frame of an operator call, as opposed to being constructed with a constructor and as such already having the necessary Store bindings. Differential Revision: https://reviews.llvm.org/D69155
* [c++2a] Allow comparison functions to be explicitly defaulted.Richard Smith2019-10-227-7/+152
| | | | | | This adds some initial syntactic checking that only the appropriate function signatures can be defaulted. No implicit definitions are generated yet.
* Revert r374202"[ObjC generics] Fix not inheriting type bounds in ↵Hans Wennborg2019-10-221-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | categories/extensions." This introduced new errors, see below. Reverting until that can be investigated properly. #import <AVFoundation/AVFoundation.h> void f(int width, int height) { FourCharCode best_fourcc = kCMPixelFormat_422YpCbCr8_yuvs; NSDictionary* videoSettingsDictionary = @{ (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc), }; } $ clang++ -c /tmp/a.mm /tmp/a.mm:6:5: error: cannot initialize a parameter of type 'KeyType<NSCopying> _Nonnull const' (aka 'const id') with an rvalue of type 'id' (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. > When a category/extension doesn't repeat a type bound, corresponding > type parameter is substituted with `id` when used as a type argument. As > a result, in the added test case it was causing errors like > > > type argument 'T' (aka 'id') does not satisfy the bound ('id<NSCopying>') of type parameter 'T' > > We are already checking that type parameters should be consistent > everywhere (see `checkTypeParamListConsistency`) and update > `ObjCTypeParamDecl` to have correct underlying type. And when we use the > type parameter as a method return type or a method parameter type, it is > substituted to the bounded type. But when we use the type parameter as a > type argument, we check `ObjCTypeParamType` that ignores the updated > underlying type and remains `id`. > > Fix by desugaring `ObjCTypeParamType` to the underlying type, the same > way we are doing with `TypedefType`. > > rdar://problem/54329242 > > Reviewers: erik.pilkington, ahatanak > > Reviewed By: erik.pilkington > > Subscribers: jkorous, dexonsmith, ributzka, cfe-commits > > Differential Revision: https://reviews.llvm.org/D66696
* [RISCV] Add support for -ffixed-xX flagsSimon Cook2019-10-221-0/+341
| | | | | | | | | | | This adds support for reserving GPRs such that the compiler will not choose a register for register allocation. The implementation follows the same design as for AArch64; each reserved register becomes a target feature and used for getting the reserved registers for a given MachineFunction. The backend checks that it does not need to write to any reserved register; if it does a relevant error is generated. Differential Revision: https://reviews.llvm.org/D67185
* [HIP] Add option -fgpu-allow-device-initYaxun (Sam) Liu2019-10-222-0/+27
| | | | | | | | | | | | | | Add this option to allow device side class type global variables with non-trivial ctor/dtor. device side init/fini functions will be emitted, which will be executed by HIP runtime when the fat binary is loaded/unloaded. This feature is to facilitate implementation of device side sanitizer which requires global vars with non-trival ctors. By default this option is disabled. Differential Revision: https://reviews.llvm.org/D69268
* Fix -fuse-init-array decision logic on NetBSDJoerg Sonnenberger2019-10-211-0/+15
| | | | | | | For NetBSD 9 and later, it is the default. On older versions, only ARM and AArch64 use it by default. llvm-svn: 375468
* [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which ↵Michael J. Spencer2019-10-211-0/+34
| | | | | | | | includes search paths and diagnostics. This is a recommit of r375322 and r375327 with a fix for the Windows test breakage. llvm-svn: 375466
* [test] Merge Driver/as-w-warnings.c into as-no-warnings.cFangrui Song2019-10-212-9/+7
| | | | | | For -integrated-as RUN lines we can remove -target. llvm-svn: 375439
* PCH debug info: Avoid appending the source directory to an absolute pathAdrian Prantl2019-10-211-0/+22
| | | | | | | | | | | | | | When building a precompiled header in -fmodule-format=obj (i.e., `-gmodules) in an absolute path, the locig in CGDebugInfo::createCompileUnit would unconditionally append the source directory to the -main-file-name. This patch avoids that behavior for absolute paths. rdar://problem/46045865 Differential Revision: https://reviews.llvm.org/D69213 llvm-svn: 375423
* [AMDGPU] Fix assertion due to initializer listYaxun Liu2019-10-201-15/+30
| | | | | | | | | | | | | Sometimes a global var is replaced by a different llvm value. clang use GetAddrOfGlobalVar to get the original llvm global variable. For most targets, GetAddrOfGlobalVar returns either the llvm global variable or a bitcast of the llvm global variable. However, for AMDGPU target, GetAddrOfGlobalVar returns the addrspace cast or addrspace cast plus bitcast of the llvm global variable. To get the llvm global variable, these casts need to be stripped, otherwise there is assertion. This patch fixes that. Differential Revision: https://reviews.llvm.org/D69129 llvm-svn: 375362
* Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash ↵Michael J. Spencer2019-10-191-33/+0
| | | | | | | | which includes search paths and diagnostics." and "[Docs] Fix header level." The test doesn't work on Windows. I'll fix it and recommit later. llvm-svn: 375338
* [analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.Artem Dergachev2019-10-191-5/+24
| | | | | | | | Patch by Kristóf Umann! Differential Revision: https://reviews.llvm.org/D68591 llvm-svn: 375329
* [analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.Artem Dergachev2019-10-191-0/+32
| | | | | | | 'self' was previously never tracked, but now it can be tracked because it may be part of a condition. llvm-svn: 375328
* Add -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"Richard Trieu2019-10-191-0/+22
| | | | | | | | | | | | | | | | | | | | Extend -Wparentheses to cover mixing bitwise-and and bitwise-or with the conditional operator. There's two main cases seen with this: unsigned bits1 = 0xf0 | cond ? 0x4 : 0x1; unsigned bits2 = cond1 ? 0xf0 : 0x10 | cond2 ? 0x5 : 0x2; // Intended order of evaluation: unsigned bits1 = 0xf0 | (cond ? 0x4 : 0x1); unsigned bits2 = (cond1 ? 0xf0 : 0x10) | (cond2 ? 0x5 : 0x2); // Actual order of evaluation: unsigned bits1 = (0xf0 | cond) ? 0x4 : 0x1; unsigned bits2 = cond1 ? 0xf0 : ((0x10 | cond2) ? 0x5 : 0x2); Differential Revision: https://reviews.llvm.org/D66043 llvm-svn: 375326
* [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which ↵Michael J. Spencer2019-10-191-0/+33
| | | | | | | | includes search paths and diagnostics. Differential Revision: https://reviews.llvm.org/D68528 llvm-svn: 375322
OpenPOWER on IntegriCloud