summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ubsan] array-bounds: Ignore params with constant sizeVedant Kumar2017-12-081-8/+0
| | | | | | | | | | This is a follow-up to r320128. Eli pointed out that there is some gray area in the language standard about whether the constant size is exact, or a lower bound. https://reviews.llvm.org/D40940 llvm-svn: 320185
* Fix a comment in the codeKamil Rytarowski2017-12-081-1/+1
| | | | | | The -ldl library is missing on NetBSD too, make the comment more generic. llvm-svn: 320165
* Revert "Unify implementation of our two different flavours of ↵Hans Wennborg2017-12-081-155/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | -Wtautological-compare." > Unify implementation of our two different flavours of -Wtautological-compare. > > In so doing, fix a handful of remaining bugs where we would report false > positives or false negatives if we promote a signed value to an unsigned type > for the comparison. This caused a new warning in Chromium: ../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64 with expression of type 'unsigned int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize); ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'unsigned int' is really a 6-bit bitfield, which is why it's always less than 64. I thought we didn't use to warn (with out-of-range-compare) when comparing against the boundaries of a type? llvm-svn: 320162
* [OPENMP] Initial codegen for `target teams distribute` directive.Alexey Bataev2017-12-086-21/+87
| | | | | | Host + default devices codegen for `target teams distribute` directive. llvm-svn: 320149
* In stdbool.h, define bool, false, true only in gnu++98Stephan Bergmann2017-12-081-1/+4
| | | | | | | | | | GCC has meanwhile corrected that with the similar <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216679> "C++11 explicitly forbids macros for bool, true and false." Differential Revision: https://reviews.llvm.org/D40167 llvm-svn: 320135
* Revert r320124 "Fold together the in-range and out-of-range portions of ↵Hans Wennborg2017-12-081-35/+98
| | | | | | | | | | | | | | | | | | | | -Wtautological-compare." This broke Chromium: ../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64 with expression of type 'unsigned int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize); ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'unsigned int' is really a 6-bit bitfield, which is why it's always less than 63. Did this use to fall under the "in-range" case before? I thought we didn't use to warn when comparing against the boundaries of a type. llvm-svn: 320133
* [Blocks] Inherit sanitizer options from parent declVedant Kumar2017-12-081-1/+3
| | | | | | | | | | | | There is no way to apply sanitizer suppressions to ObjC blocks. A reasonable default is to have blocks inherit their parent's sanitizer options. rdar://32769634 Differential Revision: https://reviews.llvm.org/D40668 llvm-svn: 320132
* [ubsan] Use pass_object_size info in bounds checksVedant Kumar2017-12-082-0/+59
| | | | | | | | | Teach UBSan's bounds check to opportunistically use pass_object_size information to check array accesses. rdar://33272922 llvm-svn: 320128
* Fold together the in-range and out-of-range portions of -Wtautological-compare.Richard Smith2017-12-081-98/+35
| | | | llvm-svn: 320124
* Unify implementation of our two different flavours of -Wtautological-compare.Richard Smith2017-12-081-145/+155
| | | | | | | | In so doing, fix a handful of remaining bugs where we would report false positives or false negatives if we promote a signed value to an unsigned type for the comparison. llvm-svn: 320122
* Fix more line endings changed in r320089. NFC.Ahmed Bougacha2017-12-071-1918/+1918
| | | | llvm-svn: 320114
* Correct line endings that got mixed up in r320089; NFC.Aaron Ballman2017-12-072-412/+412
| | | | llvm-svn: 320113
* [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-12-072-142/+177
| | | | | | other minor fixes (NFC). llvm-svn: 320091
* Add new language mode flags for C17.Aaron Ballman2017-12-072-401/+404
| | | | | | This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode flags for C17 and updates the value of __STDC_VERSION__ to the value based on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is expected that we (and GCC) will add c18 flags as aliases once the ballot passes. llvm-svn: 320089
* Add support for the __has_c_attribute builtin preprocessor macro.Aaron Ballman2017-12-071-1913/+1918
| | | | | | This behaves similar to the __has_cpp_attribute builtin macro in that it allows users to detect whether an attribute is supported with the [[]] spelling syntax, which can be enabled in C with -fdouble-square-bracket-attributes. llvm-svn: 320088
* [OPENMP] Do not capture private variables in the target regions.Alexey Bataev2017-12-071-2/+4
| | | | | | | | Private variables are completely redefined in the outlined regions, so we don't need to capture them. Patch adds this behavior to the target-based regions. llvm-svn: 320078
* [driver] Set the 'simulator' environment for Darwin when compiling forAlex Lorenz2017-12-075-12/+15
| | | | | | | | | | iOS/tvOS/watchOS simulator rdar://35135215 Differential Revision: https://reviews.llvm.org/D40682 llvm-svn: 320073
* [Index] Add setPreprocessor member to IndexDataConsumer.Eric Liu2017-12-071-8/+14
| | | | | | | | | | | | | | | | Summary: This enables us to use information in Preprocessor when handling symbol occurrences. Reviewers: arphaman, hokein Reviewed By: hokein Subscribers: malaperle, cfe-commits Differential Revision: https://reviews.llvm.org/D40884 llvm-svn: 320030
* [ARM] ACLE parallel arithmetic and DSP style multiplicationsSjoerd Meijer2017-12-071-8/+13
| | | | | | | | | | | This is a follow up of r302131, in which we forgot to add SemaChecking tests. Adding these tests revealed two problems which have been fixed: - added missing intrinsic __qdbl, - properly range checking ssat16 and usat16. Differential Revision: https://reviews.llvm.org/D40888 llvm-svn: 320019
* Ignore pointers to incomplete types when diagnosing misaligned addressesRoger Ferrer Ibanez2017-12-071-2/+3
| | | | | | | | | This is a fix for PR35509 in which we crash because we attempt to compute the alignment of an incomplete type. Differential Revision: https://reviews.llvm.org/D40895 llvm-svn: 320017
* Allow conditions to be decomposed with structured bindingsZhihao Yuan2017-12-072-5/+11
| | | | | | | | | | | | | | | | | | | | | Summary: This feature was discussed but not yet proposed. It allows a structured binding to appear as a //condition// if (auto [ok, val] = f(...)) So the user can save an extra //condition// if the statement can test the value to-be-decomposed instead. Formally, it makes the value of the underlying object of the structured binding declaration also the value of a //condition// that is an initialized declaration. Considering its logicality which is entirely evident from its trivial implementation, I think it might be acceptable to land it as an extension for now before I write the paper. Reviewers: rsmith, faisalv, aaron.ballman Reviewed By: rsmith Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D39284 llvm-svn: 320011
* Test commit accessZhihao Yuan2017-12-071-1/+1
| | | | llvm-svn: 320008
* CodeGen: Fix invalid bitcasts for memcpyYaxun Liu2017-12-071-4/+4
| | | | | | | | | | | | CreateCoercedLoad/CreateCoercedStore assumes pointer argument of memcpy is in addr space 0, which is not correct and causes invalid bitcasts for triple amdgcn---amdgiz. It is fixed by using alloca addr space instead. Differential Revision: https://reviews.llvm.org/D40806 llvm-svn: 320000
* Remove old concepts parsing codeHubert Tong2017-12-076-247/+1
| | | | | | | | | | | | | | | | | | Summary: This is so we can implement concepts per P0734R0. Relevant failing test cases are disabled. Reviewers: hubert.reinterpretcast, rsmith, saar.raz, nwilson Reviewed By: saar.raz Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40380 Patch by Changyu Li! llvm-svn: 319992
* [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-12-063-97/+141
| | | | | | minor fixes (NFC). llvm-svn: 319986
* Delete special-case "out-of-range" handling for bools, and just use the normalRichard Smith2017-12-061-115/+61
| | | | | | | | | | | codepath plus the new "minimum / maximum value of type" diagnostic to get the same effect. Move the warning for an in-range but tautological comparison of a constant (0 or 1) against a bool out of -Wtautological-constant-out-of-range-compare into the more-appropriate -Wtautological-constant-compare. llvm-svn: 319942
* Fix PR35542: Correct adjusting of private reduction variableJonas Hahnfeld2017-12-061-3/+6
| | | | | | | | | | | | The adjustment is calculated with CreatePtrDiff() which returns the difference in (base) elements. This is passed to CreateGEP() so make sure that the GEP base has the correct pointer type: It needs to be a pointer to the base type, not a pointer to a constant sized array. Differential Revision: https://reviews.llvm.org/D40911 llvm-svn: 319931
* [NVPTX,CUDA] Added llvm.nvvm.fns intrinsic and matching __nvvm_fns builtin ↵Artem Belevich2017-12-061-0/+4
| | | | | | | | in clang. Differential Revision: https://reviews.llvm.org/D40872 llvm-svn: 319909
* [CUDA] Added overloads for '[unsigned] long' variants of shfl builtins.Artem Belevich2017-12-061-0/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D40871 llvm-svn: 319908
* Stringizing raw string literals containing newlineTaewook Oh2017-12-061-56/+65
| | | | | | | | | | | | | | Summary: This patch implements 4.3 of http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4220.pdf. If a raw string contains a newline character, replace each newline character with the \n escape code. Without this patch, included test case (macro_raw_string.cpp) results compilation failure. Reviewers: rsmith, doug.gregor, jkorous-apple Reviewed By: jkorous-apple Subscribers: jkorous-apple, vsapsai, cfe-commits Differential Revision: https://reviews.llvm.org/D39279 llvm-svn: 319904
* [OPENMP] Initial codegen for `teams distribute simd` directive.Alexey Bataev2017-12-062-16/+38
| | | | | | Host + default devices codegen for `teams distribute simd` directive. llvm-svn: 319896
* [OpenCL] Fix layering violation by getOpenCLTypeAddrSpaceSven van Haastregt2017-12-064-35/+58
| | | | | | | | | | | | Commit 7ac28eb0a5 / r310911 ("[OpenCL] Allow targets to select address space per type", 2017-08-15) made Basic depend on AST, introducing a circular dependency. Break this dependency by adding the OpenCLTypeKind enum in Basic and map from AST types to this enum in ASTContext. Differential Revision: https://reviews.llvm.org/D40838 llvm-svn: 319883
* Fix a bunch of wrong "tautological unsigned enum compare" diagnostics in C++.Richard Smith2017-12-061-3/+4
| | | | | | | An enumeration with a fixed underlying type can have any value in its underlying type, not just those spanned by the values of its enumerators. llvm-svn: 319875
* P0722R2: The first parameter in an implicit call to a destroying operatorRichard Smith2017-12-051-0/+9
| | | | | | delete should be a cv-unqualified pointer to the deleted object. llvm-svn: 319858
* [analyzer] do not crash on cases where an array subscript is an rvalueGeorge Karpenkov2017-12-051-11/+24
| | | | | | | | | | | | | Array subscript is almost always an lvalue, except for a few cases where it is not, such as a subscript into an Objective-C property, or a return from the function. This commit prevents crashing in such cases. Fixes rdar://34829842 Differential Revision: https://reviews.llvm.org/D40584 llvm-svn: 319834
* [OPENMP] Fix implicit mapping analysis.Alexey Bataev2017-12-051-30/+47
| | | | | | | Fixed processing of implicitly mapped objects in target-based executable directives. llvm-svn: 319814
* [WebAssembly] Don't use Wasm function sections for more than one functionDan Gohman2017-12-051-5/+0
| | | | | | | | | | Patch by Nicholas Wilson! Fixes PR35467. Differential Revision: https://reviews.llvm.org/D40738 llvm-svn: 319801
* [OPENMP] Remove non-required parameters for distribute simd outlinedAlexey Bataev2017-12-051-2/+2
| | | | | | region, NFC. llvm-svn: 319800
* [analyzer] Mark heap-based symbolic regions in debug dumps.Artem Dergachev2017-12-051-0/+2
| | | | | | | | | | | They are now printed as HeapSymRegion{$x} in order to discriminate between that and regular SymRegion{$x}, which are two different regions, having different parent reginos (memory spaces) - HeapSpaceRegion and UnknownSpaceRegion respectively. Differential Revision: https://reviews.llvm.org/D40793 llvm-svn: 319793
* [x86][AVX512] Lowering kunpack intrinsics to LLVM IRJina Nahias2017-12-052-5/+3
| | | | | | | | | This patch, together with a matching llvm patch (https://reviews.llvm.org/D39720), implements the lowering of X86 kunpack intrinsics to IR. Differential Revision: https://reviews.llvm.org/D39719 Change-Id: Id5d3cb394ad33b98be79a6783d1d15569e2b798d llvm-svn: 319777
* [OPENMP] Fix assert fail after target implicit map checks.Alexey Bataev2017-12-051-36/+23
| | | | | | | | If the error is generated during analysis of implicitly or explicitly mapped variables, it may cause compiler crash because of incorrect analysis. llvm-svn: 319774
* Add __WINT_MAX__.Ed Schouten2017-12-051-0/+1
| | | | | | | This definition is similar to __WCHAR_MAX__, except that it applies to wint_t. It's also documented as being supported by GCC 4.5 and later. llvm-svn: 319746
* AMDGPU: Don't add fp64 feature to r600 subtargetsMatt Arsenault2017-12-051-1/+1
| | | | | | Should fix test after r319709 llvm-svn: 319735
* Generalize "static data member instantiated" notification to cover variable ↵Richard Smith2017-12-0510-104/+134
| | | | | | | | | templates too. While here, split the "point of instantiation changed" notification out from it; these two really are orthogonal changes. llvm-svn: 319727
* [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-12-043-55/+50
| | | | | | minor fixes (NFC). llvm-svn: 319714
* Correctly handle line table entries without filenames during AST serializationHans Wennborg2017-12-042-1/+3
| | | | | | | | | | The current code would hit an assert in ASTWriter when trying to write out the filename for a line table entry that didn't have any. Fix this by allowing the -1 sentinel value to round-trip through serialization. Differential revision: https://reviews.llvm.org/D40746 llvm-svn: 319707
* Add _Float128 as alias to __float128 to enable compilations on ↵Erich Keane2017-12-041-0/+4
| | | | | | | | | | | | | | | | | Fedora27/glibc2-26 Fedora27 is using a new version of glibc that refers to the _Float128 type. This patch adds that name as an alias to float128. I also added some predefined macro values for the digits, mantissa, epilon, etc (FloatMacros). For the test case, I copied an existing float128 test. This functionality needs work long term, but it should be sufficient to tread water for a while. At Intel we have test servers running our LLVM compiler with various open source workloads, the server has been upgraded to Fedora27 so many workloads are failing due to _Float128. Patch-By: mibintc Differential Revision: https://reviews.llvm.org/D40673 llvm-svn: 319703
* [OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration ↵Alexey Bataev2017-12-041-0/+3
| | | | | | | | | | spaces. Though it is incorrect from point of view of OpenMP standard to have dependent iteration space in OpenMP loops, compiler should not crash. Patch fixes this problem. llvm-svn: 319700
* [analyzer] [NFC] remove duplicated functionGeorge Karpenkov2017-12-041-31/+12
| | | | | | | | | | | Two copies of getSymLERange in RangeConstraintManager are virtually identical, which is clearly bad. This patch uses lambdas to call one from another (assuming that we would like to avoid getting ranges from the state when necessary). Differential Revision: https://reviews.llvm.org/D39709 llvm-svn: 319697
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-12-043-16/+38
| | | | | | | | | | distribute parallel for simd' on host https://reviews.llvm.org/D40795 This includes regression tests for all associated clauses. llvm-svn: 319696
OpenPOWER on IntegriCloud