summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert D3908 due to issues on Mac platformsViktor Kutuzov2014-07-193-218/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213450 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213446 91177308-0d34-0410-b5e6-96231b3b80d8
* TypePrinter should not ignore IndexTypeCVRQualifiers on constant-sized arraysHal Finkel2014-07-192-0/+14
| | | | | | | | | | 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]) { ... } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213445 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the dereferenceable attribute on C99 array parameters with staticHal Finkel2014-07-192-1/+46
| | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213444 91177308-0d34-0410-b5e6-96231b3b80d8
* PR20356: Fix all Sema warnings with mismatched ext_/warn_ versusRichard Smith2014-07-1914-55/+54
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213443 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/Misc/backend-optimization-failure.cpp: Appease to add -triple=x86_64.NAKAMURA Takumi2014-07-191-1/+2
| | | | | | FIXME: Could this be made generic? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213441 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-196-14/+12
| | | | | | | | | | | ".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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213439 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Assign SEH handler indices to __try blocksWarren Hunt2014-07-198-39/+100
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213437 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Properly null-check typeid expressionsDavid Majnemer2014-07-192-6/+120
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213434 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213431 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86 inline-asm] Error out on inline-asm constraint "=f".Akira Hatanaka2014-07-182-1/+13
| | | | | | | <rdar://problem/17476689> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213428 91177308-0d34-0410-b5e6-96231b3b80d8
* TypePrinter should not omit the static keyword in array parameter declaratorsHal Finkel2014-07-182-2/+18
| | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213424 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Patch to warn if the result of calling a property getter Fariborz Jahanian2014-07-186-17/+49
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213423 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r213348, reverted in r213395, with an additional bug fix and moreRichard Smith2014-07-1812-10/+148
| | | | | | | | | | | | | | | | | | | | | 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. =( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213416 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge two linesAlexey Samsonov2014-07-181-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213415 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "CodeGen: Properly null-check typeid expressions"David Majnemer2014-07-182-103/+6
| | | | | | | | | This reverts commit r213401, r213402, r213403, and r213404. I accidently committed these changes instead of updating the differential. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213405 91177308-0d34-0410-b5e6-96231b3b80d8
* Address Richard's latest feedback.David Majnemer2014-07-182-11/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213404 91177308-0d34-0410-b5e6-96231b3b80d8
* Address Richard's commentsDavid Majnemer2014-07-182-7/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213403 91177308-0d34-0410-b5e6-96231b3b80d8
* Address Richard's comments.David Majnemer2014-07-182-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213402 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Properly null-check typeid expressionsDavid Majnemer2014-07-182-6/+69
| | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213401 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit: Handle diagnostic warnings in Frontend diagnostic handler.Tyler Nowicki2014-07-184-12/+48
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213400 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[modules] Fix macro hiding bug exposed if:"Ben Langmuir2014-07-1810-48/+10
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213395 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBsan] Skip -fsanitize=vptr instrumentations when the pointer value is null.Alexey Samsonov2014-07-182-1/+7
| | | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213393 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure globals created by UBSan are not instrumented by ASan.Alexey Samsonov2014-07-184-9/+39
| | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213392 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213388 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-1858-264/+310
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213386 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Use Triple::getVendor() instead of Triple::getVendorName() to ↵Daniel Sanders2014-07-181-1/+1
| | | | | | identify 'mti' vendor triples. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213383 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary ↵Arnaud A. de Grandmaison2014-07-184-149/+24
| | | | | | | | | objects." This reverts commit dbf785a6432f78a8ec229665876647c4cc610d3d, while I qm investigating a buildbot failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213380 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-07-184-24/+149
| | | | | | This will give more information to the optimizers so that they can reuse stack slots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213379 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved 25 flags to clang_ignored_gcc_optimization_f_Group. Will display a warningArthur Marble2014-07-182-30/+80
| | | | | | | | | | to the user if they try to pass those optimizations. The revision for this patch is here: http://reviews.llvm.org/D4474. This patch will fix many errors in the rebuild of Debian with clang. Here is a link to the page for unknown arguments: http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213365 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM: Add test for ACLE memory barrier intrinsicsYi Kong2014-07-181-0/+16
| | | | | | | | Add an additional test to ensure that someone doesn't accidentally change the definitions such that they can take a non-constant value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213364 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'taskwait' directive.Alexey Bataev2014-07-1827-8/+408
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213363 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis for 'barrier' directive.Alexey Bataev2014-07-1826-5/+417
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213360 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] Fix AAPCS regression caused by r211898Oliver Stannard2014-07-182-1/+10
| | | | | | | | | | | | | | | r211898 introduced a regression where a large struct, which would normally be passed ByVal, was causing padding to be inserted to prevent the backend from using some GPRs, in order to follow the AAPCS. However, the type of the argument was not being set correctly, so the backend cannot align 8-byte aligned struct types on the stack. The fix is to not insert the padding arguments when the argument is being passed ByVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213359 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial parsing and sema analysis of 'taskyield' directive.Alexey Bataev2014-07-1829-37/+481
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213355 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Implement Clang CLI interface proposal about "-march".Kevin Qin2014-07-188-110/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Revert "Add default feature for CPUs on AArch64 target in Clang" at r210625. Then, all enabled feature will by passed explicitly by -target-feature in -cc1 option. 2. Get "-mfpu" deprecated. 3. Implement support of "-march". Usage is: -march=armv8-a+[no]feature For instance, "-march=armv8-a+neon+crc+nocrypto". Here "armv8-a" is necessary, and CPU names are not acceptable. Candidate features are fp, neon, crc and crypto. Where conflicting feature modifiers are specified, the right-most feature is used. 4. Implement support of "-mtune". Usage is: -march=CPU_NAME For instance, "-march=cortex-a57". This option will ONLY get micro-architectural feature enabled specifying to target CPU, like "+zcm" and "+zcz" for cyclone. Any architectural features WON'T be modified. 5. Change usage of "-mcpu" to "-mcpu=CPU_NAME+[no]feature", which is an alias to "-march={feature of CPU_NAME}+[no]feature" and "-mtune=CPU_NAME" together. Where this option is used in conjunction with -march or -mtune, those options take precedence over the appropriate part of this option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213353 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Diagnose malformed 'message' arguments for 'availability' attrDavid Majnemer2014-07-182-1/+14
| | | | | | | The parsing code for 'availability' wasn't prepared for string literals like "a" L"b" showing up. Error if this occurs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213350 91177308-0d34-0410-b5e6-96231b3b80d8
* Add dump() for MacroDirective and MacroInfo.Richard Smith2014-07-182-0/+76
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213349 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Fix macro hiding bug exposed if:Richard Smith2014-07-1810-10/+48
| | | | | | | | | | | | | | | * 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. =( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213348 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup: remove essentially unused variable.Richard Smith2014-07-181-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213347 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark the vtable used when defining implicit copy and move ctorsReid Kleckner2014-07-182-1/+24
| | | | | | | | | | I don't think other implicit members like copy assignment and move assignment require this treatment, because they should already be operating on a constructed object. Fixes PR20351. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213346 91177308-0d34-0410-b5e6-96231b3b80d8
* SemaInit.cpp: Fix a warning with -Asserts. [-Wunused-variable]NAKAMURA Takumi2014-07-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213345 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix parsing certain kinds of strings in the MS section pragmasReid Kleckner2014-07-184-56/+109
| | | | | | | | | We were crashing on the relevant test case inputs. Also, refactor this code a bit so we can report failure and slurp the pragma tokens without returning a diagnostic id. This is more consistent with the rest of the parser and sema code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213337 91177308-0d34-0410-b5e6-96231b3b80d8
* Check-labelize ubsan testsAlexey Samsonov2014-07-172-55/+55
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213334 91177308-0d34-0410-b5e6-96231b3b80d8
* PR20346: fix aggregate initialization / template instantiation bug:Richard Smith2014-07-172-0/+29
| | | | | | | | | | | | | | If, during the initial parse of a template, we perform aggregate initialization and form an implicit value initialization for an array type, then when we come to instantiate the template and redo the initialization step, we would try to match the implicit value initialization up against an array *element*, not to the complete array. Remarkably, we've had this bug since ~the dawn of time, but only noticed it recently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213332 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/CodeGen/ms-inline-asm.c: Fix for -Asserts.NAKAMURA Takumi2014-07-171-7/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213329 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-1742-346/+338
| | | | | | | | | This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213325 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune empty directories.Joerg Sonnenberger2014-07-170-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213311 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-1742-338/+346
| | | | | | | | | (after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for PR20343 after llvm r213303.Nico Weber2014-07-171-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213305 91177308-0d34-0410-b5e6-96231b3b80d8