summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Replace second (hopefully unused) access of macro input argument with zero ↵Sanjay Patel2015-03-121-3/+3
| | | | | | | | | | vector to be safer. Suggested by Craig Topper in D8275. This is a follow-on to r232052. llvm-svn: 232061
* ASTMatchers: Add an explicit dependency on libclangBasic.Benjamin Kramer2015-03-121-0/+1
| | | | | | | In a static build the dependency is picked up implictly, but not in a shared library build. This is needed for the new ObjC matchers that reference Selector. llvm-svn: 232055
* [X86, AVX] replace vextractf128 intrinsics with generic shufflesSanjay Patel2015-03-122-16/+28
| | | | | | | | | | | This is very much like D8088 (checked in at r231792). Now that we've replaced the vinsertf128 intrinsics, do the same for their extract twins. Differential Revision: http://reviews.llvm.org/D8275 llvm-svn: 232052
* Add support for a few Objective-C matchers.Manuel Klimek2015-03-121-0/+8
| | | | | | | | | | | Add some matchers for Objective-C selectors and messages to ASTMatchers.h. Minor mods to ASTMatchersTest.h to allow test files with ".m" extension in addition to ".cpp". New tests added to ASTMatchersTest.c. Patch by Dean Sutherland. llvm-svn: 232051
* clang-format: When putting */& next to types, also wrap before them.Daniel Jasper2015-03-122-5/+12
| | | | | | | | | | | | Before: LoooooooooooongType * loooooooooooongVariable; After: LoooooooooooongType *loooooooooooongVariable; llvm-svn: 232044
* clang-format: [Java] Support anonymous classes after = and return.Daniel Jasper2015-03-122-0/+29
| | | | | | | | | | | | | | | | | | | Before: A a = new A(){public String toString(){return "NotReallyA"; } } ; After: A a = return new A() { public String toString() { return "NotReallyA"; } }; This fixes llvm.org/PR22878. llvm-svn: 232042
* Sema: Don't emit a missing prototype warning for deleted functions.Benjamin Kramer2015-03-122-27/+32
| | | | | | | | | | | | | This is a bit more involved than I anticipated, so here's a breakdown of the changes: 1. Call ActOnFinishFunctionBody _after_ we parsed =default and =delete specifiers. Saying that we finished the body before parsing =default is just wrong. Changing this allows us to use isDefaulted and isDeleted on a decl in ActOnFinishFunctionBody. 2. Check for -Wmissing-prototypes after we parsed the function body. 3. Disable -Wmissing-prototypes when the Decl isDeleted. llvm-svn: 232040
* Use Sema's PrintingPolicy when diagnosing DeclSpecs.Benjamin Kramer2015-03-121-1/+2
| | | | | | | | | | | | | Sema overrides ASTContext's policy on the first emitted diagnostic (doesn't matter if it's ignored or not). This means changing the order of diagnostic emission in Sema suddenly changes the text of diagnostic emitted from the parser. In the test case -Wmissing-prototypes (ignored) was the culprit, use 'int main' to suppress that warning so we see when this regresses. Also move it into Sema/ as it's not testing any C++. llvm-svn: 232039
* Reverting r232034, as it broke one of the bots with link errors. Details at: ↵Aaron Ballman2015-03-121-8/+0
| | | | | | http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/6352/steps/build/logs/stdio llvm-svn: 232038
* Instead of dereferencing std::vector::end() (which is UB and causes failed ↵Aaron Ballman2015-03-121-1/+2
| | | | | | assertions in debug builds with Visual Studio), use data() + size() to calculate the end iterator. Amends r231952. llvm-svn: 232037
* [OPENMP] CodeGen - 'omp for' with dynamic schedule kinds.Alexander Musman2015-03-123-44/+213
| | | | | | Differential Revision: http://reviews.llvm.org/D7138 llvm-svn: 232036
* Added some matchers for objective c selectors and messages to ASTMatchers.h. ↵Aaron Ballman2015-03-121-0/+8
| | | | | | | | Minor mods to ASTMatchersTest.h to allow test files with ".m" extension in addition to ".cpp". New tests added to ASTMatchersTest.c. Patch by Dean Sutherland, reviewed by Manuel Klimek. From http://reviews.llvm.org/D7710 llvm-svn: 232034
* [OPENMP] Initial codegen for 'omp sections' and 'omp section' directives.Alexey Bataev2015-03-122-23/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If only one section is found in the sections region, it is emitted just like single region. Otherwise it is emitted as a static non-chunked loop. #pragma omp sections { #pragma omp section {1} ... #pragma omp section {n} } is translated to something like i32 <iter_var> i32 <last_iter> = 0 i32 <lower_bound> = 0 i32 <upper_bound> = n-1 i32 <stride> = 1 call void @__kmpc_for_static_init_4(<loc>, i32 <gtid>, i32 34/*static non-chunked*/, i32* <last_iter>, i32* <lower_bound>, i32* <upper_bound>, i32* <stride>, i32 1/*increment always 1*/, i32 1/*chunk always 1*/) <upper_bound> = min(<upper_bound>, n-1) <iter_var> = <lb> check: br <iter_var> <= <upper_bound>, label cont, label exit continue: switch (IV) { case 0: {1}; break; ... case <NumSection> - 1: {n}; break; } ++<iter_var> br label check exit: call void @__kmpc_for_static_fini(<loc>, i32 <gtid>) Differential Revision: http://reviews.llvm.org/D8244 llvm-svn: 232021
* Driver: Keep -isysroot flags in crash scripts if we're dumping a VFSJustin Bogner2015-03-121-4/+7
| | | | | | | | | | | | | For crashes with a VFS (ie, with modules), the -isysroot flag is often necessary to reproduce the crash. This is especially true if some modules need to be rebuilt, since without the sysroot they'll try to read headers that are outside of the VFS. I find it likely that we should keep some of the other -i flags in this case as well, but I haven't seen that come up in practice yet so it seems better to be conservative. llvm-svn: 231997
* Driver: Print the clang version and original command in crash scriptsJustin Bogner2015-03-121-0/+3
| | | | | | | | | | When a crash report script doesn't work for a reproduction on your machine for one reason or another, it can be really tricky to figure out why not. The compiler version that crashed and the original command line before stripping flags are very helpful when this comes up. llvm-svn: 231989
* Under duress, move check for target support of __builtin_setjmp/Joerg Sonnenberger2015-03-115-46/+28
| | | | | | __builtin_longjmp to Sema as requested by John McCall. llvm-svn: 231986
* Add deprecation notice for -f(no-)sanitize-recover flags.Alexey Samsonov2015-03-111-2/+7
| | | | | | | These flags should be replaced with corresponding -f(no-)sanitize-recover=<list> flags. llvm-svn: 231983
* [PowerPC] ABI support for the QPX vector instruction setHal Finkel2015-03-113-26/+108
| | | | | | | | | | | | | | Support for the QPX vector instruction set, used on the IBM BG/Q supercomputer, has recently been added to the LLVM PowerPC backend. This vector instruction set requires some ABI modifications because the ABI on the BG/Q expects <4 x double> vectors to be provided with 32-byte stack alignment, and to be handled as native vector types (similar to how Altivec vectors are handled on mainline PPC systems). I've named this ABI variant elfv1-qpx, have made this the default ABI when QPX is supported, and have updated the ABI handling code to provide QPX vectors with the correct stack alignment and associated register-assignment logic. llvm-svn: 231960
* MS ABI: Implement copy-ctor closures, finish implementing throwDavid Majnemer2015-03-1110-29/+296
| | | | | | | | | | | | | | | This adds support for copy-constructor closures. These are generated when the C++ runtime has to call a copy-constructor with a particular calling convention or with default arguments substituted in to the call. Because the runtime has no mechanism to call the function with a different calling convention or know-how to evaluate the default arguments at run-time, we create a thunk which will do all the appropriate work and package it in a way the runtime can use. Differential Revision: http://reviews.llvm.org/D8225 llvm-svn: 231952
* [modules] When merging the pattern of a class template definition into a priorRichard Smith2015-03-111-0/+1
| | | | | | | | | | definition, be sure to update the definition data on all declarations, not just the canonical one, since the pattern might not be in the list of pending definitions (if it used to be canonical itself). One-line fix by me; reduced testcase by Daniel Jasper! llvm-svn: 231950
* Reverted OpenCL2.0 atomic type commits r231932, r231935Anastasia Stulova2015-03-113-71/+1
| | | | | | (caused undesirable update of -std flag to use _Atomic) llvm-svn: 231942
* revert r231700 (designated initializer patch) which brokeFariborz Jahanian2015-03-113-18/+5
| | | | | | several projects. rdar://20120666. llvm-svn: 231939
* OpenCL: CL2.0 atomic type diagnosticsAnastasia Stulova2015-03-111-0/+22
| | | | | | Added restictions for atomic type usage from OpenCL C Spec Section 6.13.11.8 llvm-svn: 231935
* OpenCL: CL2.0 atomic typesAnastasia Stulova2015-03-112-1/+49
| | | | | | | | | | | | OpenCL C Spec v2.0 Section 6.13.11 - Made c11 _Atomic being accepted only for c11 compilations - Implemented CL2.0 atomics by aliasing them to the corresponding c11 atomic types using implicit typedef - Added diagnostics for atomics Khronos extension enabling llvm-svn: 231932
* Add builtins for the 64-bit vector integer arithmetic instructions added in ↵Kit Barton2015-03-112-1/+776
| | | | | | | | | | POWER8. These are the Clang-related changes for the instructions added to LLVM in http://reviews.llvm.org/D7959. Phabricator review: http://reviews.llvm.org/D8041 llvm-svn: 231931
* clang-format: Recognize the .ts (TypeScript) extension as JavaScript.Daniel Jasper2015-03-111-1/+2
| | | | | | Patch by Martin Probst. Thank you. llvm-svn: 231926
* clang-format: Fix incorrect && recognition.Daniel Jasper2015-03-111-0/+2
| | | | | | | | | | Before: if (a &&(b = c)) .. After: if (a && (b = c)) .. llvm-svn: 231920
* Enable security checks for arc4random() on CloudABI as well.Ed Schouten2015-03-111-0/+1
| | | | | | | CloudABI also supports the arc4random() function. We can enable compiler warnings for rand(), random() and *rand48() on this system as well. llvm-svn: 231914
* Fix up default header paths for CloudABI.Ed Schouten2015-03-111-1/+16
| | | | | | | | | | | CloudABI is a pure cross compilation target. This means that we should not add /usr/include and /usr/local/include. Instead, headers are stored in $sysroot/$triple/include. The method of going back to the sysroot (by using "../../..") is also used in this function for some of the other environments (e.g., MinGW). llvm-svn: 231913
* Add target information for CloudABI on x86-64.Ed Schouten2015-03-111-0/+24
| | | | | | | | | | | CloudABI can be identified by the __CloudABI__ preprocessor definition. The system uses ELF executables. CloudABI uses Unicode 7.0.0 for the encoding of wchar_t. As Unicode 7.0.0 is synchronized with ISO/IEC 10646:2012 (released on 2012-06-01), __STDC_ISO_10646__ is defined as 201206L. llvm-svn: 231912
* Sema: Properly track mangling number/name for linkage for using declsDavid Majnemer2015-03-113-52/+66
| | | | | | | | | | | | Using declarations which are aliases to struct types have their name used as the struct type's name for linkage purposes. Otherwise, make sure to give an anonymous struct defined inside a using declaration a mangling number to disambiguate it from other anonymous structs in the same context. This fixes PR22809. llvm-svn: 231909
* [OPENMP] Fix for ExprWithCleanups in 'omp atomic' constructs.Alexey Bataev2015-03-112-0/+9
| | | | | | | This patch allows using of ExprWithCleanups expressions and other complex expressions in 'omp atomic' construct Differential Revision: http://reviews.llvm.org/D8200 llvm-svn: 231905
* CGOpenMPRuntime.h: Fix an incorrect \param on emitTaskOutlinedFunction(). ↵NAKAMURA Takumi2015-03-111-1/+1
| | | | | | [-Wdocumentation] llvm-svn: 231903
* [modules] Avoid accidentally completing the redeclaration chain when updatingRichard Smith2015-03-112-15/+23
| | | | | | | all the existing declarations of a record-like entity with a pointer to its definition. llvm-svn: 231901
* For PR22870: produce an error rather than asserting if a designated ↵Richard Smith2015-03-111-1/+1
| | | | | | initializer appears in a signature. llvm-svn: 231892
* Gender-neutralize a comment.Nico Weber2015-03-111-2/+2
| | | | llvm-svn: 231891
* [modules] Fix iterator invalidation issue with names being added to a moduleRichard Smith2015-03-111-6/+9
| | | | | | while we're writing out the identifier table. llvm-svn: 231890
* [analyzer] Make getCheckIfTracked() return either leak or regular checker.Anton Yartsev2015-03-101-19/+29
| | | | llvm-svn: 231863
* [Objective-C Sema]. Remove -Wreceiver-is-weak warning.Fariborz Jahanian2015-03-101-67/+0
| | | | | | | It is incorrect and better warning is issued under -Warc-repeated-use-of-weak. rdar://16316934. llvm-svn: 231851
* MS ABI: Mangle the location of the catchable type into it's nameDavid Majnemer2015-03-102-3/+19
| | | | | | | | Because the catchable type has a reference to its name, mangle the location to ensure that two catchable types with different locations are distinct. llvm-svn: 231819
* Recognize objc_bridge(id) on bridged casts to CF types.John McCall2015-03-101-0/+3
| | | | | | Fixes <rdar://20107345>. llvm-svn: 231814
* [X86, AVX] Replace vinsertf128 intrinsics with generic shuffles.Sanjay Patel2015-03-102-19/+36
| | | | | | | | | | | | | | We want to replace as much custom x86 shuffling via intrinsics as possible because pushing the code down the generic shuffle optimization path allows for better codegen and less complexity in LLVM. This is the sibling patch for the LLVM half of this change: http://reviews.llvm.org/D8086 Differential Revision: http://reviews.llvm.org/D8088 llvm-svn: 231792
* Teach raw_ostream to accept SmallString.Yaron Keren2015-03-103-3/+3
| | | | | | | | | | | | | | Saves adding .str() call to any raw_ostream << SmallString usage and a small step towards making .str() consistent in the ADTs by removing one of the SmallString::str() use cases, discussion at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html I'll update the Phabricator patch http://reviews.llvm.org/D6372 for review of the Twine SmallString support, it's more complex than this one. llvm-svn: 231763
* [OPENMP] Initial codegen for 'omp task' directive.Alexey Bataev2015-03-104-19/+396
| | | | | | | | | | | | | | | | | The task region is emmitted in several steps: Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry). Here task_entry is a pointer to the function: kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) { TaskFunction(gtid, tt->part_id, tt->shareds); return 0; } Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any). Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t. Emit a call to kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task), where new_task is a resulting structure from previous items. Differential Revision: http://reviews.llvm.org/D7560 llvm-svn: 231762
* [OPENMP] Improved code for generating debug info + generation of all OpenMP ↵Alexey Bataev2015-03-103-23/+30
| | | | | | | | | regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935 llvm-svn: 231757
* Revert "[OPENMP] Improved code for generating debug info + generation of all ↵Rafael Espindola2015-03-103-29/+23
| | | | | | | | | | | | | OpenMP regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935" This reverts commit r231752. It was failing to link with cmake: lib64/libclangCodeGen.a(CGOpenMPRuntime.cpp.o):/home/espindola/llvm/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:function clang::CodeGen::InlinedOpenMPRegionRAII::~InlinedOpenMPRegionRAII(): error: undefined reference to 'clang::CodeGen::EHScopeStack::popTerminate()' clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation) llvm-svn: 231754
* [OPENMP] Improved code for generating debug info + generation of all OpenMP ↵Alexey Bataev2015-03-103-23/+29
| | | | | | | | | regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935 llvm-svn: 231752
* [modules] Don't bother looking up a declaration to merge into if we're notRichard Smith2015-03-101-1/+6
| | | | | | actually loading a formerly-canonical declaration. llvm-svn: 231742
* Update for LLVM API change: getOrEnforceKnownAlignment() requires a DataLayoutMehdi Amini2015-03-101-2/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231739
* PR21687: when adding a redeclaration of a function with an implicit exceptionRichard Smith2015-03-101-6/+15
| | | | | | | | | specification, update all prior declarations if the new one has an explicit exception specification and the prior ones don't. Patch by Vassil Vassilev! Some minor tweaking and test case by me. llvm-svn: 231738
OpenPOWER on IntegriCloud