summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.Ranjeet Singh2016-06-171-0/+68
| | | | | | | | | | Reapplying patch in r272777 which was reverted because the llvm patch which added support for generating the mcrr/mcrr2 instructions from the intrinsic was causing an assertion failure. This has now been fixed in llvm. llvm-svn: 272983
* Headers: wordsmith error messageSaleem Abdulrasool2016-06-171-1/+1
| | | | | | Use the marketing name for the MSVC release as pointed out by Nico Weber! llvm-svn: 272979
* [CodeGen] Fix a segfault caused by pass_object_size.George Burgess IV2016-06-163-14/+16
| | | | | | | | | This patch fixes a bug where we'd segfault (in some cases) if we saw a variadic function with one or more pass_object_size arguments. Differential Revision: http://reviews.llvm.org/D17462 llvm-svn: 272971
* Fix a few issues while skipping function bodiesOlivier Goffart2016-06-165-22/+51
| | | | | | | | | | | | | | | | | | | | - In functions with try { } catch { }, only the try block would be skipped, not the catch blocks - The template functions would still be parsed. - The initializers within a constructor would still be parsed. - The inline functions within class would still be stored, only to be discared later. - Invalid code with try would assert (as in "int foo() try assert_here") This attempt to do even less while skipping function bodies. Differential Revision: http://reviews.llvm.org/D20821 llvm-svn: 272963
* Keep invalid functions as part of the ASTOlivier Goffart2016-06-161-4/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D19764 llvm-svn: 272962
* Functions declared in a scope should not hide previous declaration in ↵Olivier Goffart2016-06-161-10/+13
| | | | | | | | | | | | | | | | | | | | | earlier scopes This code should be an error: void foo(int); void f3() { int foo(float); { float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}} } } the foo(float) function declared at function scope should not hide the float(int) while trying to redeclare functions. Differential Revision: http://reviews.llvm.org/D19763 llvm-svn: 272961
* [DebugInfo] Put the vftable index in the debug infoReid Kleckner2016-06-161-8/+17
| | | | | | | This won't always be enough info to call a virtual method from the debugger, but it's a start. llvm-svn: 272944
* [x86] generate IR for AVX2 integer min/max builtinsSanjay Patel2016-06-161-5/+17
| | | | | | | Sibling patch to r272932: http://reviews.llvm.org/rL272932 llvm-svn: 272933
* Re-apply r272900 - [OpenMP] Cast captures by copy when passed to fork call ↵Samuel Antao2016-06-163-55/+43
| | | | | | | | so that they are compatible to what the runtime library expects. An issue in one of the regression tests was fixed for 32-bit hosts. llvm-svn: 272931
* Revert r272900 - [OpenMP] Cast captures by copy when passed to fork call so ↵Samuel Antao2016-06-163-43/+55
| | | | | | | | that they are compatible to what the runtime library expects. Was causing trouble in one of the regression tests for a 32-bit address space. llvm-svn: 272908
* [OpenMP] Cast captures by copy when passed to fork call so that they are ↵Samuel Antao2016-06-163-55/+43
| | | | | | | | | | | | | | | | | compatible to what the runtime library expects. Summary: This patch fixes an issue detected when firstprivate variables are passed to an OpenMP outlined function vararg list. Currently they are not compatible with what the runtime library expects causing malfunction in some targets. This patch fixes the issue by moving the casting logic already in place for offloading to the common code that creates the outline function and arguments and updates the regression tests accordingly. Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D21150 llvm-svn: 272900
* [Builtin] Make __builtin_thread_pointer target-independent.Marcin Koscielnicki2016-06-161-0/+7
| | | | | | | | This is now supported for ARM, AArch64, PowerPC, SystemZ, SPARC, Mips. Differential Revision: http://reviews.llvm.org/D19589 llvm-svn: 272893
* Compilation for Intel MCU (Part 3/3)Andrey Turetskiy2016-06-161-14/+33
| | | | | | | | | | | | | This is the last patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000). When IAMCU triple is used: * Use IAMCU linker output format * Link with IAMCU crt objects * Link with IAMCU libraries Differential Revision: http://reviews.llvm.org/D20675 llvm-svn: 272885
* Compilation for Intel MCU (Part 2/3)Andrey Turetskiy2016-06-165-13/+46
| | | | | | | | | | | | This is the second patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000). When IAMCU triple is used: * Recognize and use IAMCU GCC toolchain * Set up include paths * Forbid C++ Differential Revision: http://reviews.llvm.org/D19274 llvm-svn: 272883
* [Lex] Try to fix a 'comparison is always false' warning. NFC.George Burgess IV2016-06-161-1/+1
| | | | llvm-svn: 272867
* [DebugInfo] Enable generation of unique identifiers for externally visible ↵Reid Kleckner2016-06-161-4/+0
| | | | | | | | MS ABI types We implemented the mangling for this a long time ago. llvm-svn: 272862
* Allow 'nodebug' on local variables.Paul Robinson2016-06-161-0/+4
| | | | | | | | | Parameters and non-static members of aggregates are still excluded, and probably should remain that way. Differential Revision: http://reviews.llvm.org/D19754 llvm-svn: 272859
* [CUDA] Don't pass top-level -march down to device cc1 or ptxas.Justin Lebar2016-06-151-1/+3
| | | | | | | | | | | | | | | | | | Summary: Previously if you did e.g. $ clang -march=haswell -x cuda foo.cu we would pass "-march=haswell -march=sm_20" down to the ptxas tool. This causes it to assert, and rightly so! Reviewers: tra Subscribers: cfe-commits, echristo Differential Revision: http://reviews.llvm.org/D21419 llvm-svn: 272857
* Fix linking of DFSan + coverage.Evgeniy Stepanov2016-06-151-1/+1
| | | | | | Broken in r272717 because of no test coverage. llvm-svn: 272853
* [x86] translate SSE packed FP comparison builtins to IRSanjay Patel2016-06-151-124/+74
| | | | | | | | | | | | | As noted in the code comment, a potential follow-on would be to remove the builtins themselves. Other than ord/unord, this already works as expected. Eg: typedef float v4sf __attribute__((__vector_size__(16))); v4sf fcmpgt(v4sf a, v4sf b) { return a > b; } Differential Revision: http://reviews.llvm.org/D21268 llvm-svn: 272840
* Add support to clang-cl driver for /GS switchEtienne Bergeron2016-06-151-0/+13
| | | | | | | | | | | | | | | | | | | Summary: This patch is adding command-line support for the MSVC buffer security check. The buffer security check is turned on with the '/GS' compiler switch. https://msdn.microsoft.com/en-us/library/8dbf701c.aspx The MSVC buffer security check in implemented here: http://reviews.llvm.org/D20346 Reviewers: hans, rnk Subscribers: chrisha, cfe-commits, rnk, hans, thakis Differential Revision: http://reviews.llvm.org/D20347 llvm-svn: 272832
* [x86] generate IR for SSE integer min/max builtinsSanjay Patel2016-06-151-0/+27
| | | | | | | Sibling patch to r272806: http://reviews.llvm.org/rL272806 llvm-svn: 272807
* [Sparc] setjmp and longjmp intrinsic support update to add unit tests and ↵Chris Dewhurst2016-06-151-1/+0
| | | | | | | | remove accidentally checked-in code. Related to revision r272782 llvm-svn: 272798
* Reverting r272777 because one of the testsRanjeet Singh2016-06-151-68/+0
| | | | | | | added in the llvm patch is causing an assertion to fail. llvm-svn: 272790
* Apply some suggestions from clang-tidy's performance-unnecessary-value-param.Benjamin Kramer2016-06-157-39/+32
| | | | | | No functionality change intended. llvm-svn: 272789
* Don't use static variables in LambdaCaptureJohn Brawn2016-06-152-15/+10
| | | | | | | | | | | | | | | | | | | | | | | When static variables are used in inline functions in header files anything that uses that function ends up with a reference to the variable. Because RecursiveASTVisitor uses the inline functions in LambdaCapture that use static variables any AST plugin that uses RecursiveASTVisitor, such as the PrintFunctionNames example, ends up with a reference to these variables. This is bad on Windows when building with MSVC with LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON as variables used across a DLL boundary need to be explicitly dllimported in the DLL using them. This patch avoids that by adjusting LambdaCapture to be similar to before r263921, with a capture of either 'this' or a VLA represented by a null Decl pointer in DeclAndBits with an extra flag added to the bits to distinguish between the two. This requires the use of an extra bit, and while Decl does happen to be sufficiently aligned to allow this it's done in a way that means PointerIntPair doesn't realise it and gives an assertion failure. Therefore I also adjust Decl slightly to use LLVM_ALIGNAS to allow this. Differential Revision: http://reviews.llvm.org/D20732 llvm-svn: 272788
* [AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.Craig Topper2016-06-151-0/+49
| | | | llvm-svn: 272787
* [Sparc] Change to let clang know that setjmp and longjmp intrinsics are ↵Chris Dewhurst2016-06-151-0/+5
| | | | | | | | implemented in the back-end. Differential Revision: http://reviews.llvm.org/D19798 llvm-svn: 272782
* [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.Ranjeet Singh2016-06-151-0/+68
| | | | | | | | | | | | | | Patch adds intrinsics for mrrc/mrrc2. The intrinsics for mrrc/mrrc2 return a single uint64_t to represent two 32 bit values. The mcrr/mcrr2 intrinsic was changed to accept a single uint64_t instead of two 32 bit values as the input for consistency. Differential Revision: http://reviews.llvm.org/D21179 llvm-svn: 272777
* Revert accidential "[MSVC] Late parsing of in-class defined member functions ↵Alexey Bataev2016-06-1512-246/+11
| | | | | | | | in template" This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a. llvm-svn: 272776
* [OPENMP] Fix crash for 'schedule|dist_schedule' clauses duringAlexey Bataev2016-06-151-2/+4
| | | | | | | | | | instantiation. Added checks for non-dependent context when trygin to capture non-constant schedule chunk expression for proper codegen of outlined functions. llvm-svn: 272775
* [MSVC] Late parsing of in-class defined member functions in templateAlexey Bataev2016-06-1512-11/+246
| | | | | | | | | | | | | | | | | | | classes. MSVC actively uses unqualified lookup in dependent bases, lookup at the instantiation point (non-dependent names may be resolved on things declared later) etc. and all this stuff is the main cause of incompatibility between clang and MSVC. Clang tries to emulate MSVC behavior but it may fail in many cases. clang could store lexed tokens for member functions definitions within ClassTemplateDecl for later parsing during template instantiation. It will allow resolving many possible issues with lookup in dependent base classes and removing many already existing MSVC-specific hacks/workarounds from the clang code. llvm-svn: 272774
* Add a "declared 'nonnull' here" note to warnings where an expression is ↵Nick Lewycky2016-06-151-7/+9
| | | | | | checked against null. llvm-svn: 272755
* Headers: tweak for MSVC[<1800]Saleem Abdulrasool2016-06-151-0/+4
| | | | | | | Earlier versions of MSVC did not include inttypes.h. Ensure that we dont try to include_next on those releases. llvm-svn: 272741
* Fix sanitizer coverage support in the win32 driver.Evgeniy Stepanov2016-06-141-22/+22
| | | | | | | --dependent-lib arguments for the sanitizer libraries must be emitted when coverage is enabled w/o any sanitizers. llvm-svn: 272735
* [OpenCL] Enable -fblocks by default for OpenCL 2.0 and above.Yaxun Liu2016-06-143-3/+4
| | | | | | Reviewed as part of http://reviews.llvm.org/D20444 llvm-svn: 272720
* [sanitizer] Allow sanitize coverage w/o sanitizers.Evgeniy Stepanov2016-06-141-9/+8
| | | | | | | The reason is that this (a) seems to work just fine and (b) useful when building stuff with sanitizer+coverage, but need to exclude the sanitizer for a particular source file. llvm-svn: 272717
* Update clang for D20348Peter Collingbourne2016-06-148-27/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D20339 llvm-svn: 272710
* s/Intrin.h/intrin.h/, trying to fix the build after r272701Hans Wennborg2016-06-142-3/+3
| | | | llvm-svn: 272702
* Rename Intrin.h to intrin.h, that's how all the documentation calls it.Nico Weber2016-06-141-0/+0
| | | | llvm-svn: 272701
* [clang-format] do not add existing includes.Eric Liu2016-06-141-1/+7
| | | | | | | | | | | | Summary: do not add existing includes. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D21323 llvm-svn: 272669
* clang-format: [JS] Fix failing format with TypeScript casts.Daniel Jasper2016-06-141-3/+3
| | | | | | | | | | | | Before, this could be formatted at all (with BracketAlignmentStyle AlwaysBreak): foo = <Bar[]>[ 1, /* */ 2 ]; llvm-svn: 272668
* [Clang][avx512][Intrinsics] adding prefetch gather intrinsicsMichael Zuckerman2016-06-141-0/+19
| | | | | | Differential Revision: http://reviews.llvm.org/D21322 llvm-svn: 272667
* Start adding support for Musl.Rafael Espindola2016-06-141-0/+2
| | | | | | | | | | | The two patches together enable clang to support targets like "x86_64-pc-linux-musl" and build binaries against musl-libc instead of glibc. This make it easy for clang to work on some musl-based systems like Alpine Linux and certain flavors of Gentoo. Patch by Lei Zhang. llvm-svn: 272662
* [Clang][AVX512][intrinsics] Adding missing intrinsics div_pd and div_psMichael Zuckerman2016-06-141-0/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D20626 llvm-svn: 272658
* Add loop pragma for Loop DistributionAdam Nemet2016-06-144-17/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is similar to other loop pragmas like 'vectorize'. Currently it only has state values: distribute(enable) and distribute(disable). When one of these is specified the corresponding loop metadata is generated: !{!"llvm.loop.distribute.enable", i1 true/false} As a result, loop distribution will be attempted on the loop even if Loop Distribution in not enabled globally. Analogously, with 'disable' distribution can be turned off for an individual loop even when the pass is otherwise enabled. There are some slight differences compared to the existing loop pragmas. 1. There is no 'assume_safety' variant which makes its handling slightly different from 'vectorize'/'interleave'. 2. Unlike the existing loop pragmas, it does not have a corresponding numeric pragma like 'vectorize' -> 'vectorize_width'. So for the consistency checks in CheckForIncompatibleAttributes we don't need to check it against other pragmas. We just need to check for duplicates of the same pragma. Reviewers: rsmith, dexonsmith, aaron.ballman Subscribers: bob.wilson, cfe-commits, hfinkel Differential Revision: http://reviews.llvm.org/D19403 llvm-svn: 272656
* clang-format: [JS] Support annotated classes.Daniel Jasper2016-06-141-1/+2
| | | | llvm-svn: 272654
* Reverting "Warn when taking address of a packed member"Roger Ferrer Ibanez2016-06-141-24/+0
| | | | | | | | This new diagnostic is causing some false positives that have to be addressed. This reverts commit 272552 llvm-svn: 272653
* [mips] Defer validity check for CPU/ABI pairs and improve error message for ↵Daniel Sanders2016-06-141-34/+79
| | | | | | | | | | | | | | | | | | | | | invalid cases. Summary: The validity of ABI/CPU pairs is no longer checked on the fly but is instead checked after initialization. As a result, invalid CPU/ABI pairs can be reported as being known but invalid instead of being unknown. For example, we now emit: error: ABI 'n32' is not supported on CPU 'mips32r2' instead of: error: unknown target ABI 'n64' Reviewers: atanasyan Subscribers: sdardis, cfe-commits Differential Revision: http://reviews.llvm.org/D21023 llvm-svn: 272645
* Fix PR28100 - Allow redeclarations of deleted explicit specializations.Faisal Vali2016-06-141-6/+14
| | | | | | | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=28100. In r266561 when I implemented allowing explicit specializations of function templates to override deleted status, I mistakenly assumed (and hence introduced a violable assertion) that when an explicit specialization was being declared, the corresponding specialization of the most specialized function template that it would get linked to would always be the one that was implicitly generated - and so if it was marked as 'deleted' it must have inherited it from the primary template and so should be safe to reset its deleted status, and set it to being an explicit specialization. Obviously during redeclaration of a deleted explicit specialization, in order to avoid a recursive reset, we need to check that the previous specialization is not an explicit specialization (instead of assuming and asserting it) and that it hasn't been referenced, and so only then is it safe to reset its 'deleted' status. All regression tests pass. Thanks to Zhendong Su for reporting the bug and David Majnemer for tracking it to my commit r266561, and promptly bringing it to my attention. llvm-svn: 272631
OpenPOWER on IntegriCloud