summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Add --cuda-path to mock a CUDA Toolkit installation to avoidKelvin Li2017-12-121-1/+1
| | | | | | | | | unexpected error messages for incompatibility between the default SM level and the support in the installed toolkit. Differential Revision: https://reviews.llvm.org/D40996 llvm-svn: 320506
* [debuginfo-tests] Add support for moving debuginfo-tests from clang/test to ↵Don Hinton2017-12-122-2/+19
| | | | | | | | | | | | | | | | | | | | | llvm/projects or monorepo. Summary: The new version of debuginfo-tests will have it's own lit.cfg.py file which is incompatible with the one in clang/test. This change supports both the old and new versions, and can be used until the bots actually move debuginfo-tests to either clang/test or the monorepo. This is a prerequisite for D40971. Reviewers: zturner, aprantl Subscribers: mgorny, JDevlieghere, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D41055 llvm-svn: 320494
* Revert a part of 320489 that was submitted unintentionally.Erich Keane2017-12-121-2/+1
| | | | llvm-svn: 320493
* Fix ICE when __has_unqiue_object_representations called with invalid declErich Keane2017-12-123-1/+13
| | | | llvm-svn: 320489
* [clang-format] Improve ObjC headers detection.Krasimir Georgiev2017-12-122-1/+14
| | | | | | | | | | | This patch improves detection of ObjC header files. Right now many ObjC headers, especially short ones, are categorized as C/C++. Way of filtering still isn't the best, as most likely it should be token-based. Contributed by jolesiak! llvm-svn: 320479
* [SemaCodeComplete] Allow passing out scope specifiers in qualified-id ↵Eric Liu2017-12-122-8/+37
| | | | | | | | | | | | | | completions via completion context. Reviewers: ilya-biryukov, arphaman Reviewed By: arphaman Subscribers: nik, cfe-commits Differential Revision: https://reviews.llvm.org/D40563 llvm-svn: 320471
* [analyzer] StackAddrEscape: For now, disable the new async escape checks.Artem Dergachev2017-12-124-5/+44
| | | | | | | | | | | | | | | | | The new check introduced in r318705 is useful, but suffers from a particular class of false positives, namely, it does not account for dispatch_barrier_sync() API which allows one to ensure that the asyncronously executed block that captures a pointer to a local variable does not actually outlive that variable. The new check is split into a separate checker, under the name of alpha.core.StackAddressAsyncEscape, which is likely to get enabled by default again once these positives are fixed. The rest of the StackAddressEscapeChecker is still enabled by default. Differential Revision: https://reviews.llvm.org/D41042 llvm-svn: 320455
* [analyzer] In getSVal() API, disable auto-detection of void type as char type.Artem Dergachev2017-12-124-12/+23
| | | | | | | | | | | | | | | | | | This is a follow-up from r314910. When a checker developer attempts to dereference a location in memory through ProgramState::getSVal(Loc) or ProgramState::getSVal(const MemRegion *), without specifying the second optional QualType parameter for the type of the value he tries to find at this location, the type is auto-detected from location type. If the location represents a value beyond a void pointer, we thought that auto-detecting the type as 'char' is a good idea. However, in most practical cases, the correct behavior would be to specify the type explicitly, as it is available from other sources, and the few cases where we actually need to take a 'char' are workarounds rather than an intended behavior. Therefore, try to fail with an easy-to-understand assertion when asked to read from a void pointer location. Differential Revision: https://reviews.llvm.org/D38801 llvm-svn: 320451
* [Driver][CodeGen] Add -mprefer-vector-width driver option and attribute ↵Craig Topper2017-12-118-0/+79
| | | | | | | | | | | | | | | | during CodeGen. This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend. Clang will take the value and add it as a new function attribute during CodeGen. This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values. Differential Revision: https://reviews.llvm.org/D40230 llvm-svn: 320419
* [Docs] Regenerate command line documentation.Craig Topper2017-12-111-8/+22
| | | | llvm-svn: 320418
* PR35586: Relax two asserts that are overly restrictiveErich Keane2017-12-112-2/+9
| | | | | | | | | The two asserts are too aggressive. In C++ mode, an enum is NOT considered an integral type, but an enum value is allowed to be an enum. This patch relaxes the two asserts to allow the enum value as well (as typechecking does). llvm-svn: 320411
* [Hexagon] Remove unsupported vlut intrinsicsKrzysztof Parzyszek2017-12-111-16/+0
| | | | llvm-svn: 320410
* Fix warn-enum-compare.cpp on WindowsHans Wennborg2017-12-111-1/+6
| | | | | | It's been failing since r319875. llvm-svn: 320405
* P0620 follow-up: deducing `auto` from braced-init-list in new exprZhihao Yuan2017-12-116-10/+41
| | | | | | | | | | | | | | | | | | | Summary: This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from `auto` and `decltype(auto)`) to be usable in a `new` expression with a single-clause //braced-init-list// as its initializer (8.3.4 [expr.new]/2). N3922 defined its semantics. References: http://wg21.link/p0620r0 http://wg21.link/n3922 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39451 llvm-svn: 320401
* Revert 320391: Certain targets are failing, pulling back to diagnose.Erich Keane2017-12-1124-155/+58
| | | | llvm-svn: 320398
* [Sema] Fix crash in unused-lambda-capture warning for VLAsMalcolm Parsons2017-12-113-0/+13
| | | | | | | | | | | | | | | | | | | | Summary: Clang was crashing when diagnosing an unused-lambda-capture for a VLA because From.getVariable() is null for the capture of a VLA bound. Warning about the VLA bound capture is not helpful, so only warn for the VLA itself. Fixes: PR35555 Reviewers: aaron.ballman, dim, rsmith Reviewed By: aaron.ballman, dim Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41016 llvm-svn: 320396
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-12-1124-58/+155
| | | | | | | | | | | | | | | | | | | | As reported in llvm bugzilla 32377. Here’s a patch to add preinclude of stdc-predef.h. The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; The preinclude is inhibited with –ffreestanding. Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior. I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here Note: this is a recommit after a test failure took down the original (r318669) Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 320391
* [mips] Minor update to the comment (NFC)Aleksandar Beserminji2017-12-111-1/+1
| | | | llvm-svn: 320354
* [mips] Removal of microMIPS64R6Aleksandar Beserminji2017-12-112-0/+9
| | | | | | | | | | | microMIPS64R6 is removed from backend, and therefore frontend will show an error when target is microMIPS64R6. This is Clang part of patch. Differential Revision: https://reviews.llvm.org/D35624 llvm-svn: 320351
* Fix MSVC 'not all control paths return a value' warningSimon Pilgrim2017-12-101-0/+1
| | | | llvm-svn: 320297
* Update Clang CMake cache to use cxx-headers, NFCDuncan P. N. Exon Smith2017-12-091-1/+1
| | | | | | Apparently libcxx-headers is going away. Fixes PR35584. llvm-svn: 320271
* Switch to gnu++14 as the default dialect.Tim Northover2017-12-0915-44/+55
| | | | | | This is C++14 with conforming GNU extensions. llvm-svn: 320250
* Revert r320230 to fix buildbots.Richard Trieu2017-12-0910-456/+49
| | | | llvm-svn: 320239
* Fix Driver/darwin-version.c testAlex Lorenz2017-12-091-1/+1
| | | | | | A target argument should be provided to avoid failures on non-Darwin llvm-svn: 320238
* [driver][darwin] Refactor the target selection code, NFCAlex Lorenz2017-12-093-262/+384
| | | | | | | | | | | | | | | | | The simulator variant of Darwin's platforms is removed in favor of a new environment field. The code that selects the platform and the version is split into 4 different functions instead of being all in one function. This is an NFC commit, although it slightly improves the "invalid version number" diagnostic by displaying the environment variable instead of -m<os>-version-min if the OS version was derived from the environment. rdar://35813850 Differential Revision: https://reviews.llvm.org/D41035 llvm-svn: 320235
* Fix fsanitize-blacklist test on Windows.Evgeniy Stepanov2017-12-091-2/+2
| | | | | | Broken in r320232. llvm-svn: 320233
* Hardware-assisted AddressSanitizer (clang part).Evgeniy Stepanov2017-12-0922-21/+217
| | | | | | | | | | | | | | Summary: Driver, frontend and LLVM codegen for HWASan. A clone of ASan, basically. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D40936 llvm-svn: 320232
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-0910-49/+456
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. llvm-svn: 320230
* Don't link NetBSD programs with -ldl in linkXRayRuntimeDepsKamil Rytarowski2017-12-091-1/+2
| | | | | | | | | | | | | | | | | | | Summary: There is no such library on NetBSD, the corresponding functions like dlopen(3) are in libc. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: dberris, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41021 llvm-svn: 320220
* [CodeGen][X86] Fix handling of __fp16 vectors.Akira Hatanaka2017-12-0912-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug in IRGen where it generates completely broken code for __fp16 vectors on X86. For example when the following code is compiled: half4 hv0, hv1, hv2; // these are vectors of __fp16. void foo221() { hv0 = hv1 + hv2; } clang generates the following IR, in which two i16 vectors are added: @hv1 = common global <4 x i16> zeroinitializer, align 8 @hv2 = common global <4 x i16> zeroinitializer, align 8 @hv0 = common global <4 x i16> zeroinitializer, align 8 define void @foo221() { %0 = load <4 x i16>, <4 x i16>* @hv1, align 8 %1 = load <4 x i16>, <4 x i16>* @hv2, align 8 %add = add <4 x i16> %0, %1 store <4 x i16> %add, <4 x i16>* @hv0, align 8 ret void } To fix the bug, this commit uses the code committed in r314056, which modified clang to promote and truncate __fp16 vectors to and from float vectors in the AST. It also fixes another IRGen bug where a short value is assigned to an __fp16 variable without any integer-to-floating-point conversion, as shown in the following example: __fp16 a; short b; void foo1() { a = b; } @b = common global i16 0, align 2 @a = common global i16 0, align 2 define void @foo1() #0 { %0 = load i16, i16* @b, align 2 store i16 %0, i16* @a, align 2 ret void } rdar://problem/20625184 Differential Revision: https://reviews.llvm.org/D40112 llvm-svn: 320215
* Remove creation of out-of-bounds value of enumeration type (resulting in UB).Richard Smith2017-12-086-23/+18
| | | | | | | Also remove unnecessary initialization of out-parameters with this value, so that MSan is able to catch errors appropriately. llvm-svn: 320212
* Unify implementation of our two different flavours of -Wtautological-compare,Richard Smith2017-12-084-300/+333
| | | | | | | | | | | | | | | | | | | | | | | | | and fold together into a single function. 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 re-commits r320122 and r320124, minus two changes: * Comparisons between a constant and a non-constant expression of enumeration type never warn, not even if the constant is out of range. We should be warning about the creation of such a constant, not about its use. * We do not use more precise bit-widths for comparisons against bit-fields. The more precise diagnostics probably are the right thing, but we should consider moving them under their own warning flag. Other than the refactoring, this patch should only change the behavior for the buggy cases (where the warnings didn't take into account that promotion from signed to unsigned can leave a range of inaccessible values in the middle of the promoted type). llvm-svn: 320211
* [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-12-089-213/+278
| | | | | | minor fixes (NFC). llvm-svn: 320207
* [OPENMP] Simplify codegen for loop iteration variables in loop preamble.Alexey Bataev2017-12-087-3/+18
| | | | | | | Initial patch could cause trouble in the optimized code because of the incorrectly generated lifetime intrinsics. llvm-svn: 320191
* [ubsan] array-bounds: Ignore params with constant sizeVedant Kumar2017-12-082-10/+1
| | | | | | | | | | 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
* [hwasan] typo in docsKostya Serebryany2017-12-081-1/+1
| | | | llvm-svn: 320168
* 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-084-295/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | -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-0817-35/+2937
| | | | | | 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-082-6/+15
| | | | | | | | | | 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-082-2/+5
| | | | | | | | | | | | 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
* Add a test that the __STDC_VERSION__ macro reports the correct value for ↵Aaron Ballman2017-12-081-0/+4
| | | | | | -std=c17. llvm-svn: 320131
* [ubsan] Use pass_object_size info in bounds checksVedant Kumar2017-12-083-0/+128
| | | | | | | | | 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-084-245/+295
| | | | | | | | 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
* Correct line endings that got mixed up in r320088; NFC.Aaron Ballman2017-12-071-12/+12
| | | | llvm-svn: 320115
* 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-075-718/+718
| | | | llvm-svn: 320113
* Remove line-endings added by r320089. NFC.Ahmed Bougacha2017-12-071-185/+185
| | | | llvm-svn: 320112
OpenPOWER on IntegriCloud