summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [PPC64LE] Fix vec_sld semantics for little endianBill Schmidt2015-07-151-24/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | The vec_sld interface provides access to the vsldoi instruction. Unlike most of the vec_* interfaces, we do not attempt to change the generated code for vec_sld based on the endian mode. It is too difficult to correctly infer the desired semantics because of different element types, and the corrected instruction sequence is expensive, involving loading a permute control vector and performing a generalized permute. For GCC, this was implemented as "Don't touch the vec_sld" implementation. When it came time for the LLVM implementation, I did the same thing. However, this was hasty and incorrect. In LLVM's version of altivec.h, vec_sld was previously defined in terms of the vec_perm interface. Because vec_perm semantics are adjusted for little endian, this means that leaving vec_sld untouched causes it to generate something different for LE than for BE. Not good. This patch adjusts the form of vec_perm that is used for vec_sld and vec_vsldoi, effectively undoing the modifications so that the same vsldoi instruction will be generated for both BE and LE. There is an accompanying back-end patch to take care of some small ripple effects caused by these changes. llvm-svn: 242297
* Set comdat when an available_externally thunk is converted to linkonce_odr.Rafael Espindola2015-07-151-12/+17
| | | | | | Fixes pr24130. llvm-svn: 242293
* Add support for armv7-windows-gnu targets to the clang front end.Yaron Keren2015-07-151-0/+43
| | | | | | | | | http://reviews.llvm.org/D11071 Patch by Martell Malone Reviewed by Reid Kleckner llvm-svn: 242292
* CodeGen: Improve CFI type blacklisting mechanism.Peter Collingbourne2015-07-153-11/+8
| | | | | | | | | | We now use the sanitizer special case list to decide which types to blacklist. We also support a special blacklist entry for types with a uuid attribute, which are generally COM types whose virtual tables are defined externally. Differential Revision: http://reviews.llvm.org/D11096 llvm-svn: 242286
* [OPENMP] http://llvm.org/PR24121: canonical loop rejected when comparison ↵Alexey Bataev2015-07-151-3/+30
| | | | | | | | has implicit conversions or destruction Allow to use complex iterators expressions in loops for C++. llvm-svn: 242285
* [modules] Switch to the normal reverse postorder visitation algorithm when ↵Richard Smith2015-07-152-80/+82
| | | | | | computing redeclaration chains. llvm-svn: 242253
* [Sema] Don't emit "pure virtual" warning for fully qualified calls.Davide Italiano2015-07-142-4/+11
| | | | | | | | | | -fapple-kext is an exception because calls will still go through the vtable in that mode. Add a note to make the user aware of that. PR: 23215 Differential Revision: http://reviews.llvm.org/D10935 llvm-svn: 242246
* Make the variable names match the name of the metadata they control.Tyler Nowicki2015-07-143-39/+38
| | | | | | Rename Vectorizer to Vectorize and VectorizeUnroll to InterleaveCount. llvm-svn: 242241
* Driver: Delete dead codeJustin Bogner2015-07-141-7/+0
| | | | | | VerifyJobActions never have multiple inputs. llvm-svn: 242223
* Add a "maximum TLS alignment" characteristic to the target info, so itPaul Robinson2015-07-144-5/+50
| | | | | | | | | | can be different from the normal variable maximum. Add an error diagnostic for when TLS variables exceed maximum TLS alignment. Currenty only PS4 sets an explicit maximum TLS alignment. Patch by Charles Li! llvm-svn: 242198
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-3/+10
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* [modules] Avoid repeatedly hashing the same name when looking it up in ↵Richard Smith2015-07-142-47/+57
| | | | | | multiple module files. llvm-svn: 242180
* [clang-cl] Disable C++ exceptions a different wayReid Kleckner2015-07-141-7/+3
| | | | | | | | | | Rather than making -fexceptions a core option that enables C++ EH in clang-cl, users can use the '-Xclang -fexceptions -Xclang -fcxx-exceptions' flag set. We weren't going to expose -fexceptions in clang-cl in the long run, so this way we don't add and then remove a flag. llvm-svn: 242176
* Fixed 22941: Integer template parameter as immediate 'I' expectes an integer ↵Sunil Srivastava2015-07-141-11/+13
| | | | | | | | | constant Basically fixed premature testing of integer constraints during template parsing Reviewed at http://reviews.llvm.org/D10452 llvm-svn: 242175
* Add missing builtins to altivec.h for ABI compliance (vol. 4)Nemanja Ivanovic2015-07-142-11/+638
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D11184 A number of new interfaces for altivec.h (as mandated by the ABI): vector float vec_cpsgn(vector float, vector float) vector double vec_cpsgn(vector double, vector double) vector double vec_or(vector bool long long, vector double) vector double vec_or(vector double, vector bool long long) vector double vec_re(vector double) vector signed char vec_cntlz(vector signed char) vector unsigned char vec_cntlz(vector unsigned char) vector short vec_cntlz(vector short) vector unsigned short vec_cntlz(vector unsigned short) vector int vec_cntlz(vector int) vector unsigned int vec_cntlz(vector unsigned int) vector signed long long vec_cntlz(vector signed long long) vector unsigned long long vec_cntlz(vector unsigned long long) vector signed char vec_nand(vector bool signed char, vector signed char) vector signed char vec_nand(vector signed char, vector bool signed char) vector signed char vec_nand(vector signed char, vector signed char) vector unsigned char vec_nand(vector bool unsigned char, vector unsigned char) vector unsigned char vec_nand(vector unsigned char, vector bool unsigned char) vector unsigned char vec_nand(vector unsigned char, vector unsigned char) vector short vec_nand(vector bool short, vector short) vector short vec_nand(vector short, vector bool short) vector short vec_nand(vector short, vector short) vector unsigned short vec_nand(vector bool unsigned short, vector unsigned short) vector unsigned short vec_nand(vector unsigned short, vector bool unsigned short) vector unsigned short vec_nand(vector unsigned short, vector unsigned short) vector int vec_nand(vector bool int, vector int) vector int vec_nand(vector int, vector bool int) vector int vec_nand(vector int, vector int) vector unsigned int vec_nand(vector bool unsigned int, vector unsigned int) vector unsigned int vec_nand(vector unsigned int, vector bool unsigned int) vector unsigned int vec_nand(vector unsigned int, vector unsigned int) vector signed long long vec_nand(vector bool long long, vector signed long long) vector signed long long vec_nand(vector signed long long, vector bool long long) vector signed long long vec_nand(vector signed long long, vector signed long long) vector unsigned long long vec_nand(vector bool long long, vector unsigned long long) vector unsigned long long vec_nand(vector unsigned long long, vector bool long long) vector unsigned long long vec_nand(vector unsigned long long, vector unsigned long long) vector signed char vec_orc(vector bool signed char, vector signed char) vector signed char vec_orc(vector signed char, vector bool signed char) vector signed char vec_orc(vector signed char, vector signed char) vector unsigned char vec_orc(vector bool unsigned char, vector unsigned char) vector unsigned char vec_orc(vector unsigned char, vector bool unsigned char) vector unsigned char vec_orc(vector unsigned char, vector unsigned char) vector short vec_orc(vector bool short, vector short) vector short vec_orc(vector short, vector bool short) vector short vec_orc(vector short, vector short) vector unsigned short vec_orc(vector bool unsigned short, vector unsigned short) vector unsigned short vec_orc(vector unsigned short, vector bool unsigned short) vector unsigned short vec_orc(vector unsigned short, vector unsigned short) vector int vec_orc(vector bool int, vector int) vector int vec_orc(vector int, vector bool int) vector int vec_orc(vector int, vector int) vector unsigned int vec_orc(vector bool unsigned int, vector unsigned int) vector unsigned int vec_orc(vector unsigned int, vector bool unsigned int) vector unsigned int vec_orc(vector unsigned int, vector unsigned int) vector signed long long vec_orc(vector bool long long, vector signed long long) vector signed long long vec_orc(vector signed long long, vector bool long long) vector signed long long vec_orc(vector signed long long, vector signed long long) vector unsigned long long vec_orc(vector bool long long, vector unsigned long long) vector unsigned long long vec_orc(vector unsigned long long, vector bool long long) vector unsigned long long vec_orc(vector unsigned long long, vector unsigned long long) vector signed char vec_div(vector signed char, vector signed char) vector unsigned char vec_div(vector unsigned char, vector unsigned char) vector signed short vec_div(vector signed short, vector signed short) vector unsigned short vec_div(vector unsigned short, vector unsigned short) vector signed int vec_div(vector signed int, vector signed int) vector unsigned int vec_div(vector unsigned int, vector unsigned int) vector signed long long vec_div(vector signed long long, vector signed long long) vector unsigned long long vec_div(vector unsigned long long, vector unsigned long long) vector unsigned char vec_mul(vector unsigned char, vector unsigned char) vector unsigned int vec_mul(vector unsigned int, vector unsigned int) vector unsigned long long vec_mul(vector unsigned long long, vector unsigned long long) vector unsigned short vec_mul(vector unsigned short, vector unsigned short) vector signed char vec_mul(vector signed char, vector signed char) vector signed int vec_mul(vector signed int, vector signed int) vector signed long long vec_mul(vector signed long long, vector signed long long) vector signed short vec_mul(vector signed short, vector signed short) vector signed long long vec_mergeh(vector signed long long, vector signed long long) vector signed long long vec_mergeh(vector signed long long, vector bool long long) vector signed long long vec_mergeh(vector bool long long, vector signed long long) vector unsigned long long vec_mergeh(vector unsigned long long, vector unsigned long long) vector unsigned long long vec_mergeh(vector unsigned long long, vector bool long long) vector unsigned long long vec_mergeh(vector bool long long, vector unsigned long long) vector double vec_mergeh(vector double, vector double) vector double vec_mergeh(vector double, vector bool long long) vector double vec_mergeh(vector bool long long, vector double) vector signed long long vec_mergel(vector signed long long, vector signed long long) vector signed long long vec_mergel(vector signed long long, vector bool long long) vector signed long long vec_mergel(vector bool long long, vector signed long long) vector unsigned long long vec_mergel(vector unsigned long long, vector unsigned long long) vector unsigned long long vec_mergel(vector unsigned long long, vector bool long long) vector unsigned long long vec_mergel(vector bool long long, vector unsigned long long) vector double vec_mergel(vector double, vector double) vector double vec_mergel(vector double, vector bool long long) vector double vec_mergel(vector bool long long, vector double) vector signed int vec_pack(vector signed long long, vector signed long long) vector unsigned int vec_pack(vector unsigned long long, vector unsigned long long) vector bool int vec_pack(vector bool long long, vector bool long long) llvm-svn: 242171
* Rely on default zero-arg value for IRBuilder::CreateCall calls to zero-arg ↵David Blaikie2015-07-147-17/+16
| | | | | | | | functions Patch by servuswiegehtz at yahoo.de llvm-svn: 242168
* AST Matchers: pass ast_type_traits::DynTypedNode by const-refHans Wennborg2015-07-141-9/+9
| | | | | | (Broken out from http://reviews.llvm.org/D11168) llvm-svn: 242161
* Pull trivial SanitizerSet methods into the header.Benjamin Kramer2015-07-141-25/+0
| | | | | | Inlining them is always preferable to a call. NFC. llvm-svn: 242154
* Support mingw-w64 toolchain on openSUSE and likely other LinuxesYaron Keren2015-07-141-1/+28
| | | | | | Thanks to Ismail Donmez for testing and to Joerg Sonnenbergerþ for his comments. llvm-svn: 242150
* [x86] add 2 bit to ObjCOrBuiltinID and new intrinsicsAsaf Badouh2015-07-141-0/+1045
| | | | | | | | | | add 2 bit to ObjCOrBuiltinID (changed from 11bits to 13bits), see discussion in Add new intrinsics support that already covered by the BE. All the intrinsics are covered by tests Differential Revision: http://reviews.llvm.org/D10893 llvm-svn: 242144
* [Analyzer] Move FindSuperCallVisitor into an anonymous namespace.Benjamin Kramer2015-07-141-2/+0
| | | | | | No functionality change. llvm-svn: 242140
* clang-format: Fix formatting of multiple lambdas in initializers.Daniel Jasper2015-07-141-2/+4
| | | | | | | | | | | | | | | | | | | | Before: SomeFunction({[&] { // comment }, [&] { // comment }}); After: SomeFunction({[&] { // comment }, [&] { // comment }}); llvm-svn: 242138
* [OPENMP] Drop type qualifiers from private variables.Alexey Bataev2015-07-141-0/+3
| | | | | | If the variable is marked as private in OpenMP construct, the reference to this variable should not keep type qualifiers for the original variable. Private copy is not volatile or constant, so we can use unqualified type for private copy. llvm-svn: 242133
* Classes inside lambdas are local not nested.Serge Pavlov2015-07-141-10/+4
| | | | | | | | | | | | | If a lambda used as default argument in a method declaration contained a local class, that class was incorrectly recognized as nested class. In this case compiler tried to postpone parsing of this class until the enclosing class is finished, which caused crashes in some cases. This change fixes PR13987. Differential Revision: http://reviews.llvm.org/D11006 llvm-svn: 242132
* Fix for clang memcpyizer bugs 23911 and 23924 (patch by Denis Zobnin)Alexey Bataev2015-07-141-13/+23
| | | | | | | The fix is to remove duplicate copy-initialization of the only memcpy-able struct member and to correct the address of aggregately initialized members in destructors' calls during stack unwinding (in order to obtain address of struct member by using GEP instead of 'bitcast'). Differential Revision: http://reviews.llvm.org/D10990 llvm-svn: 242127
* Add support for -fuse-ld= in the mingw toolchain driver.Yaron Keren2015-07-141-2/+10
| | | | | | | | | | | | We will still default to ld until such a time lld become a stable release. lld supports arm NT under the machine name "thumb2pe". http://reviews.llvm.org/D11088 Patch by Martell Malone Reviewed by Reid Kleckner llvm-svn: 242121
* [modules] When diagnosing errors in module map files found by 'extern ↵Richard Smith2015-07-141-4/+5
| | | | | | module' declarations, show how we got to that module map file. llvm-svn: 242105
* Remove a completely redundant initialization of llvm::TimePassesIsEnabled,Adrian Prantl2015-07-141-2/+0
| | | | | | | | which is actually the variable backing up the llvm -time-passes command line argument. llvm::TimePassesIsEnabled is actually being initialized in CodeGenAction. llvm-svn: 242099
* Basic code generation for MSan use-after-dtor.Evgeniy Stepanov2015-07-141-0/+23
| | | | | | | | | Under the -fsanitize-memory-use-after-dtor (disabled by default) insert an MSan runtime library call at the end of every destructor. Patch by Naomi Musgrave. llvm-svn: 242097
* Extend -ftime-report to give more information about time spent reading ↵Richard Smith2015-07-142-3/+30
| | | | | | module files. llvm-svn: 242094
* [Intrin.h] Use __ATOMIC_SEQ_CST instead of '5'David Majnemer2015-07-131-31/+37
| | | | | | No functionality change is intended. llvm-svn: 242087
* [Intrin.h] Make the variable names more consistentDavid Majnemer2015-07-131-34/+32
| | | | | | No functionality change intended. llvm-svn: 242086
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-138-18/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | CUDA code. NOTE: reverts r242077 to reinstate r242058, r242065, 242067 and includes fix for OS X test failures. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242085
* [OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao2015-07-136-7/+46
| | | | llvm-svn: 242080
* This reverts commit r242058, r242065, r242067.Rafael Espindola2015-07-138-328/+18
| | | | | | | | | | The tests were failing on OS X. Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code." Revert "Fixed regex to properly match '64' in the test case." Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least." llvm-svn: 242077
* Move class into an anonymous namespace. NFC.Benjamin Kramer2015-07-131-0/+2
| | | | llvm-svn: 242064
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-138-18/+328
| | | | | | | | | | | | | | | | | | | | | | | CUDA code. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242058
* [Modules] Allow missing header before a missing requirementBen Langmuir2015-07-131-7/+11
| | | | | | | | | | | And make the module unavailable without breaking any parent modules. If there's a missing requirement after we've already seen a missing header, still update the IsMissingRequiement bit correctly. Also, diagnose missing requirements before missing headers, since the existence of the header is moot if there are missing requirements. llvm-svn: 242055
* clang-format: Print token type name instead of number in -debug outputBirunthan Mohanathas2015-07-133-60/+84
| | | | | | Differential Revision: http://reviews.llvm.org/D11125 llvm-svn: 242039
* Support alternate attribute spelling __enable_if__Ulrich Weigand2015-07-131-1/+2
| | | | | | | | | | | | | | | | | | | | Attribute names usually support an alternate spelling that uses double underscores before and after the attribute name, like e.g. attribute ((__aligned__)) for attribute ((aligned)). This is necessary to allow use of attributes in system headers without polluting the name space. However, for attribute ((enable_if)) that alternate spelling does not work correctly. This is because of code in Parser::ParseGNUAttributeArgs (ParseDecl.cpp) that specifically checks for the "enable_if" spelling without allowing the alternate spelling. Similar code in ParseDecl.cpp uses the normalizeAttrName helper to allow both spellings. This patch adds use of that helper for the "enable_if" check as well, which fixes attribute ((__enable_if__)). Differential Revision: http://reviews.llvm.org/D11142 llvm-svn: 242029
* Update commentUlrich Weigand2015-07-131-5/+1
| | | | | | | As noticed by David Majnemer, update an out-of-date comment in CGClass.cpp after the r241916 commit. llvm-svn: 242021
* Set the linkage before setting the visibility.Rafael Espindola2015-07-132-11/+10
| | | | | | | | | Otherwise the visibility setting code would not know that a given function was available_externally. Fixes PR24097. llvm-svn: 242012
* Intrin.h: Don't invade the program's namespaceDavid Majnemer2015-07-131-34/+34
| | | | | | | The program is permitted to have stuff like '#define x' in it so avoid using identifiers not reserved for the implementation. llvm-svn: 242010
* Intrin.h: Clean up our atomic intrinsicsDavid Majnemer2015-07-131-43/+31
| | | | | | | | | | | | | | Three things: - The atomic intrinsics mandate memory barriers, let's start emitting some. - We don't need to manually create RMW operations, we can just do __atomic_fetch_foo instead of performing __atomic_foo_fetch and undoing foo. - Don't use inline assembly, we don't need it for these intrinsics. This fixes PR24101. llvm-svn: 242009
* Minor simplification, no functionality change.Richard Smith2015-07-122-17/+3
| | | | llvm-svn: 242001
* [modules] Improve performance when there is a local declaration of an entityRichard Smith2015-07-124-131/+169
| | | | | | | | before the first imported declaration. We don't need to track all formerly-canonical declarations of an entity; it's sufficient to track those ones for which no other formerly-canonical declaration was imported into the same module. We call those ones "key declarations", and use them as our starting points for collecting redeclarations and performing namespace lookups. llvm-svn: 241999
* [Sema] If lvalue to rvalue reference cast is valid don't emit diagnostic.Davide Italiano2015-07-121-2/+4
| | | | | | | | | | | | | In the test, y1 is not reference compatible to y2 and we currently assume the cast is ill-formed so we emit a diagnostic. Instead, in order to honour the standard, if y1 it's not reference-compatible to y2 then it can't be converted using a static_cast, and a reinterpret_cast should be tried instead. Richard Smith provided the correct interpretation of the standard and explanation about the subtle difference between "can't be cast" and "the cast is ill-formed". The former applies in this case. PR: 23802 llvm-svn: 241998
* clang-format: Add Mozilla brace breaking styleBirunthan Mohanathas2015-07-123-1/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D10883 llvm-svn: 241986
* Sema: Allow null names to be passed in to isAcceptableTagRedeclarationJustin Bogner2015-07-104-11/+11
| | | | | | | | | | | | | It's possible for TagRedeclarations to involve decls without a name, ie, anonymous enums. We hit some undefined behaviour if we bind these null names to the reference here. We never dereference the name, so it's harmless if it's null - make it a pointer to allow that. Fixes the Modules/submodules-merge-defs.cpp test under ubsan. llvm-svn: 241963
* [modules] When checking the include guard for a header, check whether it'sRichard Smith2015-07-101-8/+10
| | | | | | | | | | visible in the module we're considering entering. Previously we assumed that if we knew the include guard for a modular header, we'd already parsed it, but that need not be the case if a header is present in the current module and one of its dependencies; the result of getting this wrong was that the current module's submodule for the header would end up empty. llvm-svn: 241953
OpenPOWER on IntegriCloud