summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix spurious warnings about unused private fieldOlivier Goffart2016-05-091-4/+6
| | | | | | | | | | | | If the address of a field is taken as a pointer to member, we should not warn that the field is not used. Normaly, yse of fields are done from MemberExpr, but in case of pointer to member, it is in a DeclRefExpr Differential Revision: http://reviews.llvm.org/D20054 llvm-svn: 268895
* clang-format: Fix space after argument comments.Daniel Jasper2016-05-081-1/+1
| | | | | | | | | | Before: f(/*a=*/a, /*b=*/ ::b); After: f(/*a=*/a, /*b=*/::b); llvm-svn: 268879
* clang-format: Support enum type template arguments.Daniel Jasper2016-05-081-0/+7
| | | | | | | | | | | | | Before: template <enum E> class A { public : E *f(); }; After: template <enum E> class A { public: E *f(); }; llvm-svn: 268878
* Teach header search about GCC 4.9 header search paths in Gentoo, theyChandler Carruth2016-05-081-0/+1
| | | | | | now use the full GCC version in their weird suffix. llvm-svn: 268874
* [OpenMP] Check for associated statements with hasAssociatedStmt() when ↵Samuel Antao2016-05-081-1/+1
| | | | | | | | | | | | | | scanning for device code. Summary: `getAssociatedStmt()` contains an assertion that assumes the statement always exists. In device code scanning, we need to look into the associated statement therefore we check its existence. This patch replaces `getAssociatedStmt` by `hasAssociatedStmt` so that we do not trigger the assertion for directives that happen not to have an associated statement (e.g target enter/exit data). Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D19812 llvm-svn: 268870
* [CrashReproducer] Always use realpath for destinationBruno Cardoso Lopes2016-05-061-20/+13
| | | | | | | | | | When running reproducer scripts we need that original symlinks from the source filesystem are reproduced in the VFS so that different virtual paths can map to the same file, allowing the FileManager to share the same UID between these virtual entries. This avoids all sorts of module redefinition errors when using frameworks. llvm-svn: 268825
* [VFS] Add dump methods to the VFS overlay treeBruno Cardoso Lopes2016-05-061-0/+24
| | | | | | Useful when debugging issues within the VFS overlay. llvm-svn: 268820
* [CrashReproducer] Change module map callback signature. NFCBruno Cardoso Lopes2016-05-062-3/+2
| | | | | | | | Use a StringRef instead of a FileEntry in the moduleMapAddHeader callback to allow more flexibility on what to collect on further patches. This changes the interface I introduced in r264971. llvm-svn: 268819
* [modules] Attempt to improve performance for declaration merging without a SemaRichard Smith2016-05-062-5/+9
| | | | | | | | | | object in C. Rather than using the DeclContext (which is very slow because it triggers us to build a lookup table for the DeclContext), use a separate map from identifiers to decls for this case, containing only the ones we've actually deserialized. For convenience, this map is implemented as an IdentifierResolver. llvm-svn: 268817
* Availability: set location when creating attribute for tvos, watchos.Manman Ren2016-05-062-6/+13
| | | | | | | | | | | | When inferring availability attributes for tvos, watchos from ios, we use the same source location and set the implicit bit to true. So when emitting diagnostics on inferred attributes, we have a source location. rdar://25893544 llvm-svn: 268793
* Availability: attach the note to the declaration with the attributes.Manman Ren2016-05-061-3/+50
| | | | | | | | | | | | | Sometimes, the declaration we found has inherited availability attributes, attaching the note to it does not tell us where the availability attributes are in the source. Go through the redecl chain to find the declaration with actual availability attributes. rdar://25221771 llvm-svn: 268786
* ObjC kindof: set the type of a conditional expression when involving kindof.Manman Ren2016-05-061-4/+13
| | | | | | | | When either LHS or RHS is a kindof type, we return a kindof type. rdar://problem/20513780 llvm-svn: 268781
* Frontend: support -I=path for sysroot expansionSaleem Abdulrasool2016-05-061-2/+14
| | | | | | | | | | | | | | | | | | From the GCC manpage: -I dir ... If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot. Add support to expand the `=` as a prefix of the include path with the sysroot if specified. `-isysroot` takes precedence over `--sysroot` as the normal argument behaviour occurs. The ordering of the `-isysroot` is relevant to the path substituted. If no `--sysroot=` or `-isysroot` option is present, the = is not expanded. Resolves PR26965! llvm-svn: 268777
* Revert "AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels."Nikolay Haustov2016-05-061-8/+0
| | | | | | | | This reverts commit f7053ec90d0fc56f0837e43c2c759e85b56c21a1. It broke calling OpenCL kernel from another kernel. llvm-svn: 268740
* Revert r268727, it caused PR27666.Nico Weber2016-05-0611-62/+20
| | | | llvm-svn: 268736
* Adding omitted column to invalid loc diagnostic.Ben Craig2016-05-061-1/+1
| | | | | | | | | | | note_fe_backend_invalid_loc expects three arguments (file, line, column), and will assert when only given two. The other two places in this file that use note_fe_backend_invalid_loc already supply the Column for the third parameter. http://reviews.llvm.org/D19936 llvm-svn: 268732
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-0611-20/+62
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367. Differential Revision: http://reviews.llvm.org/D19654 llvm-svn: 268727
* [OPENMP 4.0] Codegen for 'declare simd' directive.Alexey Bataev2016-05-063-0/+234
| | | | | | | | | OpenMP 4.0 adds support for elemental functions using declarative directive '#pragma omp declare simd'. Patch adds mangling for simd functions in accordance with https://sourceware.org/glibc/wiki/libmvec?action=AttachFile&do=view&target=VectorABI.txt llvm-svn: 268721
* AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels.Nikolay Haustov2016-05-061-0/+8
| | | | | | | | | | Reviewers: tstellarAMD, arsenm Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19918 llvm-svn: 268718
* Add a FixItHint for the new diagnostic for a non-class-scope ↵Richard Smith2016-05-051-0/+14
| | | | | | using-declaration that names a class-scope enumerator. llvm-svn: 268664
* AMDGPU: Use lld as the linker againTom Stellard2016-05-052-1/+3
| | | | | | | | | | | | | | Summary: Now that LLVM is emitting version 2 of the AMD code object, we can start using lld again for linking instead of our custom tool. Reviewers: arsenm, kzhuravl Subscribers: rafael, cfe-commits Differential Revision: http://reviews.llvm.org/D19952 llvm-svn: 268648
* [OPENMP 4.5] Codegen for 'lastprivate' clauses in 'taskloop' directives.Alexey Bataev2016-05-053-84/+273
| | | | | | | OpenMP 4.5 adds taskloop/taskloop simd directives. These directives allow to use lastprivate clause. Patch adds codegen for this clause. llvm-svn: 268618
* Update FIXME.Richard Smith2016-05-051-2/+1
| | | | llvm-svn: 268595
* Fix implementation of C++'s restrictions on using-declarations referring to ↵Richard Smith2016-05-051-5/+17
| | | | | | | | | | | enumerators: * an unscoped enumerator whose enumeration is a class member is itself a class member, so can only be the subject of a class-scope using-declaration. * a scoped enumerator cannot be the subject of a class-scope using-declaration. llvm-svn: 268594
* Do not add uwtable attribute by default for MachO targets.Akira Hatanaka2016-05-051-0/+5
| | | | | | | | | | r217178 changed clang to add function attribute uwtable by default on Win64, which caused the __eh_frame section to be emitted by default. This commit restores the previous behavior for MachO targets. rdar://problem/25282627 llvm-svn: 268589
* [modules] Enforce the rules that an explicit or partial specialization must beRichard Smith2016-05-058-59/+350
| | | | | | | | declared before it is used. Because we don't use normal name lookup to find these, the normal code to filter out non-visible names from name lookup results does not apply. llvm-svn: 268585
* [SystemZ] Add -mbackchain option.Marcin Koscielnicki2016-05-043-0/+14
| | | | | | | | | This option, like the corresponding gcc option, is SystemZ-specific and enables storing frame backchain links, as specified in the ABI. Differential Revision: http://reviews.llvm.org/D19891 llvm-svn: 268575
* Add the Pure attribute to C99 builtin functions from ctype.h. This is a ↵Aaron Ballman2016-05-041-271/+273
| | | | | | | | corrected version of r266199 with test case fixes. Patch by Taewook Oh. llvm-svn: 268553
* document -f[no-]sanitize-recover=all and mention it in warning messagesKostya Serebryany2016-05-041-2/+4
| | | | llvm-svn: 268540
* [CodeGenObjCXX] Fix handling of blocks in lambda.Akira Hatanaka2016-05-041-26/+24
| | | | | | | | | | | This fixes a crash that occurs when a block captures a reference that is captured by its enclosing lambda. rdar://problem/18586651 Differential Revision: http://reviews.llvm.org/D19536 llvm-svn: 268532
* [ObjC] Enter a new evaluation context before callingAkira Hatanaka2016-05-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BuildBlockForLambdaConversion. Previously, clang would build an incorrect AST for the following code: id test() { return @{@"a": [](){}, @"b": [](){}}; } ReturnStmt 0x10d080448 `-ExprWithCleanups 0x10d080428 |-cleanup Block 0x10d0801f0 // points to the second BlockDecl ... -BlockDecl 0x10d07f150 // First block ... -BlockDecl 0x10d0801f0 // Second block ... `-ExprWithCleanups 0x10d0801d0 |-cleanup Block 0x10d07f150 // points to the first BlockDecl To fix the bug, this commit enters a new evaluation context to reset ExprNeedsCleanups before each block is parsed. rdar://problem/16879958 Differential Revision: http://reviews.llvm.org/D18815 llvm-svn: 268527
* [Coverage] Fix an issue where a coverage region might not be created for a ↵Igor Kudrin2016-05-041-3/+19
| | | | | | | | | | | macro containing a loop statement. The issue happened when a macro contained a full for or while statement, which body ended at the end of the macro. Differential Revision: http://reviews.llvm.org/D19725 llvm-svn: 268511
* Do not disable completely loop unroll when optimizing for size.Marianne Mailhot-Sarrasin2016-05-041-1/+1
| | | | | | | | Let the loop unroll pass handle /Os. It already checks that option and adjust its thresholds accordingly. Also, will allow the #pragma unroll to have an effect in /Os. Differential Revision: http://reviews.llvm.org/D19827 llvm-svn: 268509
* [ASTMatchers] New matcher forFunctionGabor Horvath2016-05-041-0/+1
| | | | | | | | | | | | Summary: Matcher proposed in the review of checker misc-assign-operator (name pending). Its goal is to find the direct enclosing function declaration of a statement and run the inner matcher on it. Two version is attached in this patch (thus it will not compile), to be decided which approach to take. The second one always chooses one single parent while the first one does a depth-first search upwards (thus a height-first search) and returns the first positive match of the inner matcher (thus it always returns zero or one matches, not more). Further questions: is it enough to implement it in-place, or ASTMatchersInternals or maybe ASTMatchFinder should be involved? Reviewers: sbenza Subscribers: aaron.ballman, klimek, o.gyorgy, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D19357 llvm-svn: 268490
* [Sparc] Implement __builtin_setjmp, __builtin_longjmp back-end.Chris Dewhurst2016-05-041-0/+4
| | | | | | | | | | | | | | This code implements builtin_setjmp and builtin_longjmp exception handling intrinsics for 32-bit Sparc back-ends. The code started as a mash-up of the PowerPC and X86 versions, although there are sufficient differences to both that had to be made for Sparc handling. Note: I have manual tests running. I'll work on a unit test and add that to the rest of this diff in the next day. Also, this implementation is only for 32-bit Sparc. I haven't focussed on a 64-bit version, although I have left the code in a prepared state for implementing this, including detecting pointer size and comments indicating where I suspect there may be differences. Differential Revision: http://reviews.llvm.org/D19798 llvm-svn: 268483
* [Clang][Builtin][AVX512] Adding intrinsics fot cvt{u}si2s{d|s} ↵Michael Zuckerman2016-05-041-0/+111
| | | | | | | | cvt{sd|ss}2{ss|sd} instruction set Differential Revision: http://reviews.llvm.org/D19765 llvm-svn: 268481
* [X86] Add -malign-double supportReid Kleckner2016-05-042-0/+5
| | | | | | | | | | | | | | | | | The -malign-double flag causes i64 and f64 types to have alignment 8 instead of 4. On x86-64, the behavior of -malign-double is enabled by default. Rebases and cleans phosek's work here: http://reviews.llvm.org/D12860 Patch by Sean Klein Reviewers: rnk Subscribers: rnk, jfb, dschuff, phosek Differential Revision: http://reviews.llvm.org/D19734 llvm-svn: 268473
* Fix CodeCompletion & TypoCorrection when combining a PCH with ModulesBen Langmuir2016-05-041-12/+49
| | | | | | | | | | | | | | This commit fixes the IdentifierIterator to actually include identifiers from a PCH or precompiled preamble when there is also a global module index. This was causing code-completion (outside of C++) and typo-correction to be missing global identifiers defined in the PCH/preamble. Typo-correction has been broken since we first started using the module index, whereas code-completion only started relying on identifier iterator in r232793. rdar://problem/25642879 llvm-svn: 268471
* [modules][debuginfo] Only include imported modules when targeting LLDBDavid Blaikie2016-05-032-0/+3
| | | | | | | | | | | | | | | | | These constructs are only applicable to a debugger capable of loading a Clang AST, so omit them for brevity when not doing so. We could potentially propagate more of CodeGenOptions through the ObjectFilePCGContainerOperations for consistency (so the next person who adds some CodeGenOpts feature that tweaks debug info output doesn't get caught by this), so I'm open to objections/alternatives there, but went with this for now. Tested just a couple of basic cases (one direct, one indirect (through the ObjectFilePCHContainerOperations) & fixed up other cases to pass the -debugger-tuning flag as appropriate. llvm-svn: 268460
* AArch64: fixup comment after changeTim Northover2016-05-031-1/+1
| | | | llvm-svn: 268423
* AArch64: simplify illegal vector check. NFC.Tim Northover2016-05-031-1/+1
| | | | | | | | Use a utility function to check whether the number of elements is a power of 2 and drop the redundant upper limit (a 128-bit vector with more than 16 elements would have each element < 8 bits, not possible). llvm-svn: 268422
* [MS] Pass CalleeDecl to adjustThisArgumentForVirtualFunctionCallReid Kleckner2016-05-031-1/+1
| | | | | | | | | | If we are devirtualizing, then we want to compute the 'this' adjustment of the devirtualized target, not the adjustment of the base's method definition, which is usually zero. Fixes PR27621 llvm-svn: 268418
* [clang][AVX512][BuiltIn] Adding intrinsics for ↵Michael Zuckerman2016-05-031-0/+25
| | | | | | | | cast{pd|ps|si}128_{pd|ps|si}512 and castsi256_si512 instruction set Differential Revision: http://reviews.llvm.org/D19858 llvm-svn: 268387
* [Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} ↵Michael Zuckerman2016-05-032-0/+18
| | | | | | | | instruction set Differential Revision: http://reviews.llvm.org/D19766 llvm-svn: 268385
* [Clang][AVX512][Builtin] Adding intrinsics for vcvt{ph|ps}2{ps|ph} ↵Michael Zuckerman2016-05-031-0/+59
| | | | | | | | instruction set Differential Revision: http://reviews.llvm.org/D19767 llvm-svn: 268376
* [Clang][AVX512][Builtin] Adding intrinsics for vcvttpd2udq instruction setMichael Zuckerman2016-05-031-0/+48
| | | | | | Differential Revision: http://reviews.llvm.org/D19768 llvm-svn: 268373
* [Clang][AVX512][BUILTIN] Adding intrinsics for compressstore{df|di|sf|si} ↵Michael Zuckerman2016-05-031-0/+27
| | | | | | | | instruction set. Differential Revision: http://reviews.llvm.org/D19808 llvm-svn: 268372
* [OpenCL] Fix pipe type dump.Xiuli Pan2016-05-032-1/+5
| | | | | | | | | | | | | | Summary: Fix the dump of PipeType. Now we will have "pipe int" and element type. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits, bader Differential Revision: http://reviews.llvm.org/D19524 llvm-svn: 268364
* Fix argument expansion of reference fields of structsReid Kleckner2016-05-022-1/+5
| | | | | | | | | | | | | | | | | | | r268261 made Clang "expand" more struct arguments on Windows. It removed the check for 'RD->isCLike()', which was preventing us from attempting to expand structs with reference type fields. Our expansion code was attempting to load and pass each field of the type in turn. We were accidentally doing one to many loads on reference type fields. On the function prologue side, we can use EmitLValueForFieldInitialization, which obviously gets the address of the field. On the call side, I tweaked EmitRValueForField directly, since this is the only use of this method. Fixes PR27607 llvm-svn: 268321
* Remove unneeded test in tryCaptureAsConstant.Akira Hatanaka2016-05-021-4/+4
| | | | | | | | It isn't necessary to call hasDefaultArg because we can't rematerialize a captured variable that is a function parameter, regardless of whether or not it has a default argument. NFC. llvm-svn: 268318
OpenPOWER on IntegriCloud