summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [X86] Remove superfluous escaped new lines from intrinsic files.Craig Topper2018-06-031-4/+4
| | | | llvm-svn: 333858
* [X86] Explicitly make the arguments to __slwpcb intrinsic 'void'.Craig Topper2018-06-031-1/+1
| | | | | | This is the correct way to say it takes no arguments in C. llvm-svn: 333855
* [X86] Replace __builtin_ia32_vbroadcastf128_pd256 and ↵Craig Topper2018-06-034-32/+6
| | | | | | __builtin_ia32_vbroadcastf128_ps256 with an unaligned load intrinsics and a __builtin_shufflevector call. llvm-svn: 333853
* [X86] Pass ArrayRef instead of SmallVectorImpl& to the X86 builtin helper ↵Craig Topper2018-06-031-10/+10
| | | | | | functions. NFC llvm-svn: 333851
* Revert r333848 "[X86] Pass ArrayRef instead of SmallVectorImpl& to the X86 ↵Craig Topper2018-06-031-8/+8
| | | | | | | | builtin helper functions. NFC" Looks like I missed some changes to make this work. llvm-svn: 333850
* [X86] Pass ArrayRef instead of SmallVectorImpl& to the X86 builtin helper ↵Craig Topper2018-06-031-8/+8
| | | | | | functions. NFC llvm-svn: 333848
* [X86] When emitting masked loads/stores don't check for all ones mask.Craig Topper2018-06-031-10/+0
| | | | | | | | This seems like a premature optimization. It's unlikely a user would pass something the frontend can tell is all ones to the masked load/store intrinsics. We do this optimization for emitting select for masking because we have builtin calls in header files that pass an all ones mask in. Though at this point we may not longer have any builtins that emit some IR and a select. We may only have the select builtins so maybe we can remove that optimization too. llvm-svn: 333847
* [X86] Mark the pointer arguments to expandload builtins as const consistently.Craig Topper2018-06-031-8/+8
| | | | | | Some of them had it and some didn't. This should make them consistent. llvm-svn: 333846
* clang-interpreter: Add missing LLVM component ObjectFangrui Song2018-06-031-0/+1
| | | | llvm-svn: 333836
* [NEON] Support VLD1xN intrinsics in AArch32 mode (Clang part)Ivan A. Kosarev2018-06-024-1295/+1449
| | | | | | | | | We currently support them only in AArch64. The NEON Reference, however, says they are 'ARMv7, ARMv8' intrinsics. Differential Revision: https://reviews.llvm.org/D47121 llvm-svn: 333829
* Revert "This diff includes changes for supporting the following types."Leonard Chan2018-06-0238-450/+6
| | | | | | | This reverts commit r333814, which fails for a test checking the bit width on ubuntu. llvm-svn: 333815
* This diff includes changes for supporting the following types.Leonard Chan2018-06-0238-6/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | ``` // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; ``` This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches. The tests included are for asserting that we can declare these types. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333814
* [cmake] Support LLD for CLANG_ORDER_FILEShoaib Meenai2018-06-021-2/+5
| | | | | | | | | | | | | | | | | LLD also supports order files using the `--symbol-ordering-file` option. As the name would suggest, the order file format is slightly different from gold; gold's order files specify section names, whereas LLD's specify symbol names. Assuming you have an order file in the correct format though, we should support using it with LLD. Switch the check to actually use LLVM's linker detection rather than just checking for the presence of the gold executable, since we might have a gold executable present but be using LLD (or bfd for that matter) as our linker. Differential Revision: https://reviews.llvm.org/D47669 llvm-svn: 333810
* [cmake] Use LLVM's check_linker_flagShoaib Meenai2018-06-021-8/+1
| | | | | | | LLVM already defines this function, so make use of it instead of rolling our own. llvm-svn: 333808
* Add Features.def to module mapEric Fiselier2018-06-011-0/+1
| | | | llvm-svn: 333802
* Cap "voluntary" vector alignment at 16 for all Darwin platforms.John McCall2018-06-018-97/+123
| | | | | | | | | | | | | | | | | | | | | This fixes two major problems: - We were not capping vector alignment as desired on 32-bit ARM. - We were using different alignments based on the AVX settings on Intel, so we did not have a consistent ABI. This is an ABI break, but we think we can get away with it because vectors tend to be used mostly in inline code (which is why not having a consistent ABI has not proven disastrous on Intel). Intel's AVX types are specified as having 32-byte / 64-byte alignment, so align them explicitly instead of relying on the base ABI rule. Note that this sort of attribute is stripped from template arguments in template substitution, so there's a possibility that code templated over vectors will produce inadequately-aligned objects. The right long-term solution for this is for alignment attributes to be interpreted as true qualifiers and thus preserved in the canonical type. llvm-svn: 333791
* [X86] Rewrite avx512vbmi unmasked and maskz macro intrinsics to be wrappers ↵Craig Topper2018-06-012-36/+180
| | | | | | | | | | around their __builtin function with appropriate arguments rather than just passing arguments to the masked intrinsic. This is more consistent with all of our other avx512 macro intrinsics. It also fixes a bad cast where an argument was casted to mmask8 when it should have been a mmask16. llvm-svn: 333778
* [Coverage] Remove a test dependency on the itanium ABIVedant Kumar2018-06-011-10/+11
| | | | | | | This should address a bot failure: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/9994/ llvm-svn: 333775
* Remove redundant -fno-coverage-mapping added in r333761 (already added in ↵Nico Weber2018-06-011-1/+0
| | | | | | r333423) llvm-svn: 333762
* clang-cl: Expose -no-canonical-prefixesNico Weber2018-06-012-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | -no-canonical-prefixes is a weird flag: In gcc, it controls whether realpath() is called on the path of the driver binary. It's needed to support some usecases where gcc is symlinked to, see https://gcc.gnu.org/ml/gcc/2011-01/msg00429.html for some background. In clang, the resource dir is found relative to the compiler binary, and without -no-canonical-prefixes that's an absolute path. For clang, the main use case for -no-canonical-prefixes is to make the -resource-dir path added by the driver relative instead of absolute. Making it relative seems like the better default, but since neither clang not gcc have -canonical-prefixes without no- which makes changing the default tricky, and since some symlink behaviors do depend on the realpath() call at least for gcc, just expose -no-canonical-prefixes in clang-cl mode. Alternatively we could default to no-canonical-prefix-mode for clang-cl since it's less likely to be used in symlinked scenarios, but since you already need to about -no-canonical-prefixes for the non-clang-cl bits of your build, not hooking this of driver mode seems better to me. https://reviews.llvm.org/D47480 llvm-svn: 333761
* [OpenMP] Fix typo in NVPTX linker, NFC.Jonas Hahnfeld2018-06-011-1/+1
| | | | | | | Clang calls "nvlink" for linking multiple object files with OpenMP target functions, so correct this information when printing errors. llvm-svn: 333757
* Fix unused variable warning from r333718 Erich Keane2018-06-011-1/+1
| | | | llvm-svn: 333752
* [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL fileErich Keane2018-06-012-5/+7
| | | | | | | | | | | | | | | | | | | | | | | Compiler crashes when omp simd is used in an OpenCL file: clang -c -fopenmp omp_simd.cl __kernel void test(global int *data, int size) { #pragma omp simd for (int i = 0; i < size; ++i) { } } The problem seems to be the check added to verify block pointers have initializers. An OMPCapturedExprDecl is created to capture ‘size’ but there is no TypeSourceInfo. The change just uses getType() directly. Patch-By: mikerice Differential Revision: https://reviews.llvm.org/D46667 llvm-svn: 333746
* [CodeComplete] Add a few extra tests for r333538. NFCIlya Biryukov2018-06-011-1/+19
| | | | | | | | | From a follow-up discussion in D44480. New tests check that function bodies are not skipped: - In presence of ptr declarators, e.g. `auto**`. - When `decltype(auto)` is used in return type, only `auto` was checked before. llvm-svn: 333735
* [X86] Remove leftover semicolons at end of macrosMartin Storsjo2018-06-015-13/+13
| | | | | | | This was missed in a few places in SVN r333613, causing compilation errors if these macros are used e.g. as parameter to a function. llvm-svn: 333734
* [analyzer] NFC: Track all constructed objects in a single state trait.Artem Dergachev2018-06-014-332/+168
| | | | | | | | | | | | | | | ExprEngine already maintains three internal program state traits to track path-sensitive information related to object construction: pointer returned by operator new, and pointer to temporary object for two different purposes - for destruction and for lifetime extension. We'll need to add 2-3 more in a few follow-up commits. Merge these traits into one because they all essentially serve one purpose and work similarly. Differential Revision: https://reviews.llvm.org/D47303 llvm-svn: 333719
* [Modules] Warning for module declarations lacking 'framework' qualifierBruno Cardoso Lopes2018-06-018-29/+100
| | | | | | | | | | | | | | | When a module declaration for a framework lacks the 'framework' qualifier, the listed headers aren't found (because there's no trigger for the special framework style path lookup) and the module is silently not built. This leads to frameworks not being modularized by accident, which is pretty bad. Add a warning and suggest the user to add the 'framework' qualifier when we can prove that it's the case. rdar://problem/39193062 llvm-svn: 333718
* [WebAssembly] Hide new Wasm EH behind its feature flagHeejin Ahn2018-06-013-12/+19
| | | | | | | | | | | | | | | | Summary: clang's current wasm EH implementation is a non-MVP feature in progress. We had a `-mexception-handling` wasm feature but were not using it. This patch hides the non-MVP wasm EH behind a flag, so it does not affect other code for now. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits Differential Revision: https://reviews.llvm.org/D47614 llvm-svn: 333716
* [Coverage] End deferred regions before labels, fixes PR35867Vedant Kumar2018-06-012-0/+10
| | | | | | | | | A deferred region should end before the start of a label, and should not extend to the start of the label sub-statement. Fixes llvm.org/PR35867. llvm-svn: 333715
* [WebAssembly] Update to the new names for the memory builtin functions.Dan Gohman2018-06-013-11/+39
| | | | | | | | | The WebAssembly committee has decided on the names `memory.size` and `memory.grow` for the memory intrinsics, so update the clang builtin functions to follow those names, keeping both sets of old names in place for compatibility. llvm-svn: 333712
* [analyzer] fix bug with 1-bit APSInt types in Z3ConstraintManagerDominic Chen2018-05-312-22/+57
| | | | | | | | | | | | Summary: Clang does not have a corresponding QualType for a 1-bit APSInt, so use the BoolTy and extend the APSInt. Split from D35450. Fixes PR37622. Reviewers: george.karpenkov, NoQ Subscribers: mikhail.ramalho, xazax.hun, szepet, rnkovacs, cfe-commits, a.sidorin Differential Revision: https://reviews.llvm.org/D47603 llvm-svn: 333704
* [WebAssembly] Use Windows EH instructions for Wasm EHHeejin Ahn2018-05-318-23/+588
| | | | | | | | | | | | | | | | | | | | | | | Summary: Because wasm control flow needs to be structured, using WinEH instructions to support wasm EH brings several benefits. This patch makes wasm EH uses Windows EH instructions, with some changes: 1. Because wasm uses a single catch block to catch all C++ exceptions, this merges all catch clauses into a single catchpad, within which we test the EH selector as in Itanium EH. 2. Generates a call to `__clang_call_terminate` in case a cleanup throws. Wasm does not have a runtime to handle this. 3. In case there is no catch-all clause, inserts a call to `__cxa_rethrow` at the end of a catchpad in order to unwind to an enclosing EH scope. Reviewers: majnemer, dschuff Subscribers: jfb, sbc100, jgravelle-google, sunfish, cfe-commits Differential Revision: https://reviews.llvm.org/D44931 llvm-svn: 333703
* Fix null MSInheritanceAttr deref in CXXRecordDecl::getMSInheritanceModel()Reid Kleckner2018-05-317-14/+141
| | | | | | | | | | | | | | Ensure latest MPT decl has a MSInheritanceAttr when instantiating templates, to avoid null MSInheritanceAttr deref in CXXRecordDecl::getMSInheritanceModel(). See PR#37399 for repo / details. Patch by Andrew Rogers! Differential Revision: https://reviews.llvm.org/D46664 llvm-svn: 333680
* [analyzer] Annotate ProgramState update methods with LLVM_NODISCARD.Artem Dergachev2018-05-311-53/+62
| | | | | | | | | | | Because our program states are immutable, methods like "add<>", "set<>", "bind" create a copy of the program state instead of mutating the existing state. If the updated state is discarded, it clearly indicates a bug. Such bugs are introduced frequently, hence the warn_unused_result annotation. Differential Revision: https://reviews.llvm.org/D47499 llvm-svn: 333679
* IRGen: Write .dwo files when -split-dwarf-file is used together with ↵Peter Collingbourne2018-05-312-0/+22
| | | | | | | | -fthinlto-index. Differential Revision: https://reviews.llvm.org/D47597 llvm-svn: 333677
* [analyzer] Improve performance of the SVal simplification mechanism further.Artem Dergachev2018-05-311-6/+31
| | | | | | | | | | | Memoize simplification so that we didn't need to simplify the same symbolic expression twice within the same program state. Gives ~25% performance boost on the artificial test in test/Analysis/hangs.c. Differential Revision: https://reviews.llvm.org/D47402 llvm-svn: 333671
* [analyzer] Improve performance of the SVal simplification mechanism.Artem Dergachev2018-05-313-5/+58
| | | | | | | | | | | | When neither LHS nor RHS of a binary operator expression can be simplified, return the original expression instead of re-evaluating the binary operator. Such re-evaluation was causing recusrive re-simplification which caused the algorithmic complexity to explode. Differential Revision: https://reviews.llvm.org/D47155 llvm-svn: 333670
* Add dump method for selectorsAditya Kumar2018-05-312-0/+4
| | | | | | | Differential Revision: https://reviews.llvm.org/D45935 Reviewers: compnerd llvm-svn: 333657
* Add a new driver mode to dump compiler feature and extension options.Aaron Ballman2018-05-319-207/+342
| | | | | | Add the ability to dump compiler option-related information to a JSON file via the -compiler-options-dump option. Specifically, it dumps the features/extensions lists -- however, this output could be extended to other information should it be useful. In order to support features and extensions, I moved them into a .def file so that we could build the various lists we care about from them without a significant increase in maintenance burden. llvm-svn: 333653
* [Driver] Clean up tmp files when deleting Compilation objectsDavid Stenberg2018-05-313-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In rL327851 the createUniqueFile() and createTemporaryFile() variants that do not return the file descriptors were changed to create empty files, rather than only check if the paths are free. This change was done in order to make the functions race-free. That change led to clang-tidy (and possibly other tools) leaving behind temporary assembly files, of the form placeholder-*, when using a target that does not support the internal assembler. The temporary files are created when building the Compilation object in stripPositionalArgs(), as a part of creating the compilation database for the arguments after the double-dash. The files are created by Driver::GetNamedOutputPath(). Fix this issue by cleaning out temporary files at the deletion of Compilation objects. This fixes https://bugs.llvm.org/show_bug.cgi?id=37091. Reviewers: klimek, sepavloff, arphaman, aaron.ballman, john.brawn, mehdi_amini, sammccall, bkramer, alexfh, JDevlieghere Reviewed By: aaron.ballman, JDevlieghere Subscribers: erichkeane, lebedev.ri, Ka-Ka, cfe-commits Differential Revision: https://reviews.llvm.org/D45686 llvm-svn: 333637
* [X86] Make 512-bit unmasked load/store builtins more like their 128/256-bit ↵Craig Topper2018-05-312-18/+20
| | | | | | | | equivalents. Previously we were just passing -1 mask to the masked builtin. This changes it to the more generic way that the 128/256 bit use. llvm-svn: 333626
* [X86] Fix wrong intrinsic semantic.Tim Shen2018-05-312-17/+17
| | | | llvm-svn: 333617
* [X86] Fix some places where macro arguments to intrinsics weren't cast to ↵Craig Topper2018-05-317-104/+104
| | | | | | | | | | _m512(i|d)/_m256(i|d/_m128(i|d) first. The majority of the cases were correct. This fixes the few that weren't. I also removed some superfluous parentheses in non-macros that confused by attempts at grepping for missing casts. llvm-svn: 333615
* [X86] Remove __extension__ from macro intrinsics when its not needed.Craig Topper2018-05-3123-2941/+2939
| | | | | | | | | | I think this is a holdover from when we used to declare variables inside the macros. And then its been copy and pasted forward for years every time a new macro intrinsic gets added. Interestingly this caused some tests for IRGen to be slightly more optimized. We now return a zeroinitializer directly instead of going through a store+load. It also removed a bogus error message on another test. llvm-svn: 333613
* [analyzer] Trust _Nonnull annotations, and trust analyzer knowledge about ↵George Karpenkov2018-05-313-10/+75
| | | | | | | | | | | | | | | receiver nullability Previously, the checker was using the nullability of the expression, which is nonnull IFF both receiver and method are annotated as _Nonnull. However, the receiver could be known to the analyzer to be nonnull without being explicitly marked as _Nonnull. rdar://40635584 Differential Revision: https://reviews.llvm.org/D47510 llvm-svn: 333612
* [Coverage] Discard the last uncompleted deferred region in a declVedant Kumar2018-05-305-36/+27
| | | | | | | | | | | | | | | | | | | Discard the last uncompleted deferred region in a decl, if one exists. This prevents lines at the end of a function containing only whitespace or closing braces from being marked as uncovered, if they follow a region terminator (return/break/etc). The previous behavior was to heuristically complete deferred regions at the end of a decl. In practice this ended up being too brittle for too little gain. Users would complain that there was no way to reach full code coverage because whitespace at the end of a function would be marked uncovered. rdar://40238228 Differential Revision: https://reviews.llvm.org/D46918 llvm-svn: 333609
* [www] Update C++ status to cover P0620.Richard Smith2018-05-301-7/+12
| | | | | | While here, mark three-way comparison as in progress and bump "Clang 6" items from yellow to green. llvm-svn: 333606
* [X86] Use C style comments in intrinsic headers for overall consistency.Craig Topper2018-05-306-91/+100
| | | | | | | | Most of the origial comments used C style /* */ comments, but some C++ // comments had snuck in over time. Still need to convert all the doxygen comments. Which is much harder to do. llvm-svn: 333603
* IRGen: Rename bitsets -> type metadata. NFC.Peter Collingbourne2018-05-301-18/+17
| | | | | | | "Type metadata" is the term that we've been using for the CFI-related information on vtables for a while now. llvm-svn: 333602
* AST: Remove an unused ctor. NFC.Peter Collingbourne2018-05-301-3/+0
| | | | llvm-svn: 333600
OpenPOWER on IntegriCloud