summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove redundant conditions of the form (A || (!A && B)) -> (A || B)Benjamin Kramer2016-04-115-12/+8
| | | | | | Found by cppcheck! PR27286 PR27287 PR27288 PR27289 llvm-svn: 265918
* [GCC] Attribute ifunc support in clangDmitry Polukhin2016-04-116-27/+144
| | | | | | | | | | | This patch add support for GCC attribute((ifunc("resolver"))) for targets that use ELF as object file format. In general ifunc is a special kind of function alias with type @gnu_indirect_function. LLVM patch http://reviews.llvm.org/D15525 Differential Revision: http://reviews.llvm.org/D15524 llvm-svn: 265917
* clang-format: [JS] do not insert semicolons after wrapped annotations.Martin Probst2016-04-111-0/+7
| | | | | | | | | | Reviewers: djasper Subscribers: klimek Differential Revision: http://reviews.llvm.org/D18943 llvm-svn: 265916
* [Clang][AVX512][BuiltIn] Adding avx512 ( vperm{i|t}2var, ↵Michael Zuckerman2016-04-112-0/+320
| | | | | | | | vpermil{var}{ps|pd}{256|512} ) builtin to clang. Differential Revision: http://reviews.llvm.org/D18933 llvm-svn: 265915
* [Clang][AVX512][BuiltIn] Adding avx512 ( vcvt ) builtin to clangMichael Zuckerman2016-04-101-0/+183
| | | | | | Differential Revision: http://reviews.llvm.org/D18932 llvm-svn: 265904
* Correct pg instrumentation for AArch64Saleem Abdulrasool2016-04-101-5/+0
| | | | | | | | | It seems that there was a miscommunication between Renato and I, and the original behaviour of AArch64 was to be preserved and not to mirror the new behaviour. Restore the original behaviour for AArch64. Addresses post-commit review comments from Renato Golin. llvm-svn: 265899
* Adding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) ↵Michael Zuckerman2016-04-102-0/+442
| | | | | | | | builtin to clang Differential Revision: http://reviews.llvm.org/D18931 llvm-svn: 265896
* [Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clangMichael Zuckerman2016-04-103-0/+145
| | | | | | Differential Revision: http://reviews.llvm.org/D18925 llvm-svn: 265895
* Add support for __gnu_mcount_nc as the pg interfaceSaleem Abdulrasool2016-04-101-2/+11
| | | | | | | | | | | This adds support to optionally support using `__gnu_mcount_nc` as the mcount interface rather than `mcount` for Linux and EABI. The other targets do not provide an implementation for `__gnu_mcount_nc`. This can be activated via the `-meabi gnu` flag. Resolves PR23969. llvm-svn: 265888
* Basic: thread TargetOptions into TargetInfoSaleem Abdulrasool2016-04-091-292/+335
| | | | | | | | This threads TargetOptions into the TargetInfo hierarchy. This is a rework of the original attempt to thread additional information into the TargetInfo to make decisions based on additional ABI related options. llvm-svn: 265878
* ObjC kindof: check the context when inserting methods to global pool.Manman Ren2016-04-091-1/+38
| | | | | | | | | | | | | | | | To make kindof lookup work, we need to insert methods with different context into the global pool, even though they have the same siganture. Since diagnosis of availability is performed on the best candidate, which is often the first candidate from the global pool, we prioritize the methods that are unavaible or deprecated to the head of the list. Since we now have more methods in the global pool, we need to watch out for performance impact. rdar://25635831 llvm-svn: 265877
* [Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TSNathan Wilson2016-04-092-0/+49
| | | | | | | | | | | | Summary: A program shall not declare an explicit instantiation (14.8.2), an explicit specialization (14.8.3), or a partial specialization of a concept definition. Reviewers: rsmith, hubert.reinterpretcast, faisalv, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18221 llvm-svn: 265868
* Use NoDebug compile units to mark debug metadata used only for sample-basedAdrian Prantl2016-04-081-5/+16
| | | | | | | | | | profiling and optimization remarks and indicate that no debug info shall be emitted for these compile units. http://reviews.llvm.org/D18808 <rdar://problem/25427165> llvm-svn: 265862
* Remove unused functions from ASTWriter interface.Richard Smith2016-04-081-8/+8
| | | | llvm-svn: 265857
* PR25501: Delay loading visible updates for a declaration until after we'veRichard Smith2016-04-081-15/+15
| | | | | | | | | | | processed update records. If an update record adds a definition, we need to merge that with any pre-existing definition to determine which the canonical definition is before we apply the visible update, otherwise we wouldn't know where to apply it. Thanks to Vassil Vassilev for help reducing this and tracking down the problem. llvm-svn: 265848
* Add doxygen comments to emmintrin.h's intrinsics. Only around 25% of the ↵Ekaterina Romanova2016-04-081-1/+939
| | | | | | | | | | intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later. The doxygen comments are automatically generated based on Sony's intrinsics document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson. llvm-svn: 265844
* [analyzer] Teach trackNullOrUndefValue about calls to property accessors.Devin Coughlin2016-04-081-0/+6
| | | | | | | | | | | Teach trackNullOrUndefValue() how to look through PseudoObjectExprs to find the underlying method call for property getters. This makes over-suppression of 'return nil' in getters consistent with the similar over-suppression for method and function calls. rdar://problem/24437252 llvm-svn: 265839
* [modules] Handle merged fields in designated initializers.Richard Smith2016-04-081-3/+5
| | | | llvm-svn: 265838
* Always have clang pass -pie-level and -pic-level values to the code generator.Wei Mi2016-04-081-7/+12
| | | | | | | | Patch by tmsriram! Differential Revision: http://reviews.llvm.org/D18843 llvm-svn: 265816
* Move EABIVersion from CodeGenOptions to TargetOptionsSaleem Abdulrasool2016-04-082-17/+18
| | | | | | | | | It is possible to argue that the EABIVersion field is similar in spirit to the ABI field in TargetOptions. It represents the embedded ABI that the target follows. This will allow us to thread this information into the target information construction. llvm-svn: 265807
* revert SVN r265702, r265640Saleem Abdulrasool2016-04-0831-413/+331
| | | | | | | | | | | Revert the two changes to thread CodeGenOptions into the TargetInfo allocation and to fix the layering violation by moving CodeGenOptions into Basic. Code Generation is arguably not particularly "basic". This addresses Richard's post-commit review comments. This change purely does the mechanical revert and will be followed up with an alternate approach to thread the desired information into TargetInfo. llvm-svn: 265806
* [OpenCL] Complete image types support.Alexey Bader2016-04-0825-403/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I. Current implementation of images is not conformant to spec in the following points: 1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine: void write_image(write_only image2d_t img); kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code which is disallowed according to s6.13.14. 2. It discards access qualifier on generated code, which leads to generated code for the above example: call void @write_image(%opencl.image2d_t* %img); In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images. Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently. 3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names. 4. Default access qualifier read_only is to be added if not provided explicitly. II. This patch corrects the above points as follows: 1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type. 2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers). 3. Improves testing of images in Clang. Author: Anastasia Stulova Reviewers: bader, mgrang. Subscribers: pxli168, pekka.jaaskelainen, yaxunl. Differential Revision: http://reviews.llvm.org/D17821 llvm-svn: 265783
* Silencing a 32-bit shift implicit conversion warning from MSVC; NFC.Aaron Ballman2016-04-081-1/+1
| | | | llvm-svn: 265782
* Adapt to LLVM API changeSanjoy Das2016-04-082-2/+2
| | | | | | Replace mayBeOverridden with isInterposable llvm-svn: 265767
* [modules] Add a comment to explain why -E leaves some #includes in the ↵Richard Smith2016-04-081-1/+3
| | | | | | preprocessed output. llvm-svn: 265766
* [modules] Don't write @import in -E output if the current language mode doesn'tRichard Smith2016-04-082-3/+15
| | | | | | support @import; use the form as written instead. llvm-svn: 265756
* [CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.Justin Lebar2016-04-073-158/+192
| | | | | | | | | | | | | | | | | | Summary: See comments in patch; we were assuming that some stdlib math functions would be defined in namespace std, when in fact the spec says they should be defined in the global namespace. libstdc++4.9 became more conforming and broke us. This new implementation seems to cover the known knowns. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: http://reviews.llvm.org/D18882 llvm-svn: 265751
* Replace Sema-level implementation of -fassume-sane-operator-new with aRichard Smith2016-04-073-16/+17
| | | | | | | | | | | | | | CodeGen-level implementation. Instead of adding an attribute to clang's FunctionDecl, add the IR attribute directly. This means a module built with this flag is now compatible with code built without it and vice versa. This change also results in the 'noalias' attribute no longer being added to calls to operator new in the IR; it's now only added to the declaration. It also fixes a bug where we failed to add the attribute to the 'nothrow' versions (because we didn't implicitly declare them, there was no good time to inject a fake attribute). llvm-svn: 265728
* [modules] Allow differences in flags that only affect preprocessor predefinesRichard Smith2016-04-071-0/+5
| | | | | | | (and __has_feature checks) between explicitly-specified module files and the current compilation. llvm-svn: 265718
* [ObjC kindof] Use type bound to filter out the candidate methods.Manman Ren2016-04-072-8/+45
| | | | | | rdar://21306753 llvm-svn: 265712
* NFC: simplify code in BuildInstanceMessage.Manman Ren2016-04-073-57/+94
| | | | | | | | | | | | | | | | Instead of searching the global pool multiple times: in LookupFactoryMethodInGlobalPool, LookupInstanceMethodInGlobalPool, CollectMultipleMethodsInGlobalPool, and AreMultipleMethodsInGlobalPool, we now collect the method candidates in CollectMultipleMethodsInGlobalPool only, and other functions will use the collected method set. This commit adds parameter "Methods" to AreMultipleMethodsInGlobalPool, and SelectBestMethod. It also changes the implementation of CollectMultipleMethodsInGlobalPool to collect the desired kind first, if none is found, to collect the other kind. This avoids the need to call both LookupFactoryMethodInGlobalPool and LookupInstanceMethodInGlobalPool. llvm-svn: 265711
* Basic: move CodeGenOptions from FrontendSaleem Abdulrasool2016-04-0728-33/+43
| | | | | | | | This is a mechanical move of CodeGenOptions from libFrontend to libBasic. This fixes the layering violation introduced earlier by threading CodeGenOptions into TargetInfo. It should also fix the modules based self-hosting builds. NFC. llvm-svn: 265702
* Fixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177Michael Zuckerman2016-04-071-8/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D17685 llvm-svn: 265677
* make __builtin_isfinite more efficient (PR27145)Sanjay Patel2016-04-071-19/+12
| | | | | | | | | | | | | | isinf (is infinite) and isfinite should be implemented with the same function except we change the comparison operator. See PR27145 for more details: https://llvm.org/bugs/show_bug.cgi?id=27145 Ref: forked off of the discussion in D18513. Differential Revision: http://reviews.llvm.org/D18648 llvm-svn: 265675
* [OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'Alexey Bataev2016-04-073-41/+173
| | | | | | | | | | | | construct. OpenMP 4.0 defines '#pragma omp declare simd' construct that may have associated 'simdlen' clause with constant positive expression as an argument: simdlen(<const_expr>) Patch adds parsin and semantic analysis for simdlen clause. llvm-svn: 265668
* Move class into an anonymous namespace. NFC.Benjamin Kramer2016-04-071-0/+2
| | | | llvm-svn: 265654
* Basic: thread CodeGenOptions into TargetInfoSaleem Abdulrasool2016-04-074-299/+371
| | | | | | | | | This threads CodeGenOptions into the TargetInfo hierarchy. This is motivated by ARM which can change some target information based on the EABI selected (-meabi). Similar options exist for other platforms (e.g. MIPS) and thus is generally useful. NFC. llvm-svn: 265640
* Don't use PATH_MAX.Sean Silva2016-04-071-1/+1
| | | | | | | | | | This is a SmallVector anyway, and so the exact size doesn't matter. clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen' llvm-svn: 265634
* [CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.hBruno Cardoso Lopes2016-04-071-1/+2
| | | | | | Use toUppercase instead of ::toupper() llvm-svn: 265632
* [CrashReproducer] Change std::toupper to ::toupperBruno Cardoso Lopes2016-04-071-1/+1
| | | | | | Attempt to fix windows bots llvm-svn: 265630
* [CrashReproducer] Setup 'case-sensitive' in YAML files.Bruno Cardoso Lopes2016-04-071-4/+27
| | | | | | | | | The crash reproducer was not setting up case sensitivity in the VFS yaml files, which defaults to true. Make the crash reproducer explicitly set that flag based on the case sensitivity of the .cache path where vfs and modules are dumped. llvm-svn: 265622
* [CrashReproducer] Move ModuleDependencyCollector method around. NFCBruno Cardoso Lopes2016-04-071-18/+18
| | | | llvm-svn: 265621
* NFC: use AtomicOrdering isStrongerThanJF Bastien2016-04-061-4/+6
| | | | | | | | | | Summary: As discussed in D18775. Reviewers: jyknight Differential Revision: http://reviews.llvm.org/D18840 llvm-svn: 265617
* Revert "Set the default C standard to C99 when targeting the PS4."Sean Silva2016-04-061-8/+3
| | | | | | | | | | | | | | | | | This reverts r265359. It breaks - llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast - llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast Failing Tests (5): Clang :: FixIt/fixit-errors.c Clang :: Preprocessor/init.c Clang :: Sema/attr-deprecated.c Clang :: Sema/nullability.c Clang :: SemaObjC/objcbridge-attribute-arc.m llvm-svn: 265601
* Fix order-of-evaluation bug (causing GCC buildbots to fail).Richard Smith2016-04-061-1/+2
| | | | llvm-svn: 265598
* [modules] Don't try to add lookup results to non-lookup contexts.Vassil Vassilev2016-04-062-2/+8
| | | | | | | | Fixes https://llvm.org/bugs/show_bug.cgi?id=27186 Patch reviewed by Richard Smith. llvm-svn: 265597
* Minor simplifications.Richard Smith2016-04-062-10/+6
| | | | llvm-svn: 265594
* Restore slightly less dodgy diagnostic handler for inline asmTim Northover2016-04-061-0/+25
| | | | | | | | Turns out it was there mostly to prevent Clang asking people to report a bug. This time we report something to Clang's real diagnostics handler so that it exits with something approximating a real error and tidies up after itself. llvm-svn: 265592
* Diagnose template alias declarations in local classes.Richard Smith2016-04-061-0/+4
| | | | | | Patch by Erik Pilkington! llvm-svn: 265571
* NFC: make AtomicOrdering an enum classJF Bastien2016-04-068-114/+125
| | | | | | | | | | | | Summary: See LLVM change D18775 for details, this change depends on it. Reviewers: jyknight, reames Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18776 llvm-svn: 265569
OpenPOWER on IntegriCloud