summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* AVX-512: Added intrinsics to clang.Elena Demikhovsky2014-07-223-0/+836
| | | | | | | The set is small, that what I have right now. Everybody is welcome to add more. llvm-svn: 213641
* [OPENMP] Initial parsing and sema analysis for 'atomic' directive.Alexey Bataev2014-07-2213-6/+138
| | | | llvm-svn: 213639
* [OPENMP] Initial parsing and sema analysis for 'ordered' directive.Alexey Bataev2014-07-2213-19/+169
| | | | llvm-svn: 213616
* Fix '&' printing for template arguments in parentheses in template diffing.Richard Trieu2014-07-221-3/+6
| | | | llvm-svn: 213613
* More gracefully handle parentheses in templare arguments in template diffing.Richard Trieu2014-07-221-1/+2
| | | | llvm-svn: 213611
* Fix a template diffing problem were an '&' is unexpectedly printed inRichard Trieu2014-07-221-6/+26
| | | | | | a template argument. llvm-svn: 213609
* Sema: correct handling for __va_start for WoASaleem Abdulrasool2014-07-221-1/+66
| | | | | | | | | | | | | | | | | | Windows ARM indicates __va_start as a variadic function. However, the function itself is treated as having 4 formal arguments: - (out) pointer to the va_list - (in) address of the last named argument - (in) slot size for the type of the last argument - address of the last named argument The last argument does not seem to have any bearing on codegen, and thus is not explicitly type checked at this point. Unlike the previous handling for __va_start, it does not currently validate if the parameter is the last named parameter (it seems that MSVC currently accepts this). llvm-svn: 213595
* Avoid crash if default argument parsed with errors.Serge Pavlov2014-07-223-4/+8
| | | | | | | | | | | | | | If function parameters have default values, and that of the second parameter is parsed with errors, function declaration would have a parameter without default value that follows a parameter with that. Such declaration breaks logic of selecting overloaded function. As a solution, put opaque object as default value in such case. This patch fixes PR20055. Differential Revision: http://reviews.llvm.org/D4378 llvm-svn: 213594
* -fms-extensions: Implement half of #pragma init_segReid Kleckner2014-07-227-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This pragma is very rare. We could *hypothetically* lower some uses of it down to @llvm.global_ctors, but given that GlobalOpt isn't able to optimize prioritized global ctors today, there's really no point. If we wanted to do this in the future, I would check if the section used in the pragma started with ".CRT$XC" and had up to two characters after it. Those two characters could form the 16-bit initialization priority that we support in @llvm.global_ctors. We would have to teach LLVM to lower prioritized global ctors on COFF as well. This should let us compile some silly uses of this pragma in WebKit / Blink. Reviewers: rsmith, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4549 llvm-svn: 213593
* clang-cl: ignore /showIncludes when combined with /E (PR20336)Hans Wennborg2014-07-211-2/+5
| | | | | | | | Both /showIncludes and /E write to stdout. Allowing both results in interleaved output and an error when double-closing the file descriptor, intended to catch issues like this. llvm-svn: 213589
* Rename metadata llvm.loop.vectorize.unroll to llvm.loop.vectorize.interleave.Mark Heffernan2014-07-213-3/+3
| | | | llvm-svn: 213587
* Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary ↵Arnaud A. de Grandmaison2014-07-213-78/+24
| | | | | | | | | objects." This commit did break the sanitizer-x86 bot. Revert it while investigating. llvm-svn: 213579
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-07-213-24/+78
| | | | | | This will give more information to the optimizers so that they can reuse stack slots. llvm-svn: 213576
* Add support for '#pragma unroll'.Mark Heffernan2014-07-213-127/+223
| | | | llvm-svn: 213574
* Sema: Handle C11 atomics when diagnosing out of range comparisonsJustin Bogner2014-07-211-0/+6
| | | | | | | | This fixes a couple of asserts when analyzing comparisons involving C11 atomics that were uncovered by r205608 when we extended the applicability of -Wtautological-constant-out-of-range-compare. llvm-svn: 213573
* [OPENMP] Initial parsing and sema analysis for 'flush' directive.Alexey Bataev2014-07-2113-8/+229
| | | | llvm-svn: 213512
* [OPENMP] Parsing/Sema of the OpenMP directive 'critical'.Alexander Musman2014-07-2113-17/+213
| | | | llvm-svn: 213510
* Add missing initialization found due to a valgrind false positive.Richard Smith2014-07-211-1/+1
| | | | | | | | This field is never inspected in the object state initialized by this constructor; however, initializing it seems reasonable, since it has a meaningful value. llvm-svn: 213499
* [modules] Fix some of the confusion when computing the override set for a macroRichard Smith2014-07-212-26/+25
| | | | | | | introduced by finalization. This is still not entirely correct; more fixes to follow. llvm-svn: 213498
* [PowerPC] Optimize passing certain aggregates by valueUlrich Weigand2014-07-211-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | In addition to enabling ELFv2 homogeneous aggregate handling, LLVM support to pass array types directly also enables a performance enhancement. We can now pass (non-homogeneous) aggregates that fit fully in registers as direct integer arrays, using an element type to encode the alignment requirement (that would otherwise go to the "byval align" field). This is preferable since "byval" forces the back-end to write the aggregate out to the stack, even if it could be passed fully in registers. This is particularly annoying on ELFv2, if there is no parameter save area available, since we then need to allocate space on the callee's stack just to hold those aggregates. Note that to implement this optimization, this patch does not attempt to fully anticipate register allocation rules as (defined in the ABI and) implemented in the back-end. Instead, the patch is simply passing *any* aggregate passed by value using the array mechanism if its size is up to 64 bytes. This means that some of those will end up being passed in stack slots anyway, but the generated code shouldn't be any worse either. (*Large* aggregates remain passed using "byval" to enable optimized copying via memcpy etc.) llvm-svn: 213495
* [PowerPC] Support the ELFv2 ABIUlrich Weigand2014-07-211-9/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements clang support for the PowerPC ELFv2 ABI. Together with a series of companion patches in LLVM, this makes clang/LLVM fully usable on powerpc64le-linux. Most of the ELFv2 ABI changes are fully implemented on the LLVM side. On the clang side, we only need to implement some changes in how aggregate types are passed by value. Specifically, we need to: - pass (and return) "homogeneous" floating-point or vector aggregates in FPRs and VRs (this is similar to the ARM homogeneous aggregate ABI) - return aggregates of up to 16 bytes in one or two GPRs The second piece is trivial to implement in any case. To implement the first piece, this patch makes use of infrastructure recently enabled in the LLVM PowerPC back-end to support passing array types directly, where the array element type encodes properties needed to handle homogeneous aggregates correctly. Specifically, the array element type encodes: - whether the parameter should be passed in FPRs, VRs, or just GPRs/stack slots (for float / vector / integer element types, respectively) - what the alignment requirements of the parameter are when passed in GPRs/stack slots (8 for float / 16 for vector / the element type size for integer element types) -- this corresponds to the "byval align" field With this support in place, the clang part simply needs to *detect* whether an aggregate type implements a float / vector homogeneous aggregate as defined by the ELFv2 ABI, and if so, pass/return it as array type using the appropriate float / vector element type. llvm-svn: 213494
* If a module build reports errors, don't try to load itBen Langmuir2014-07-191-13/+21
| | | | | | ... just to find out that it didn't build. llvm-svn: 213454
* Revert D3908 due to issues on Mac platformsViktor Kutuzov2014-07-193-218/+0
| | | | llvm-svn: 213450
* Cleanup comparisons to VariableArrayType::Static for non-VLAsHal Finkel2014-07-192-2/+2
| | | | | | | The enum is part of ArrayType, so there is no functional change, but comparing to ArrayType::Static for non-VLAs makes more sense. llvm-svn: 213446
* TypePrinter should not ignore IndexTypeCVRQualifiers on constant-sized arraysHal Finkel2014-07-191-0/+4
| | | | | | | | | | C99 array parameters can have index-type CVR qualifiers, and the TypePrinter should print them when present (and we were not for constant-sized arrays). Otherwise, we'd drop the restrict in: int foo(int a[restrict static 3]) { ... } llvm-svn: 213445
* Use the dereferenceable attribute on C99 array parameters with staticHal Finkel2014-07-191-1/+37
| | | | | | | | | | | | | | In C99, an array parameter declarator might have the form: direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']' where the static keyword indicates that the caller will always provide a pointer to the beginning of an array with at least the number of elements specified by the assignment expression. For constant sizes, we can use the new dereferenceable attribute to pass this information to the optimizer. For VLAs, we don't know the size, but (for addrspace(0)) do know that the pointer must be nonnull (and so we can use the nonnull attribute). llvm-svn: 213444
* PR20356: Fix all Sema warnings with mismatched ext_/warn_ versusRichard Smith2014-07-197-18/+18
| | | | | | | | ExtWarn/Warnings. Mostly the name of the warning was changed to match the semantics, but in the PR20356 cases, the warning was about valid code, so the diagnostic was changed from ExtWarn to Warning instead. llvm-svn: 213443
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-195-13/+11
| | | | | | | | | | | ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. llvm-svn: 213439
* [MS-ABI] Assign SEH handler indices to __try blocksWarren Hunt2014-07-195-31/+70
| | | | | | | | | Assigns indices to try blocks. These indices will used in constructing tables that the mscrt function __except_handler3 reads during SEH. Testing will occur once we actually emit the tables, in a subsequent patch. llvm-svn: 213437
* CodeGen: Properly null-check typeid expressionsDavid Majnemer2014-07-191-6/+38
| | | | | | | | | | | | Thoroughly check for a pointer dereference which yields a glvalue. Look through casts, comma operators, conditional operators, paren expressions, etc. This was originally D4416. Differential Revision: http://reviews.llvm.org/D4592 llvm-svn: 213434
* Revert r213415, "Merge two lines". It broke tests in -Asserts builds.NAKAMURA Takumi2014-07-181-1/+2
| | | | | | CGBuilder doesn't name instructions with Name. We should use Inst::setName() to name an instruction explicitly here. llvm-svn: 213431
* [X86 inline-asm] Error out on inline-asm constraint "=f".Akira Hatanaka2014-07-181-1/+7
| | | | | | <rdar://problem/17476689> llvm-svn: 213428
* TypePrinter should not omit the static keyword in array parameter declaratorsHal Finkel2014-07-181-2/+7
| | | | | | | | | | | In C99, an array parameter declarator might have the form: direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']' and when the size of the array is a constant, don't omit the static keyword when printing the type. Also, in the VLA case, put a space after the static keyword (some assignment expression must follow it). llvm-svn: 213424
* Objective-C. Patch to warn if the result of calling a property getter Fariborz Jahanian2014-07-182-9/+18
| | | | | | | | is unused (this is match behavior when property-dot syntax is used to use same getter). rdar://17514245 Patch by Anders Carlsson with minor refactoring by me. llvm-svn: 213423
* Reinstate r213348, reverted in r213395, with an additional bug fix and moreRichard Smith2014-07-183-8/+30
| | | | | | | | | | | | | | | | | | | | thorough tests. Original commit message: [modules] Fix macro hiding bug exposed if: * A submodule of module A is imported into module B * Another submodule of module A that is not imported into B exports a macro * Some submodule of module B also exports a definition of the macro, and happens to be the first submodule of B that imports module A. In this case, we would incorrectly determine that A's macro redefines B's macro, and so we don't need to re-export B's macro at all. This happens with the 'assert' macro in an LLVM self-host. =( llvm-svn: 213416
* Merge two linesAlexey Samsonov2014-07-181-2/+1
| | | | llvm-svn: 213415
* Revert "CodeGen: Properly null-check typeid expressions"David Majnemer2014-07-181-35/+6
| | | | | | | | | This reverts commit r213401, r213402, r213403, and r213404. I accidently committed these changes instead of updating the differential. llvm-svn: 213405
* Address Richard's latest feedback.David Majnemer2014-07-181-8/+7
| | | | llvm-svn: 213404
* Address Richard's commentsDavid Majnemer2014-07-181-7/+15
| | | | llvm-svn: 213403
* Address Richard's comments.David Majnemer2014-07-181-0/+3
| | | | llvm-svn: 213402
* CodeGen: Properly null-check typeid expressionsDavid Majnemer2014-07-181-6/+25
| | | | | | | | | | | | | | | Summary: Thoroughly check for a pointer dereference which yields a glvalue. Look through casts, comma operators, conditional operators, paren expressions, etc. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4416 llvm-svn: 213401
* Recommit: Handle diagnostic warnings in Frontend diagnostic handler.Tyler Nowicki2014-07-181-12/+25
| | | | | | | | | | | | | | | Clang uses a diagnostic handler to grab diagnostic messages so it can print them with the line of source code they refer to. This patch extends this to handle optimization failures that were added to llvm to produce a warning when loop vectorization is explicitly specified (using a pragma clang loop directive) but fails. Update renames warning flag name to avoid indicating the flag's severity and adds a test. Reviewed by Alp Toker llvm-svn: 213400
* Revert "[modules] Fix macro hiding bug exposed if:"Ben Langmuir2014-07-182-23/+8
| | | | | | | | | | This is breaking the system modules on Darwin, because something that was defined and re-exported no longer is. Might be this patch, or might just be a really poor interaction with an existing visibility bug. This reverts commit r213348. llvm-svn: 213395
* [UBsan] Skip -fsanitize=vptr instrumentations when the pointer value is null.Alexey Samsonov2014-07-181-1/+1
| | | | | | | | | | Otherwise -fsanitize=vptr causes the program to crash when it downcasts a null pointer. Reviewed in http://reviews.llvm.org/D4412. Patch by Byoungyoung Lee! llvm-svn: 213393
* Make sure globals created by UBSan are not instrumented by ASan.Alexey Samsonov2014-07-183-9/+31
| | | | | | | | | | | | | | | | | | | | | | Summary: This change adds description of globals created by UBSan instrumentation (UBSan handlers, type descriptors, filenames) to llvm.asan.globals metadata, effectively "blacklisting" them. This can dramatically decrease the data section in binaries built with UBSan+ASan, as UBSan tends to create a lot of handlers, and ASan instrumentation increases the global size to at least 64 bytes. Test Plan: clang regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, byoungyoung, kcc Differential Revision: http://reviews.llvm.org/D4575 llvm-svn: 213392
* For i386, gcc 4.9 under Debian (at least) updated its paths to i586-linux-gnuSylvestre Ledru2014-07-181-1/+1
| | | | | | | | | | | (i486-linux-gnu previously). Adding this triple to the list of search. Also impacts clang 3.4.2 Reported on the Debian bug tracking system here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754963 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755183 llvm-svn: 213388
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-181-4/+16
| | | | | | | | | | | | | | Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. llvm-svn: 213386
* [mips] Use Triple::getVendor() instead of Triple::getVendorName() to ↵Daniel Sanders2014-07-181-1/+1
| | | | | | identify 'mti' vendor triples. llvm-svn: 213383
* Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary ↵Arnaud A. de Grandmaison2014-07-183-51/+24
| | | | | | | | | objects." This reverts commit dbf785a6432f78a8ec229665876647c4cc610d3d, while I qm investigating a buildbot failure. llvm-svn: 213380
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-07-183-24/+51
| | | | | | This will give more information to the optimizers so that they can reuse stack slots. llvm-svn: 213379
OpenPOWER on IntegriCloud