summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [LLD][ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands.George Rimar2019-04-264-3/+36
| | | | | | | | | | | | | | | This is https://bugs.llvm.org//show_bug.cgi?id=38750. If script references empty sections in LOADADDR/ADDR commands .empty : { *(.empty ) } .text : AT(LOADADDR (.empty) + SIZEOF (.empty)) { *(.text) } then an empty section will be removed and LOADADDR/ADDR will evaluate to null. It is not that user may expect from using of the generic script, what is a common case. Differential revision: https://reviews.llvm.org/D54621 llvm-svn: 359279
* Fix typos: (re)?sor?uce -> (re)?sourceFangrui Song2019-04-264-4/+4
| | | | | | | | | | | Closes: https://github.com/llvm/llvm-project/pull/10 In-collaboration-with: Olivier Cochard-Labbé <olivier@FreeBSD.org> Signed-off-by: Enji Cooper <yaneurabeya@gmail.com> Differential Revision: https://reviews.llvm.org/D61021 llvm-svn: 359277
* Revert "[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap"Vitaly Buka2019-04-265-34/+13
| | | | | | | | New static_assert fails on a bot. This reverts commit r359269. llvm-svn: 359276
* Fix r359229 which tried to fix r359159...Chandler Carruth2019-04-261-1/+1
| | | | | | | | When r359229 added noexcept to the declaration of `~mutex`, it didn't add it to the definition which caused -Wimplicit-exception-spec-mismatch to fire. This just adapts the definition to agree with the declaration. llvm-svn: 359275
* NFC: Clang-format msan_allocator.ccVitaly Buka2019-04-261-61/+61
| | | | llvm-svn: 359270
* [lsan] Use SANITIZER_WORDSIZE when selecting ByteMapVitaly Buka2019-04-265-13/+34
| | | | | | | Originally this code as added for 64-bit platform and was never changed. Add static_assert to make sure that we have correct map on all platforms. llvm-svn: 359269
* [ELF] Change std::max<uint64_t> to uint32_t for section alignmentFangrui Song2019-04-261-3/+3
| | | | | | | | | | | | | Summary: We use `uint32_t SectionBase::Alignment` and `uint32_t PhdrEntry::p_align` despite alignments being 64 bits in ELF64. Fix the std::max template arguments accordingly. The currently 160-byte InputSection will become 168 bytes if we make SectionBase::Alignment uint64_t. Differential Revision: https://reviews.llvm.org/D61171 llvm-svn: 359268
* [NFC] Add baseline tests for int isKnownNonZeroDan Robertson2019-04-262-0/+197
| | | | | | | | Add baseline tests for improvements of isKnownNonZero for integer types. Differential Revision: https://reviews.llvm.org/D60932 llvm-svn: 359267
* PR41607: Don't forget to substitute outer template arguments into aRichard Smith2019-04-263-5/+45
| | | | | | class-scope explicit specialization of a class template. llvm-svn: 359266
* [llvm-objcopy] Accept --long-option but not -long-optionFangrui Song2019-04-266-60/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-{objcopy,strip} (and many other LLVM binary utilities) accept cl::opt style -long-option as well as many short options (e.g. -p -S -x). People who use them as replacement of GNU binutils often use the grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x, -Wd => -W -d, -sj.text => -s -j.text There is ambiguity if a long option starts with the character used by a short option. Drop the support for -long-option to resolve the ambiguity. This divergence from other utilities is accepted (other utilities continue supporting -long-option). https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola Reviewed By: jakehehrlich, jhenderson, rupprecht Subscribers: grimar, emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60439 llvm-svn: 359265
* [analyzer] RetainCount: Add a suppression for "the Matching rule".Artem Dergachev2019-04-262-14/+44
| | | | | | | | | | | | | | | | In the OSObject universe there appears to be another slightly popular contract, apart from "create" and "get", which is "matching". It optionally consumes a "table" parameter and if a table is passed, it fills in the table and returns it at +0; otherwise, it creates a new table, fills it in and returns it at +1. For now suppress false positives by doing a conservative escape on all functions that end with "Matching", which is the naming convention that seems to be followed by all such methods. Differential Revision: https://reviews.llvm.org/D61161 llvm-svn: 359264
* [analyzer] RetainCount: Allow offsets in return values.Artem Dergachev2019-04-262-2/+36
| | | | | | | | | | | | | | | | | | Because RetainCountChecker has custom "local" reasoning about escapes, it has a separate facility to deal with tracked symbols at end of analysis and check them for leaks regardless of whether they're dead or not. This facility iterates over the list of tracked symbols and reports them as leaks, but it needs to treat the return value specially. Some custom allocators tend to return the value with an offset, storing extra metadata at the beginning of the buffer. In this case the return value would be a non-base region. In order to avoid false positives, we still need to find the original symbol within the return value, otherwise it'll be unable to match it to the item in the list of tracked symbols. Differential Revision: https://reviews.llvm.org/D60991 llvm-svn: 359263
* [analyzer] Fix crash when returning C++ objects from ObjC messages-to-nil.Artem Dergachev2019-04-262-1/+32
| | | | | | | | | | | the assertion is in fact incorrect: there is a cornercase in Objective-C++ in which a C++ object is not constructed with a constructor, but merely zero-initialized. Namely, this happens when an Objective-C message is sent to a nil and it is supposed to return a C++ object. Differential Revision: https://reviews.llvm.org/D60988 llvm-svn: 359262
* [www] Rebuild cxx_dr_status.Richard Smith2019-04-262-14173/+14233
| | | | llvm-svn: 359261
* C++ DR2387: a variable template declared wtih (or instantiated with) aRichard Smith2019-04-267-43/+133
| | | | | | | | | const-qualified type is not implicitly given internal linkage. But a variable template declared 'static' is. This reinstates part of r359048, reverted in r359076. llvm-svn: 359260
* Add missing diagnostic for explicit instantiation declarations namingRichard Smith2019-04-265-26/+84
| | | | | | | | | | | | | | | | | internal linkage entities. Such constructs are ill-formed by [temp.explicit]p13. We make a special exception to permit an invalid construct used by libc++ in some build modes: its <valarray> header declares some functions with the internal_linkage attribute and then (meaninglessly) provides explicit instantiation declarations for them. Luckily, Clang happens to effectively ignore the explicit instantiation declaration when generating code in this case, and this change codifies that behavior. This reinstates part of r359048, reverted in r359076. (The libc++ issue triggering the rollback has been addressed.) llvm-svn: 359259
* Revert lib/Header: Fix Visual Studio buildsTom Stellard2019-04-261-1/+1
| | | | | | | | This reverts r359257 (git commit 00d9789509a4c573a48f60893b95314a119edd42) This broke check-clang. llvm-svn: 359258
* lib/Header: Fix Visual Studio buildsTom Stellard2019-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: This is a follow up to r355253, which inadvertently broke Visual Studio builds by trying to copy files from CMAKE_CFG_INTDIR. See https://reviews.llvm.org/D58537#inline-532492 Reviewers: smeenai, vzakhari, phosek Reviewed By: smeenai Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61054 llvm-svn: 359257
* add tuple_cat test for const TEric Fiselier2019-04-261-6/+6
| | | | llvm-svn: 359256
* Fix return type of std::tuple_cat.Eric Fiselier2019-04-262-2/+17
| | | | | | | | | | | | When the arguments to tuple cat were const, the const was incorrectly propagated into the type of the resulting tuple. For example: const std::tuple<int> t(42); auto r = std::tuple_cat(t, t); // Incorrect! should be std::tuple<int, int>. static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>); llvm-svn: 359255
* [libFuzzer] Disable MSan interceptors in SIGINT handler.Matt Morehouse2019-04-262-1/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: Avoids an MSan false positive if the SIGINT comes while the user callback is running. The false positive happens when the interrupt handler calls opendir() to remove some temporary files, which is intercepted by MSan. Fixes https://github.com/google/oss-fuzz/issues/2332. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, Dor1s, metzman Tags: #llvm Differential Revision: https://reviews.llvm.org/D61163 llvm-svn: 359254
* [GlobalOpt] Swap the expensive check for cold calls with the cheap TTI checkJustin Bogner2019-04-261-2/+2
| | | | | | | | | | | isValidCandidateForColdCC is much more expensive than TTI.useColdCCForColdCall, which by default just returns false. Avoid doing this work if we're not going to look at the answer anyway. This change is NFC, but I see significant compile time improvements on some code with pathologically many functions. llvm-svn: 359253
* [ORC] Remove symbols from dependency lists when failing materialization.Lang Hames2019-04-253-3/+68
| | | | | | | | | When failing materialization of a symbol X, remove X from the dependants list of any of X's dependencies. This ensures that when X's dependencies are emitted (or fail themselves) they do not try to access the no-longer-existing MaterializationInfo for X. llvm-svn: 359252
* Revert [COFF] Statically link certain runtime library functionsReid Kleckner2019-04-255-31/+8
| | | | | | | | | This reverts r359250 (git commit 4730604bd3a361c68b92b18bf73a5daa15afe9f4) The newly added test should use -cc1 and -emit-llvm and there are other test failures that need fixing. llvm-svn: 359251
* [COFF] Statically link certain runtime library functionsReid Kleckner2019-04-255-8/+31
| | | | | | | | | | | | | | | | | | | Statically link certain runtime library functions for MSVC/GNU Windows environments. This is consistent with MSVC behavior. Fixes LNK4286 and LNK4217 warnings from link.exe when linking the static CRT: LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-calls.o' LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-calls.o' LINK : warning LNK4217: symbol '_CxxThrowException' defined in 'libvcruntime.lib(throw.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-calls.o' in function '"int `public: static class UnitTest::GetInstance * __cdecl testing::UnitTest::GetInstance(void)'::`1'::dtor$5" (?dtor$5@?0??GetInstance@UnitTest@testing@@SAPEAV12@XZ@4HA)' Reviewers: mstorsjo, efriedma, TomTan, compnerd, smeenai, mgrang Subscribers: abdulras, theraven, smeenai, pcc, mehdi_amini, javed.absar, inglorion, kristof.beyls, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D55229 llvm-svn: 359250
* [TestTemplateFunction] Add a missing debug info variant.Davide Italiano2019-04-251-1/+1
| | | | llvm-svn: 359249
* [CUDA] Implemented _[bi]mma* builtins.Artem Belevich2019-04-257-226/+1509
| | | | | | | | | | | | | | | | These builtins provide access to the new integer and sub-integer variants of MMA (matrix multiply-accumulate) instructions provided by CUDA-10.x on sm_75 (AKA Turing) GPUs. Also added a feature for PTX 6.4. While Clang/LLVM does not generate any PTX instructions that need it, we still need to pass it through to ptxas in order to be able to compile code that uses the new 'mma' instruction as inline assembly (e.g used by NVIDIA's CUTLASS library https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101) Differential Revision: https://reviews.llvm.org/D60279 llvm-svn: 359248
* PTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.Artem Belevich2019-04-255-167/+809
| | | | | | | | | | | | All of the new instructions are still handled mostly by tablegen. I've slightly refactored the code to drive intrinsic/instruction generation from a master list of supported variants, so all irregularities have to be implemented in one place only. The test generation script wmma.py has been refactored in a similar way. Differential Revision: https://reviews.llvm.org/D60015 llvm-svn: 359247
* [NVPTX] generate correct MMA instruction mnemonics with PTX63+.Artem Belevich2019-04-255-132/+184
| | | | | | | | | | | PTX 6.3 requires using ".aligned" in the MMA instruction names. In order to generate correct name, now we pass current PTX version to each instruction as an extra constant operand and InstPrinter adjusts its output accordingly. Differential Revision: https://reviews.llvm.org/D59393 llvm-svn: 359246
* [NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.Artem Belevich2019-04-252-475/+295
| | | | | | | | | | | | | | | Generalized constructions of 'fragments' of MMA operations to provide common primitives for construction of the ops. This will make it easier to add new variants of the instructions that operate on integer types. Use nested foreach loops which makes it possible to better control naming of the intrinsics. This patch does not affect LLVM's output, so there are no test changes. Differential Revision: https://reviews.llvm.org/D59389 llvm-svn: 359245
* [Object][XCOFF] Add intial support for section header table.Sean Fertile2019-04-257-31/+192
| | | | | | | | | Adds a representation of the section header table to XCOFFObjectFile, and implements enough to dump the section headers with llvm-obdump. Differential Revision: https://reviews.llvm.org/D60784 llvm-svn: 359244
* Remove incorrect explicit instantiation declarations for valarrayRichard Smith2019-04-253-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | libc++ ABI v1 provides three valarray symbols as part of the shared library: valarray<size_t>::valarray(size_t) valarray<size_t>::~valarray() valarray<size_t>::resize(size_t, size_t) The first two of these are intended to be removed in V2 of the ABI: they're attributed _LIBCPP_HIDE_FROM_ABI_AFTER_V1, and it appears that the intention is that these symbols from the library are not used even when building using the V1 ABI. However, there are explicit instantiation declarations for all three symbols in the header, which are not correct as we do not intend to find an instantiation of these functions that is provided elsewhere. (A recent change to clang to properly diagnose explicit instantiation declarations of internal linkage functions -- required by [temp.explicit]p13 -- had to be rolled back because it diagnosed these explicit instantiations.) Remove the explicit instantiation declarations, and remove the explicit instantiation definitions for V2 of the libc++ ABI onwards. llvm-svn: 359243
* [CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPCKeno Fischer2019-04-251-0/+2
| | | | | | | | | | | | Summary: This value is derived from the host triple, which on the machine I'm currently using is `ppc64le-linux-redhat`. This change makes LLVM compile. Reviewers: nemanjai Differential Revision: https://reviews.llvm.org/D57118 llvm-svn: 359242
* [PGO] Fix buildbot failure in 359215Rong Xu2019-04-251-2/+0
| | | | | | | Revert the part of changes in r359215 that failing in some platforms. I will re-enable them later. llvm-svn: 359241
* Another use of the interactive lldb.debugger.Jason Molenda2019-04-251-1/+1
| | | | llvm-svn: 359240
* [AMDGPU] gfx1010 - fix ubsan failureStanislav Mekhanoshin2019-04-251-1/+0
| | | | | | | Revert DecoderNamespace in one place for now. It will need more changes to properly work. llvm-svn: 359239
* [x86] add tests for vector fdiv reciprocal estimate; NFCSanjay Patel2019-04-251-0/+64
| | | | llvm-svn: 359238
* [analyzer] Add FIXMEs for alpha.unix.cstring.OutOfBounds false positives.Artem Dergachev2019-04-252-0/+5
| | | | | | | Caused by incorrect strlcat() modeling in r332303, cf. https://bugs.llvm.org/show_bug.cgi?id=37687#c8 llvm-svn: 359237
* Assigning to a local object in a return statement prevents copy elision. NFC.David Blaikie2019-04-255-13/+24
| | | | | | | | | | | | | | | | I added a diagnostic along the lines of `-Wpessimizing-move` to detect `return x = y` suppressing copy elision, but I don't know if the diagnostic is really worth it. Anyway, here are the places where my diagnostic reported that copy elision would have been possible if not for the assignment. P1155R1 in the post-San-Diego WG21 (C++ committee) mailing discusses whether WG21 should fix this pitfall by just changing the core language to permit copy elision in cases like these. (Kona update: The bulk of P1155 is proceeding to CWG review, but specifically *not* the parts that explored the notion of permitting copy-elision in these specific cases.) Reviewed By: dblaikie Author: Arthur O'Dwyer Differential Revision: https://reviews.llvm.org/D54885 llvm-svn: 359236
* Skip type units/type uniquing when we know we're only emitting the type once ↵David Blaikie2019-04-254-10/+30
| | | | | | | | | | | | | | | (vtable-based emission when triggered by a strong vtable, with -fno-standalone-debug) (this would regress size without a corresponding LLVM change that avoids putting other user defined types inside type units when they aren't in their own type units - instead emitting declarations inside the type unit and a definition in the primary CU) Reviewers: aprantl Differential Revision: https://reviews.llvm.org/D61079 llvm-svn: 359235
* Two tests were using the interactive convenience variableJason Molenda2019-04-252-3/+3
| | | | | | | lldb.debugger. They should not be. <rdar://problem/50210340> llvm-svn: 359234
* [Windows] Separate elements in -print-search-dirs with semicolonsMartin Storsjo2019-04-251-2/+2
| | | | | | | | | | | | | | Path lists on windows should always be separated by semicolons, not colons. Reuse llvm::sys::EnvPathSeparator for this purpose (as that's also a path list that is separated in the same way). Alternatively, this could just be a local ifdef _WIN32 in this function, or generalizing the existing EnvPathSeparator to e.g. a llvm::sys::path::PathListSeparator? Differential Revision: https://reviews.llvm.org/D61121 llvm-svn: 359233
* Remove libc++ checks and workarounds for unsupported old versions of GCC (<4.9).Richard Smith2019-04-253-68/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D61107 llvm-svn: 359232
* [GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16sJessica Paquette2019-04-252-2/+25
| | | | | | | | This case was missing before, so we couldn't legalize it. Add it to AArch64LegalizerInfo.cpp and update select-extract-vector-elt.mir. llvm-svn: 359231
* [analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as ↵Kristof Umann2019-04-252-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | primitive https://bugs.llvm.org/show_bug.cgi?id=41590 For the following code snippet, UninitializedObjectChecker crashed: struct MyAtomicInt { _Atomic(int) x; MyAtomicInt() {} }; void entry() { MyAtomicInt b; } The problem was that _Atomic types were not regular records, unions, dereferencable or primitive, making the checker hit the llvm_unreachable at lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:347. The solution is to regard these types as primitive as well. The test case shows that with this addition, not only are we able to get rid of the crash, but we can identify x as uninitialized. Differential Revision: https://reviews.llvm.org/D61106 llvm-svn: 359230
* Fix buildbot failures after r359159.Richard Smith2019-04-251-1/+1
| | | | | | | | | | | | | std::mutex was not actually is_nothrow_default_constructible in C++98/C++03, because the variable declaration std::mutex M; ... could throw an exception from the mutex destructor. Fix it by marking the destructor as non-throwing. This has no effect in C++11 onwards, because destructors are non-throwing by default in those language modes. llvm-svn: 359229
* [lldb] [lit] Use constexpr and better constraints in Register testsMichal Gorny2019-04-252-37/+37
| | | | | | | | | | | | Use constexpr to explicitly indicate that we're dealing with integer constants, and provoke clang to assign them straight to registers whenever possible. Adjust input constraints in %mmN tests to "rm" as using integer constants is apparently disallowed there. Also use "i" for %rN tests, as we don't want clang to accidentally clobber those general purpose registers while assigning to them (however unlikely that is). llvm-svn: 359228
* Set _LIBCPP_DLL_VIS on _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS in MinGW modeMartin Storsjo2019-04-251-2/+7
| | | | | | | | | | Contrary to MSVC, MinGW compilers wants the dllexport attribute on the declaration of an explicit template instantiation, not on the definition. Differential Revision: https://reviews.llvm.org/D61123 llvm-svn: 359227
* [ObjC][ARC] Let ARC optimizer bail out if the number of pointer statesAkira Hatanaka2019-04-252-2/+68
| | | | | | | | | | | | | | | | | | | | it keeps track of becomes too large ARC optimizer does a top-down and a bottom-up traversal of the whole function to pair up retain and release instructions and remove them. This can be expensive if the number of instructions in the function and pointer states it tracks are large since it has to look at each pointer state and determine whether the instruction being visited can potentially use the pointer. This patch adds a command line option that sets a limit to the number of pointers it tracks. rdar://problem/49477063 Differential Revision: https://reviews.llvm.org/D61100 llvm-svn: 359226
* [AMDGPU] gfx1010 VOP1 instructionsStanislav Mekhanoshin2019-04-256-102/+306
| | | | | | Differential Revision: https://reviews.llvm.org/D61099 llvm-svn: 359225
OpenPOWER on IntegriCloud