summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [NFC-I] Remove hack for fp-classification builtinsErich Keane2019-12-162-1/+92
| | | | | | | | | | | | | | | The FP-classification builtins (__builtin_isfinite, etc) use variadic packs in the definition file to mean an overload set. Because of that, floats were converted to doubles, which is incorrect. There WAS a patch to remove the cast after the fact. THis patch switches these builtins to just be custom type checking, calls the implicit conversions for the integer members, and makes sure the correct L->R casts are put into place, then does type checking like normal. A future direction (that wouldn't be NFC) would consider making conversions for the floating point parameter legal.
* [WebAssembly] Replace SIMD int min/max builtins with patternsThomas Lively2019-12-161-84/+0
| | | | | | | | | | | | | | | | | | Summary: The instructions were originally implemented via builtins and intrinsics so users would have to explicitly opt-in to using them. This was useful while were validating whether these instructions should have been merged into the spec proposal. Now that they have been, we can use normal codegen patterns, so the intrinsics and builtins are no longer useful. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71500
* [OPENMP50]Add if clause in target teams idistribute simd directive.Alexey Bataev2019-12-163-113/+201
| | | | | | 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.
* [OPENMP50]Add if clause in target teams distribute parallel for simd directive.Alexey Bataev2019-12-162-11/+29
| | | | | | 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.
* Fix floating point builtins to not promote float->doubleErich Keane2019-12-162-1/+72
| | | | | | | | | | | As brought up in D71467, a group of floating point builtins automatically promoted floats to doubles because they used the variadic builtin tag to support an overload set. The result is that the parameters were treated as a variadic pack, which always promots float->double. This resulted in the wrong answer being given in cases with certain values of NaN.
* Mark the major papers for C++20 consistent comparisons as "done", andRichard Smith2019-12-151-0/+4
| | | | start publishing the corresponding feature-test macro.
* [c++20] Compute exception specifications for defaulted comparisons.Richard Smith2019-12-153-10/+236
| | | | | | | | This requires us to essentially fully form the body of the defaulted comparison, but from an unevaluated context. Naively this would require generating the function definition twice; instead, we ensure that the function body is implicitly defined before performing the check, and walk the actual body where possible.
* Properly compute whether statement expressions can throw, rather thanRichard Smith2019-12-151-1/+59
| | | | | | | | | conservatively assuming they always can. Also fix cases where we would not consider the computation of a VLA type when determining whether an expression can throw. We don't yet properly determine whether a VLA can throw, but no longer incorrectly claim it can never throw.
* [analyzer] Add support for namespaces to GenericTaintCheckerBorsik Gabor2019-12-152-0/+167
| | | | | | | | | | | | | This patch introduces the namespaces for the configured functions and also enables the use of the member functions. I added an optional Scope field for every configured function. Functions without Scope match for every function regardless of the namespace. Functions with Scope will match if the full name of the function starts with the Scope. Multiple functions can exist with the same name. Differential Revision: https://reviews.llvm.org/D70878
* [Driver] Default to -momit-leaf-frame-pointer for AArch64Fangrui Song2019-12-132-2/+4
| | | | | | | | | | | | | | | | | This matches https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html > -momit-leaf-frame-pointer > -mno-omit-leaf-frame-pointer > > Omit or keep the frame pointer in leaf functions. The former behavior is the default. -mno-omit-leaf-frame-pointer is currently a no-op because TargetOptions::DisableFramePointerElim is only considered for non-leaf functions. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D71167
* PR44268: Fix crash if __builtin_object_size is applied to a heapRichard Smith2019-12-131-1/+7
| | | | allocation.
* [c++20] Improve phrasing of diagnostic for missing #include <compare>.Richard Smith2019-12-131-1/+15
|
* [analyzer] CStringChecker: Fix a crash on unknown value passed to strlcat.Artem Dergachev2019-12-131-1/+7
| | | | | | Checkers should always account for unknown values. Also use a slightly more high-level API that naturally avoids the problem.
* [Driver] Use .init_array for all gcc installations and simplify Generic_ELF ↵Fangrui Song2019-12-131-1/+1
| | | | | | | | | | | | | | | | | -fno-use-init-array rules D39317 made clang use .init_array when no gcc installations is found. This change changes all gcc installations to use .init_array . GCC 4.7 by default stopped providing .ctors/.dtors compatible crt files, and stopped emitting .ctors for __attribute__((constructor)). .init_array should always work. FreeBSD rules are moved to FreeBSD.cpp to make Generic_ELF rules clean. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71434
* [OPENMP]Fix skipping of functions body.Alexey Bataev2019-12-132-10/+30
| | | | | | When parsing the code with OpenMP and the function's body must be skipped, need to skip also OpenMP annotation tokens. Otherwise the counters for braces/parens are unbalanced and parsing fails.
* Call objc_retainBlock before passing a block as a variadic argumentAkira Hatanaka2019-12-131-0/+10
| | | | | | | | | Copy the block to the heap before passing it to the callee in case the block escapes in the callee. rdar://problem/55683462 Differential Revision: https://reviews.llvm.org/D71431
* Correct gcc vector splat conversion from float to int-vectorErich Keane2019-12-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | In looking into some other code, I came across this issue where a float converted to a gcc integer vector via a splat causes it to miss the float-to-integral cast, which causes some REALLY strange codegen bugs. The AST looked like: `-ImplicitCastExpr <col:13> 'gcc_int_2':'__attribute__((__vector_size__(2 * sizeof(int)))) int' <VectorSplat> `-ImplicitCastExpr <col:13> 'float' <LValueToRValue> `-DeclRefExpr <col:13> 'float' lvalue ParmVar 0x556f16a5dc90 'f' 'float' Despite the type of the VectorSplat cast as printed, it ended up becoming a vector of float, which caused non-matching instructions. For example, IntVector + a float constant resulted in: add <2 x i32> %8, <2 x float> <float 3.000000e+00, float 3.000000e+00> This patch corrects the conversion so that the float is first converted to an integral, THEN splatted.
* [profile] Fix a crash when -fprofile-remapping-file= triggers an errorFangrui Song2019-12-132-0/+8
| | | | | | Reviewed By: wmi Differential Revision: https://reviews.llvm.org/D71485
* [ARM][MVE][Intrinsics] All vqdmulhq/vqrdmulhq tests should be for signed ↵Mark Murray2019-12-132-18/+18
| | | | | | numbers. Fix broken tests. I can't yet explain how they worked locally pre-commit.
* [ARM][MVE] Add vector reduction intrinsics with two vector operandsMikhail Maltsev2019-12-133-0/+2313
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds intrinsics for the following MVE instructions: * VABAV * VMLADAV, VMLSDAV * VMLALDAV, VMLSLDAV * VRMLALDAVH, VRMLSLDAVH Each of the above 4 groups has a corresponding new LLVM IR intrinsic, since the instructions cannot be easily represented using general-purpose IR operations. Reviewers: simon_tatham, ostannard, dmgreen, MarkMurrayARM Reviewed By: MarkMurrayARM Subscribers: merge_guards_bot, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71062
* [ARM][MVE] Add intrinsics for more immediate shifts.Simon Tatham2019-12-131-0/+915
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fills in the remaining shift operations that take a single vector input and an immediate shift count: the `vqshl`, `vqshlu`, `vrshr` and `vshll[bt]` families. `vshll[bt]` (which shifts each input lane left into a double-width output lane) is the most interesting one. There are separate MC instruction ids for shifting by exactly the input lane width and shifting by less than that, because the instruction encoding is so completely different for the lane-width special case. So I had to write two sets of patterns to match based on the immediate shift count, which involved adding a ComplexPattern matcher to avoid the general-case pattern accidentally matching the special case too. For that family I've made sure to add an llc codegen test for both versions of each instruction. I'm experimenting with a new strategy for parametrising the isel patterns for all these instructions: adding extra fields to the relevant `Instruction` subclass itself, which are ignored by the Tablegen backends that generate the MC data, but can be retrieved from each instance of that instruction subclass when it's passed as a template parameter to the multiclass that generates its isel patterns. A nice effect of that is that I can fill in those informational fields using `let` blocks, rather than having to type them out once per instruction at `defm` time. (As a result, quite a lot of existing instruction `def`s are reindented by this patch, so it's clearer to read with whitespace changes ignored.) Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard Reviewed By: MarkMurrayARM Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71458
* [Sema] Improve diagnostic about addr spaces for overload candidatesAnastasia Stulova2019-12-134-17/+17
| | | | | | | | | | Allow sending address spaces into diagnostics to simplify and improve error reporting. Improved wording of diagnostics for address spaces in overloading. Tags: #clang Differential Revision: https://reviews.llvm.org/D71111
* [ARM][MVE][Intrinsics] Add *_x() variants of my *_m() intrinsics.Mark Murray2019-12-1319-26/+1386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Better use of multiclass is used, and this helped find some existing bugs in the predicated VMULL* intrinsics, which are now fixed. The refactored VMULL[TB]Q_(INT|POLY)_M() intrinsics were discovered to have an argument ("inactive") with incorrect type, and this required a fix that is included in this whole patch. The argument "inactive" should have been the same width (per vector element) as the return type of the intrinsic, but was not in the case where the return type was double the element width of the input types. To assist in testing the multiclassing , and to thwart further gremlins, the unit tests are improved in scope. The *.ll tests are all generated by a small bit of throw-away scripting from the corresponding *.c tests, and as such the diffs are large and nasty. Look at the file rather than the diff. Reviewers: dmgreen, miyuki, ostannard, simon_tatham Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71421
* Remove extra character I added to test my changes that I forgot to delete ↵Douglas Yung2019-12-121-1/+1
| | | | before submitting.
* Fix test to work correctly on 32-bit platforms.Douglas Yung2019-12-121-1/+2
|
* Update line number after previous patch added an additional unsupportedEric Christopher2019-12-121-4/+4
| | | | and comment lines.
* [clang] [test] Disable the test exhausting stack on NetBSDMichał Górny2019-12-121-0/+3
| | | | | | | Disable the instantiation-depth-default.cpp test on NetBSD since it requires more stack space than we have by default on NetBSD. Differential Revision: https://reviews.llvm.org/D71419
* [OPENMP50]Fix possible conflict when emitting an alias for the functionsAlexey Bataev2019-12-121-0/+49
| | | | | | | in declare variant. If the types of the fnction are not equal, but match, at the codegen thei may have different types. This may lead to compiler crash.
* [LTO] Support for embedding bitcode section during LTOTeresa Johnson2019-12-121-0/+74
| | | | | | | | | | | | | | | | | | | Summary: This adds support for embedding bitcode in a binary during LTO. The libLTO gains supports the `-lto-embed-bitcode` flag. The option allows users of the LTO library to embed a bitcode section. For example, LLD can pass the option via `ld.lld -mllvm=-lto-embed-bitcode`. This feature allows doing something comparable to `clang -c -fembed-bitcode`, but on the (LTO) linker level. Having bitcode alongside native code has many use-cases. To give an example, the MacOS linker can create a `-bitcode_bundle` section containing bitcode. Also, having this feature built into LLVM is an alternative to 3rd party tools such as [[ https://github.com/travitch/whole-program-llvm | wllvm ]] or [[ https://github.com/SRI-CSL/gllvm | gllvm ]]. As with these tools, this feature simplifies creating "whole-program" llvm bitcode files, but in contrast to wllvm/gllvm it does not rely on a specific llvm frontend/driver. Patch by Josef Eisl <josef.eisl@oracle.com> Reviewers: #llvm, #clang, rsmith, pcc, alexshap, tejohnson Reviewed By: tejohnson Subscribers: tejohnson, mehdi_amini, inglorion, hiraditya, aheejin, steven_wu, dexonsmith, dang, cfe-commits, llvm-commits, #llvm, #clang Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68213
* [OPENMP50]Improve checks for declare variant functions compatibility.Alexey Bataev2019-12-122-8/+17
| | | | | Added check for functions compatibility in C and removed restriction for functions with no prototypes in declare variant constrcut.
* Suppress -Wwarn-unused-variables when we don't know the constructorErich Keane2019-12-121-0/+14
| | | | | | | | | | | | | | This warning is supposed to be suppressed when the constructor/destructor are non-trivial, since it might be a RAII type. However, if the type has a trivial destructor and the constructor hasn't been resolved (since it is called with dependent arguments), we were still warning. This patch suppresses the warning if the type could possibly have a be a non-trivial constructor call. Note that this does not take the arity of the constructors into consideration, so it might suppress the warning in cases where it isn't possible to call a non-trivial constructor.
* [PS4] Predefine the __SCE__ macro for the x86_64-scei-ps4 tripleWarren Ristow2019-12-121-0/+1
|
* Default to -fuse-init-arrayFangrui Song2019-12-1213-54/+33
| | | | | | | | | | | | | | | | | | | Very few ELF platforms still use .ctors/.dtors now. Linux (glibc: 1999-07), DragonFlyBSD, FreeBSD (2012-03) and Solaris have supported .init_array for many years. Some architectures like AArch64/RISC-V default to .init_array . GNU ld and gold can even convert .ctors to .init_array . It makes more sense to flip the CC1 default, and only uses -fno-use-init-array on platforms that don't support .init_array . For example, OpenBSD did not support DT_INIT_ARRAY before Aug 2016 (https://github.com/openbsd/src/commit/86fa57a2792c6374b0849dd7b818a11e676e60ba) I may miss some ELF platforms that still use .ctors, but their maintainers can easily diagnose such problems. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71393
* [clang] Turn -fno-builtin flag into an IR AttributeGuillaume Chatelet2019-12-122-30/+31
| | | | | | | | | | | | | | Summary: This is a follow up on https://reviews.llvm.org/D61634#1742154 to turn the clang driver -fno-builtin flag into an IR attribute. I also investigated pushing the attribute earlier on (in Sema) but it looks like this patch is simple and will cover all function calls. Reviewers: aaron.ballman, courbet Subscribers: cfe-commits, tejohnson Tags: #clang Differential Revision: https://reviews.llvm.org/D71193
* [ARM][CMSE] Add CMSE header and builtinsMomchil Velikov2019-12-125-0/+185
| | | | | | | | | | | | This is patch C2 as mentioned in RFC http://lists.llvm.org/pipermail/cfe-dev/2019-March/061834.html This adds CMSE builtin functions, and introduces arm_cmse.h header which has useful macros, functions, and data types for end-users of CMSE. Patch by Javed Absar. Diferential Revision: https://reviews.llvm.org/D70817
* [OpenMP][Test] Add check for aux-triple predefined macrosAlexey Bader2019-12-121-0/+5
| | | | | | | | | | | | | | Summary: Make sure that auxiliary target specific macros are defined in OpenMP mode. Reviewers: ABataev, jdoerfert Subscribers: guansong, ebevhan, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71413
* [Diagnsotics] Small Improvement on -Wmisleading-indentationTyker2019-12-121-1/+20
| | | | | | | | | | Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: xbolva00 Differential Revision: https://reviews.llvm.org/D71083
* [NFC] - Partially revert 9c48c2f9c477007234cGabor Buella2019-12-121-1/+1
|
* [NFC] - Typo fix in test/CodeGenCXX/runtime-dllstorage.cppGabor Buella2019-12-121-5/+5
| | | | | | Reviewed By: Jim Differential Revision: https://reviews.llvm.org/D48921
* [Remarks][Driver] Ask for line tables when remarks are enabledFrancis Visoiu Mistrih2019-12-111-0/+6
| | | | | | | | | | | | | | | | Serialized remarks contain debug locations for each remark, by storing a file path, a line, and a column. Also, remarks support being embedded in a .dSYM bundle using a separate section in object files, that is found by `dsymutil` through the debug map. In order for tools to map addresses to source and display remarks in the source, we need line tables, and in order for `dsymutil` to find the object files containing the remark section, we need to keep the debug map around. Differential Revision: https://reviews.llvm.org/D71325
* [analyzer] Do not cache out on some shared implicit AST nodesGabor Horvath2019-12-114-17/+52
| | | | | | | | | | | Some AST nodes which stands for implicit initialization is shared. The analyzer will do the same evaluation on the same nodes resulting in the same state. The analyzer will "cache out", i.e. it thinks that it visited an already existing node in the exploded graph. This is not true in this case and we lose coverage. Since these nodes do not really require any processing from the analyzer we just omit them from the CFG. Differential Revision: https://reviews.llvm.org/D71371
* Revert "[clang][clang-scan-deps] Aggregate the full dependency information."Michael Spencer2019-12-112-146/+59
| | | | | | This reverts commit f978ea498309adaebab8fbf1cd6e520e7e0e11f1. It broke clang-ppc64be-linux, but not sure why yet.
* [OpenMP] Use the OpenMP-IR-BuilderJohannes Doerfert2019-12-113-2/+27
| | | | | | | | | | | | | | | This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19. [1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D69922
* [clang][clang-scan-deps] Aggregate the full dependency information.Michael Spencer2019-12-112-59/+146
| | | | Differential Revision: https://reviews.llvm.org/D70268
* Suppress false-positive -Wuninitialized warnings in the constructor of aRichard Smith2019-12-111-0/+9
| | | | templated but non-template class.
* Fix detection of __attribute__((may_alias)) to properly look throughRichard Smith2019-12-111-0/+25
| | | | | | | type sugar. We previously missed the attribute in a lot of cases in C++, because there's often other type sugar there (eg, ElaboratedType).
* [OPENMP50]Add if clause in teams distribute parallel for simd directive.Alexey Bataev2019-12-113-16/+39
| | | | | | 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.
* [WebAssembly] Add new `export_name` clang attribute for controlling wasm ↵Sam Clegg2019-12-112-0/+12
| | | | | | | | | | | | | | | | | | | | export names This is equivalent to the existing `import_name` and `import_module` attributes which control the import names in the final wasm binary produced by lld. This maps the existing This attribute currently requires a string rather than using the symbol name for a couple of reasons: 1. Avoid confusion with static and dynamic linking which is based on symbol name. Exporting a function from a wasm module using this directive is orthogonal to both static and dynamic linking. 2. Avoids name mangling. Differential Revision: https://reviews.llvm.org/D70520
* [analyzer] Escape symbols conjured into specific regions during a ↵Gabor Horvath2019-12-113-2/+16
| | | | | | | | | | conservative EvalCall This patch introduced additional PointerEscape callbacks after conservative calls for output parameters. This should not really affect the current checkers but the upcoming FuchsiaHandleChecker relies on this heavily. Differential Revision: https://reviews.llvm.org/D71224
* [analyzer] LocalizationChecker: Fix a crash on synthesized accessor stubs.Artem Dergachev2019-12-111-0/+8
| | | | | | The checker was trying to analyze the body of every method in Objective-C @implementation clause but the sythesized accessor stubs that were introduced into it by 2073dd2d have no bodies.
OpenPOWER on IntegriCloud