summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [c++17] If a class inherits virtual functions from a base class, it isRichard Smith2018-06-142-1/+10
| | | | | | not an aggregtae. llvm-svn: 334763
* [X86] Add inline assembly versions of ↵Craig Topper2018-06-144-11/+134
| | | | | | | | | | _InterlockedExchange_HLEAcquire/Release and _InterlockedCompareExchange_HLEAcquire/Release for MSVC compatibility. Clang/LLVM doesn't have a way to pass an HLE hint through to the X86 backend to emit HLE prefixed instructions. So this is a good short term fix. Differential Revision: https://reviews.llvm.org/D47672 llvm-svn: 334751
* [CMAKE][c-index-test] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2Bruno Cardoso Lopes2018-06-141-1/+5
| | | | | | | | | | | | | On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools installed, we currently get the include path for libxml2 as /usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2. Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when possible. rdar://problem/41103601 llvm-svn: 334747
* [X86] Lowering Mask Scalar intrinsics to native IR (Clang part)Tomasz Krupa2018-06-143-76/+213
| | | | | | | | | | | | | | | Summary: Lowering add, sub, mul, and div mask scalar intrinsic calls to native IR. Reviewers: craig.topper, RKSimon, spatel, sroland Reviewed By: craig.topper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47979 llvm-svn: 334741
* [clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for ↵Ben Hamilton2018-06-142-0/+12
| | | | | | | | | | | | | | | | Objective-C 📜 Contributed by @stephanemoore. Reviewers: benhamilton, jolesiak, djasper Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47393 llvm-svn: 334739
* [Fixed Point Arithmetic] Addition of the remaining fixed point types and ↵Leonard Chan2018-06-1432-70/+1198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these 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. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
* clang-format: Fix documentation generationFrancois Ferrand2018-06-142-38/+42
| | | | | | | | | | | | | | | | | | | | Summary: It seems that the changes done to `ClangFormatStyleOptions.rst` @334408 are causing the generation of the documentation to fail, with the following error: Warning, treated as error: /llvm/tools/clang/docs/ClangFormatStyleOptions.rst:1060: WARNING: Definition list ends without a blank line; unexpected unindent. This is due to missing indent in some code block, and fixed by this patch. Reviewers: krasimir, djasper, klimek Reviewed By: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48161 llvm-svn: 334709
* [OpenCL] Support new/delete in SemaSven van Haastregt2018-06-144-4/+98
| | | | | | | | | Reject uses of the default new/delete operators with a diagnostic instead of a crash in OpenCL C++ mode and accept user-defined forms. Differential Revision: https://reviews.llvm.org/D46651 llvm-svn: 334700
* [AArch64] reverting rC334693 due to build failuresLuke Geeson2018-06-143-17/+0
| | | | llvm-svn: 334696
* [AArch64] Added support for the vcvta_u16_f16 instrinsic for FP16 Armv8.2-ALuke Geeson2018-06-143-0/+17
| | | | llvm-svn: 334693
* [clang-format] Add SpaceBeforeCpp11BracedList option.Hans Wennborg2018-06-145-0/+37
| | | | | | | | | | | | | | | | | | | | WebKit C++ style for object initialization is as follows: Foo foo { bar }; Yet using clang-format -style=webkit changes this to: Foo foo{ bar }; As there is no existing combination of rules that will ensure a space before a braced list in this fashion, this patch adds a new SpaceBeforeCpp11BracedList rule. Patch by Ross Kirsling! Differential Revision: https://reviews.llvm.org/D46024 llvm-svn: 334692
* [analyzer] Re-enable C++17-specific RVO construction contexts.Artem Dergachev2018-06-142-18/+70
| | | | | | | | | | | | | | | | | | | Not contexts themselves, but rather support for them in the analyzer. Such construction contexts appear when C++17 mandatory copy elision occurs while returning an object from a function, and presence of a destructor causes a CXXBindTemporaryExpr to appear in the AST. Additionally, such construction contexts may be chained, because a return-value construction context doesn't really explain where the object is being returned into, but only points to the parent stack frame, where the object may be consumed by literally anything including another return statement. This behavior is now modeled correctly by the analyzer as long as the object is not returned beyond the boundaries of the analysis. Differential Revision: https://reviews.llvm.org/D47405 llvm-svn: 334684
* [analyzer] Re-enable C++17-specific variable and member construction contexts.Artem Dergachev2018-06-142-3/+122
| | | | | | | | | | | | | | Not contexts themselves, but rather support for them in the analyzer. Such construction contexts appear when C++17 mandatory copy elision occurs during initialization, and presence of a destructor causes a CXXBindTemporaryExpr to appear in the AST. Similar C++17-specific constructors for return values are still to be supported. Differential Revision: https://reviews.llvm.org/D47351 llvm-svn: 334683
* [analyzer] Track class member initializer constructors path-sensitively.Artem Dergachev2018-06-144-67/+148
| | | | | | | | | | | | | | | The reasoning behind this change is similar to the previous commit, r334681. Because members are already in scope when construction occurs, we are not suffering from liveness problems, but we still want to figure out if the object was constructed with construction context, because in this case we'll be able to avoid trivial copy, which we don't always model perfectly. It'd also have more importance when copy elision is implemented. This also gets rid of the old CFG look-behind mechanism. Differential Revision: https://reviews.llvm.org/D47350 llvm-svn: 334682
* [analyzer] pr37270: Track constructor target region, even if just a variable.Artem Dergachev2018-06-144-44/+31
| | | | | | | | | | | | | | | | | | | | | | The very idea of construction context implies that first the object is constructed, and then later, in a separate moment of time, the constructed object goes into scope, i.e. becomes "live". Most construction contexts require path-sensitive tracking of the constructed object region in order to compute the outer expressions accordingly before the object becomes live. Semantics of simple variable construction contexts don't immediately require that such tracking happens in path-sensitive manner, but shortcomings of the analyzer force us to track it path-sensitively as well. Namely, whether construction context was available at all during construction is a path-sensitive information. Additionally, path-sensitive tracking takes care of our liveness problems that kick in as the temporal gap between construction and going-into-scope becomes larger (eg., due to copy elision). Differential Revision: https://reviews.llvm.org/D47305 llvm-svn: 334681
* [analyzer] NFC: Merge code for finding and tracking construction target.Artem Dergachev2018-06-144-143/+103
| | | | | | | | | | | | | | When analyzing C++ code, a common operation in the analyzer is to discover target region for object construction by looking at CFG metadata ("construction contexts"), and then track the region path-sensitively until object construction is resolved, where the amount of information, again, depends on construction context. Scan construction context only once for both purposes. Differential Revision: https://reviews.llvm.org/D47304 llvm-svn: 334678
* P0096R5, P0941R2: Update to match latest feature test macro specification.Richard Smith2018-06-143-67/+91
| | | | llvm-svn: 334677
* [www] Update cxx_status page for Rapperswil motions.Richard Smith2018-06-141-4/+47
| | | | llvm-svn: 334674
* Driver: De-duplicate some code. NFCI.Peter Collingbourne2018-06-141-2/+1
| | | | llvm-svn: 334673
* docs: Add a missing LTO visibility reference.Peter Collingbourne2018-06-131-4/+5
| | | | llvm-svn: 334671
* docs: Correct some misstatements in the control flow integrity docs.Peter Collingbourne2018-06-131-9/+10
| | | | | | These were true at one point but haven't been true for a long time. llvm-svn: 334669
* Simplify test from r334650Erich Keane2018-06-131-12/+6
| | | | | | | No reason to have the 'bool' as an intermediary value, simply use the fact that curley braces enforce eval order. llvm-svn: 334652
* Implement constexpr __builtin_*_overflowErich Keane2018-06-132-0/+202
| | | | | | | | | As requested here:https://bugs.llvm.org/show_bug.cgi?id=37633 permit the __builtin_*_overflow builtins in constexpr functions. Differential Revision: https://reviews.llvm.org/D48040 llvm-svn: 334650
* [COFF] Add ARM64 intrinsics: __yield, __wfe, __wfi, __sev, __sevlMandeep Singh Grang2018-06-133-0/+46
| | | | | | | | | | | | | | Summary: These intrinsics result in hint instructions. They are provided here for MSVC ARM64 compatibility. Reviewers: mstorsjo, compnerd, javed.absar Reviewed By: mstorsjo Subscribers: kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D48132 llvm-svn: 334639
* [analyzer] Fix offset overflow check in MemRegionGeorge Karpenkov2018-06-132-43/+14
| | | | | | | | | rdar://39593879 https://bugs.llvm.org/show_bug.cgi?id=37142 Differential Revision: https://reviews.llvm.org/D48139 llvm-svn: 334636
* [CodeGen] make nan builtins pure rather than const (PR37778)Sanjay Patel2018-06-132-25/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=37778 ...shows a miscompile resulting from marking nan builtins as 'const'. The nan libcalls/builtins take a pointer argument: http://www.cplusplus.com/reference/cmath/nan-function/ ...and the chars dereferenced by that arg are used to fill in the NaN constant payload bits. "const" means that the pointer argument isn't dereferenced. That's translated to "readnone" in LLVM. "pure" means that the pointer argument may be dereferenced. That's translated to "readonly" in LLVM. This change prevents the IR optimizer from killing the lead-up to the nan call here: double a() { char buf[4]; buf[0] = buf[1] = buf[2] = '9'; buf[3] = '\0'; return __builtin_nan(buf); } ...the optimizer isn't currently able to simplify this to a constant as we might hope, but this patch should solve the miscompile. Differential Revision: https://reviews.llvm.org/D48134 llvm-svn: 334628
* [Basic] Fix -Wreorder warningBenjamin Kramer2018-06-131-15/+12
| | | | | | Just use field initializers that don't suffer from this problem llvm-svn: 334619
* [PowerPC] The __float128 type should only be available on Power9Stefan Pintilie2018-06-135-116/+127
| | | | | | | | | | | | Diasble the use of the type __float128 for PPC machines older than Power9. The use of -mfloat128 for PPC machine older than Power9 will result in an error. Differential Revision: https://reviews.llvm.org/D48088 llvm-svn: 334613
* [libclang] Make c-index-test.c ISO C90 compliant.Matt Morehouse2018-06-131-1/+1
| | | | | | Fixes a build bot breakage caused by r334593. llvm-svn: 334612
* Add -fforce-emit-vtablesPiotr Padlewski2018-06-1311-3/+182
| | | | | | | | | | | | | | | | | | | Summary: In many cases we can't devirtualize because definition of vtable is not present. Most of the time it is caused by inline virtual function not beeing emitted. Forcing emitting of vtable adds a reference of these inline virtual functions. Note that GCC was always doing it. Reviewers: rjmccall, rsmith, amharc, kuhar Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D47108 Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> llvm-svn: 334600
* Correct behavior of __builtin_*_overflow and constexpr.Erich Keane2018-06-132-9/+36
| | | | | | | | | | Enable these builtins to be called across a lambda boundary with captureless const/constexpr, as brought up by Eli here: https://reviews.llvm.org/D48040 Differential Revision: https://reviews.llvm.org/D48053 llvm-svn: 334597
* [libclang] Optionally add code completion results for arrow instead of dotIvan Donchevskii2018-06-137-41/+310
| | | | | | | | Follow up for D41537 - libclang part. Differential Revision: https://reviews.llvm.org/D46862 llvm-svn: 334593
* [X86] Remove masking from avx512vbmi2 concat and shift by immediate ↵Craig Topper2018-06-137-416/+326
| | | | | | builtins. Use select builtins instead. llvm-svn: 334577
* crash-report-modules.m: Shorten path length to make Windows bot happyHans Wennborg2018-06-131-7/+10
| | | | llvm-svn: 334574
* Remove extraneous semicolon.Bill Wendling2018-06-131-1/+1
| | | | llvm-svn: 334573
* [Sema] When the address of a member function is used as a templateAkira Hatanaka2018-06-132-2/+55
| | | | | | | | | | | | | argument, use the context in which it is used for checking its accessibility. This fixes PR32898. rdar://problem/33737747 Differential Revision: https://reviews.llvm.org/D36918 llvm-svn: 334569
* Fix crash emitting transparent list initializer for a large aggregate.Richard Smith2018-06-132-4/+18
| | | | llvm-svn: 334565
* [CUDA][HIP] Allow CUDA __global__ functions to have amdgpu kernel attributesYaxun Liu2018-06-125-67/+76
| | | | | | | | | | | | There are HIP applications e.g. Tensorflow 1.3 using amdgpu kernel attributes, however currently they are only allowed on OpenCL kernel functions. This patch will allow amdgpu kernel attributes to be applied to CUDA/HIP __global__ functions. Differential Revision: https://reviews.llvm.org/D47958 llvm-svn: 334561
* [analyzer] Do not crash in the visitor when the function is given more ↵George Karpenkov2018-06-122-1/+16
| | | | | | | | | | arguments than it has parameters rdar://40335545 Differential Revision: https://reviews.llvm.org/D48107 llvm-svn: 334560
* [analyzer] Ensure that loop widening does not invalidate referencesMatthew Voss2018-06-122-0/+33
| | | | | | | | | | Loop widening can invalidate a reference. If the analyzer attempts to visit the destructor to a non-existent reference, it will crash. This patch ensures that the reference is preserved. https://reviews.llvm.org/D47044 llvm-svn: 334554
* [CMake][Darwin] Match cxx-headers -> cxx_headers libcxx target rename.Ahmed Bougacha2018-06-121-1/+1
| | | | | | This was changed in r334477. llvm-svn: 334550
* [analyzer] [NFC] Remove "removeInvalidation" from visitor APIGeorge Karpenkov2018-06-122-9/+3
| | | | | | | | | | | removeInvalidation is a very problematic API, as it makes suppression order-dependent. Moreover, it was used only once, and could be rewritten in a much cleaner way. Differential Revision: https://reviews.llvm.org/D48045 llvm-svn: 334542
* [analyzer] [NFC] Move ::dump methods from BugReporter.cpp to PathDiagnostics.cppGeorge Karpenkov2018-06-123-104/+106
| | | | | | | | | | BugReporter.cpp is already severely overloaded, and those dump methods are on PathDiagnostics and should belong in the corresponding implementation file. Differential Revision: https://reviews.llvm.org/D48035 llvm-svn: 334541
* [analyzer] [NFC] Remove most usages of getEndPathGeorge Karpenkov2018-06-123-24/+33
| | | | | | | | | | | | | | | getEndPath is a problematic API, because it's not clear when it's called (hint: not always at the end of the path), it crashes at runtime with more than one non-nullptr returning implementation, and diagnostics internal depend on it being called at some exact place. However, most visitors don't actually need that: all they want is a function consistently called after all nodes are traversed, to perform finalization and to decide whether invalidation is needed. Differential Revision: https://reviews.llvm.org/D48042 llvm-svn: 334540
* Work around false -Wmissing-braces warning from old clang which has been ↵Fangrui Song2018-06-121-1/+1
| | | | | | fixed in r314838 llvm-svn: 334539
* [AArch64] Support reserving x20 registerPetr Hosek2018-06-124-0/+13
| | | | | | | | | | | | Register x20 is a callee-saved register which may be used for other purposes in certain contexts, for example to hold special variables within the kernel. This change adds support for reserving this register both to frontend and backend to make this register usable for these purposes. Differential Revision: https://reviews.llvm.org/D46552 llvm-svn: 334531
* [clang-format] Fix crash while reflowing backslash in commentsKrasimir Georgiev2018-06-122-7/+53
| | | | | | | | | | | | | | | | | | | | | Summary: The added test case was currently crashing with an assertion: ``` krasimir@krasimir> cat test.cc ~ // How to run: // bbbbb run \ // rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \ // <log_file> -- --output_directory="<output_directory>" krasimir@krasimir> ~/work/llvm-build/bin/clang-format test.cc ~ clang-format: /usr/local/google/home/krasimir/work/llvm/tools/clang/lib/Format/WhitespaceManager.cpp:117: void clang::format::WhitespaceManager::calculateLineBreakInformation(): Assertion `PreviousOriginalWhitespaceEndOffset <= OriginalWhitespaceStartOffset' failed. ``` The root cause was that BreakableToken was not considering the case of a reflow between an unescaped newline in a line comment. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48089 llvm-svn: 334527
* [analyzer] [NFC] Now let's have only one place for diagnostics generationGeorge Karpenkov2018-06-121-43/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D47808 llvm-svn: 334526
* [analyzer] [NFC] Unify Minimal and Extensive diagnostics.George Karpenkov2018-06-121-286/+243
| | | | | | | | | | Once we removed AlternateExtensive, I've looked closer into the difference between Minimal and Extensive, and turns out, the difference was not that large. Differential Revision: https://reviews.llvm.org/D47756 llvm-svn: 334525
* [analyzer] [NFC] Remove unused Extensive diagnostic setting,George Karpenkov2018-06-1232-4009/+3029
| | | | | | | | | | | | | | Rename AlternateExtensive to Extensive. In 2013, five years ago, we have switched to AlternateExtensive diagnostics by default, and Extensive was available under unused, undocumented flag. This change remove the flag, renames the Alternate diagnostic to Extensive (as it's no longer Alternate), and ports the test. Differential Revision: https://reviews.llvm.org/D47670 llvm-svn: 334524
OpenPOWER on IntegriCloud