summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Remove accidentally committed lines.George Karpenkov2018-06-181-4/+1
| | | | llvm-svn: 334965
* Fix a bug introduced by rL334850Tomasz Krupa2018-06-181-2/+2
| | | | | | | | | | | | | | | Summary: All *_sqrt_round_s[s|d] intrinsics should execute a square root on zeroth element from B (Ops[1]) and insert in to A (Ops[0]), not the other way around. Reviewers: itaraban, craig.topper Reviewed By: craig.topper Subscribers: craig.topper, cfe-commits Differential Revision: https://reviews.llvm.org/D48288 llvm-svn: 334964
* [OPENMP, NVPTX] Emit simple reduction if requested.Alexey Bataev2018-06-181-0/+6
| | | | | | | If simple reduction is requested, use the simple reduction instead of the runtime functions calls. llvm-svn: 334962
* [analyzer] Checker for uninitialized C++ objectsKristof Umann2018-06-182-0/+670
| | | | | | | | | | | | | | | | | | This checker analyzes C++ constructor calls, and reports uninitialized fields. Due to the nature of this problem (uninitialized fields after an object construction), this checker doesn't search for bugs, but rather is a tool to enforce a specific programming model where every field needs to be initialized. This checker lands in alpha for now, and a number of followup patches will be made to reduce false negatives and to make it easier for the user to understand what rules the checker relies on, eg. whether a derived class' constructor is responsible for initializing inherited data members or whether it should be handled in the base class' constructor. Differential Revision: https://reviews.llvm.org/D45532 llvm-svn: 334935
* [analyzer] Add method to the generic SMT API to dump the SMT formulaMikhail R. Gadelha2018-06-161-0/+7
| | | | | | | | | | | | | | | | | | | Summary: New method dump the SMT formula and the Z3 implementation. There is no test because I only used it for debugging. However, if requested, I can add an option to the static analyzer to dump the formula (whole program? per path?), maybe something like the trimmed graph but for SMT formulas. Reviewers: NoQ, george.karpenkov, ddcc Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D48221 llvm-svn: 334891
* Call CreateTempAllocaWithoutCast for ActiveFlagYaxun Liu2018-06-161-2/+2
| | | | | | This is partial re-commit of r332982. llvm-svn: 334879
* [Modules] Improve .Private fix-its to handle 'explicit' and 'framework'Bruno Cardoso Lopes2018-06-151-11/+27
| | | | | | | | | | When in the context of suggestion the fix-it from .Private to _Private for private modules, trim off the 'explicit' and add 'framework' when appropriate. rdar://problem/41030554 llvm-svn: 334859
* [X86] Lowering sqrt intrinsics to native IRTomasz Krupa2018-06-151-1/+50
| | | | | | | | | | | | Reviewers: craig.topper, spatel, RKSimon, igorb, uriel.k Reviewed By: craig.topper Subscribers: tkrupa, cfe-commits Differential Revision: https://reviews.llvm.org/D41168 llvm-svn: 334850
* [X86] __builtin_ia32_prord512_mask, __builtin_ia32_prorq512_mask, ↵Craig Topper2018-06-151-0/+2
| | | | | | | | __builtin_ia32_shufpd should only accept an ICE constant. The rotates also need to check for the immediate to fit in 8-bits. Shufpd already checks its immediate range. llvm-svn: 334847
* [X86] The immediate argument to getmantpd*_mask should be an ICE and it ↵Craig Topper2018-06-151-0/+6
| | | | | | | | should only be 4 bits wide. We already checked this for the scalar version, but missed the vector version somehow. llvm-svn: 334846
* bpf: recognize target specific option -mattr=dwarfris in clangYonghong Song2018-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The following is the usage example with clang: bash-4.2$ clang -target bpf -O2 -g -c -Xclang -target-feature -Xclang +dwarfris t.c bash-4.2$ llvm-objdump -S -d t.o t.o: file format ELF64-BPF Disassembly of section .text: test: ; int test(void) { 0: b7 00 00 00 00 00 00 00 r0 = 0 ; return 0; 1: 95 00 00 00 00 00 00 00 exit bash-4.2$ cat t.c int test(void) { return 0; } bash-4.2$ Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 334839
* [NFC] Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCastYaxun Liu2018-06-153-34/+53
| | | | | | This is partial re-commit of r332982 llvm-svn: 334837
* [AArch64] Reverted rC334696 with Clang VCVTA test fixLuke Geeson2018-06-151-0/+3
| | | | llvm-svn: 334820
* [ASTImporter] Corrected diagnostic client handling in tests.Adam Balogh2018-06-151-0/+6
| | | | | | | | | | | | ASTImporter tests may produce source file related warnings, the diagnostic client should be in correct state to handle it. Added 'beginSourceFile' to set the client state. Patch by: Balázs Kéri Differential Revision: https://reviews.llvm.org/D47445 llvm-svn: 334804
* [Format] Do not use a global static value for EOF within ScopedMacroState.David L. Jones2018-06-151-12/+4
| | | | | | | | | | | | | | | | | ScopedMacroState injects its own EOF token under certain conditions, and the returned token may be modified in several different locations. If multiple reformat operations are started in different threads, then they will both see the same fake EOF token, and may both try to modify it. This is a data race. This bug was caught with tsan. Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47759 llvm-svn: 334801
* Modules: Fix implicit output file for .cppm to .pcm instead of stdoutDavid Blaikie2018-06-141-2/+1
| | | | | | | | | | | | | | | This code was introduced back in r178148, a change to introduce -module-file-info - which still exists & seems like it's still tested (& this change didn't cause any of those tests to fail). It doesn't look like this change was necessary there - since it's about pcm output, whereas -module-file-info looks like it's for pcm /input/. So I'm not really sure what the original motivation was. I'm open to ideas though, if it turns out the original change was necessary/useful. llvm-svn: 334778
* [X86] Rename __builtin_ia32_pslldqi128 to ↵Craig Topper2018-06-145-28/+24
| | | | | | | | | | | | __builtin_ia32_pslldqi128_byteshift and similar for other sizes. Remove the multiply by 8 from the header files. The previous names took the shift amount in bits to match gcc and required a multiply by 8 in the header. This creates a misleading error message when we check the range of the immediate to the builtin since the allowed range also got multiplied by 8. This commit changes the builtins to use a byte shift amount to match the underlying instruction and the Intel intrinsic. Fixes the remaining issue from PR37795. llvm-svn: 334773
* [c++17] If a class inherits virtual functions from a base class, it isRichard Smith2018-06-141-1/+5
| | | | | | not an aggregtae. llvm-svn: 334763
* [X86] Add inline assembly versions of ↵Craig Topper2018-06-142-10/+84
| | | | | | | | | | _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
* [X86] Lowering Mask Scalar intrinsics to native IR (Clang part)Tomasz Krupa2018-06-142-60/+65
| | | | | | | | | | | | | | | 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-141-0/+1
| | | | | | | | | | | | | | | | 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-1419-44/+559
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [OpenCL] Support new/delete in SemaSven van Haastregt2018-06-143-4/+43
| | | | | | | | | 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-141-3/+0
| | | | llvm-svn: 334696
* [AArch64] Added support for the vcvta_u16_f16 instrinsic for FP16 Armv8.2-ALuke Geeson2018-06-141-0/+3
| | | | llvm-svn: 334693
* [clang-format] Add SpaceBeforeCpp11BracedList option.Hans Wennborg2018-06-142-0/+7
| | | | | | | | | | | | | | | | | | | | 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-141-16/+6
| | | | | | | | | | | | | | | | | | | 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-141-3/+3
| | | | | | | | | | | | | | 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-142-60/+107
| | | | | | | | | | | | | | | 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-143-44/+9
| | | | | | | | | | | | | | | | | | | | | | 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-143-128/+95
| | | | | | | | | | | | | | 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-141-49/+53
| | | | llvm-svn: 334677
* Driver: De-duplicate some code. NFCI.Peter Collingbourne2018-06-141-2/+1
| | | | llvm-svn: 334673
* Implement constexpr __builtin_*_overflowErich Keane2018-06-131-0/+118
| | | | | | | | | 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-131-0/+5
| | | | | | | | | | | | | | 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-131-42/+8
| | | | | | | | | rdar://39593879 https://bugs.llvm.org/show_bug.cgi?id=37142 Differential Revision: https://reviews.llvm.org/D48139 llvm-svn: 334636
* [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-132-114/+105
| | | | | | | | | | | | 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
* Add -fforce-emit-vtablesPiotr Padlewski2018-06-134-3/+25
| | | | | | | | | | | | | | | | | | | 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-131-9/+21
| | | | | | | | | | 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
* [X86] Remove masking from avx512vbmi2 concat and shift by immediate ↵Craig Topper2018-06-133-308/+182
| | | | | | builtins. Use select builtins instead. llvm-svn: 334577
* 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-131-2/+8
| | | | | | | | | | | | | 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-131-0/+2
| | | | llvm-svn: 334565
* [CUDA][HIP] Allow CUDA __global__ functions to have amdgpu kernel attributesYaxun Liu2018-06-121-16/+18
| | | | | | | | | | | | 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-121-1/+1
| | | | | | | | | | 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-121-0/+19
| | | | | | | | | | 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
* [analyzer] [NFC] Remove "removeInvalidation" from visitor APIGeorge Karpenkov2018-06-121-2/+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-122-104/+100
| | | | | | | | | | 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-122-18/+23
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud