summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: [Proto] Handle enum bodies differently.Daniel Jasper2015-07-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | In proto, enum constants can contain complex options and should be handled more like individual declarations. Before: enum Type { UNKNOWN = 0 [(some_options) = { a: aa, b: bb }]; }; After: enum Type { UNKNOWN = 0 [(some_options) = { a: aa, b: bb }]; }; llvm-svn: 242404
* [OPENMP] Fixed detection of canonical loops with random access iterators.Alexey Bataev2015-07-161-4/+6
| | | | | | Add handling of iterators with copy/move constructors with default arguments + converting template constructors. llvm-svn: 242382
* [Intrin.h] Use compiler builtins to model memory barriersDavid Majnemer2015-07-161-6/+4
| | | | | | | | | | | | | | _ReadBarrier, _WriteBarrier, and _ReadWriteBarrier are essentially memory barriers of one form or another. Model these as atomic_signal_fence(ATOMIC_SEQ_CST). __faststorefence is a curious intrinsic. It's single purpose seems to an alternative to mfence when that instruction is slow. However, mfence is not always slow and is, in general, preferable to a 'lock or' sequence on certain CPUs. Give the compiler freedom to select the best sequence to get a fence. llvm-svn: 242378
* PR10405 - Desugar FunctionType and TemplateSpecializationType if any type ↵Nikola Smiljanic2015-07-161-4/+56
| | | | | | that appears inside needs to be desugared. llvm-svn: 242371
* [ARM] Pass subtarget feature "+no-movt" instead of passing backend optionAkira Hatanaka2015-07-161-4/+4
| | | | | | | | | | | | | | "-arm-use-movt=0". This change is needed since backend options do not make it to the backend when doing LTO and are not capable of changing the behavior of code-gen passes on a per-function basis. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D11025 llvm-svn: 242368
* [clang-cl] Use the Windows response file tokenizerReid Kleckner2015-07-151-1/+3
| | | | | | | | | | | | | | | | | | | | We were still using the Unix response file tokenizer for all driver modes. This was difficult to get right in the beginning because there is a circular dependency. The Driver class also can't officially determine its mode until it can see all possible --driver-mode= flags, and those flags could come from the response file. Now we use the Windows parsing algorithm if the program name looks like clang-cl, or if the --driver-mode=cl flag is present on the main command line. Fixes PR23709. Reviewers: hans Differential Revision: http://reviews.llvm.org/D11229 llvm-svn: 242346
* [Static Analyzer] Do not fail silently, when the analyzer is invoked from ↵Gabor Horvath2015-07-151-1/+6
| | | | | | tooling lib, an analyzer plugin is loaded, but the runtime linker fails to link. llvm-svn: 242326
* Allow any comment to be a trailing comment when -fparse-all-comments is on.James Dennett2015-07-151-7/+79
| | | | | | | | | | | | | | | | | | | | | | | | This helps with freeform documentation styles, where otherwise code like enum class E { E1, // D1 E2 // D2 }; would result in D1 being associated with E2. To properly associate E1 with D1 and E2 with D2, this patch allows all raw comments C such that C.isParseAllComments() to participate in trailing comment checks inside getRawCommentForDeclNoCache. This takes care of linking the intended documentation with the intended decls. There remains an issue with code like: foo(); // DN int x; To prevent DN from being associated with x, this patch adds a new test on preceding-line comments C (where C.isParseAllComments() and also C's kind is RCK_OrdinaryBCPL or RCK_OrdinaryC) that checks whether C is the first non-whitespace thing on C's starting line. Patch from Luke Zarko <zarko@google.com>, D11069 reviewed by rsmith. llvm-svn: 242317
* clang-format: Fix return type breaking with overloaded operator functionsBirunthan Mohanathas2015-07-152-15/+60
| | | | | | Differential Revision: http://reviews.llvm.org/D11177 llvm-svn: 242316
* Run clang-format on Tools.h, the indentation is inconsistentReid Kleckner2015-07-151-392/+378
| | | | llvm-svn: 242309
* [Targets] Define __BOOL_DEFINED for Windows targets in C++ modeDavid Majnemer2015-07-151-0/+2
| | | | | | | | | | MSVC 4.2 didn't have bool as a builtin type but MSVC 5.0 does. When they added it, they added a macro (__BOOL_DEFINED) which allows build scripts and the like to know if they should provide their own bool. Clang always supports bool as a builtin type in C++ mode. llvm-svn: 242307
* Add the ability to AST match a variable declaration that is an exception ↵Aaron Ballman2015-07-151-0/+1
| | | | | | variable. llvm-svn: 242303
* clang-format: Fix column layout with a comment in the last line.Daniel Jasper2015-07-151-1/+2
| | | | | | | | | | | | | | | | | | Before: int aaaaa[] = { 1, 2, 3, // comment 4, 5, 6 // comment }; After: int aaaaa[] = { 1, 2, 3, // comment 4, 5, 6 // comment }; llvm-svn: 242299
* [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
OpenPOWER on IntegriCloud