summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Vector [Sema]. Vector "splats" which are truncated should have a warningFariborz Jahanian2014-04-041-0/+12
| | | | | | with -Wconversion. // rdar://16502418 llvm-svn: 205646
* In preparation for being able to use simple Boolean logic expressions ↵Aaron Ballman2014-04-041-1/+10
| | | | | | involving capabilities, the semantics for attributes now looks through the types of the constituent parts of a capability expression instead of at the aggregate expression type. llvm-svn: 205629
* Extend -Wtautological-constant-out-of-range-compare to handle boolean valuesRichard Trieu2014-04-041-0/+162
| | | | | | | | | | | | | | | better. This warning will now trigger on the following conditionals: bool b; int i; if (b > 1) {} // always false if (0 <= (i > 5)) {} // always true if (-1 > b) {} // always false Patch by Per Viberg. llvm-svn: 205608
* Turn off -Wmissing-noreturn warning for blocks Fariborz Jahanian2014-04-031-1/+11
| | | | | | | as there is no way to attach this attribute to the block literal. // rdar://16274746 llvm-svn: 205580
* vector [Sema]. Check for proper use of 's' char prefixFariborz Jahanian2014-04-031-0/+8
| | | | | | | (which indicates vector expression is a string of hex values) instead of crashing in code gen. // rdar://16492792 llvm-svn: 205557
* Improved semantics for implicit scalar -> extvector conversions.Stephen Canon2014-04-031-4/+37
| | | | llvm-svn: 205521
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-16/+16
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* Add the location of Decls to ast dump.David Blaikie2014-04-022-2/+2
| | | | | | | | | While investigating some debug info issues, Eric and I came across a particular template case where the location of a decl was quite different from the range of the same decl. It might've been rather helpful if the dumper had actually showed us this. llvm-svn: 205396
* Updating the capability attribute diagnostics to be more capability-neutral. ↵Aaron Ballman2014-04-011-10/+10
| | | | | | Instead of using terminology such as "lock", "unlock" and "locked", the new terminology is "acquire", "release" and "held". Additionally, the capability attribute's name argument is now reported as part of the diagnostic, instead of hard coding as "mutex." llvm-svn: 205359
* Unify __declspec attribute argument parsing with the common attribute ↵Aaron Ballman2014-03-312-3/+3
| | | | | | | | argument parsing code. This removes a diagnostic that is no longer required (the semantic engine now properly handles attribute syntax so __declspec and __attribute__ spellings no longer get mismatched). This caused several testcases to need updating for a slightly different wording. llvm-svn: 205234
* Sema: Require external linkage for dll attributesNico Rieck2014-03-312-0/+16
| | | | llvm-svn: 205198
* Sema: Check dll attributes on redeclarationsNico Rieck2014-03-312-9/+38
| | | | | | | A redeclaration may not add dllimport or dllexport attributes. dllexport is sticky and can be omitted on redeclarations while dllimport cannot. llvm-svn: 205197
* ARM64: initial clang support commit.Tim Northover2014-03-296-2/+107
| | | | | | | | | | | This adds Clang support for the ARM64 backend. There are definitely still some rough edges, so please bring up any issues you see with this patch. As with the LLVM commit though, we think it'll be more useful for merging with AArch64 from within the tree. llvm-svn: 205100
* Improve -Wunreachable-code to provide a means to indicate code is ↵Ted Kremenek2014-03-291-2/+33
| | | | | | | | | | | | | | | | | | intentionally marked dead via if((0)). Taking a hint from -Wparentheses, use an extra '()' as a sigil that a dead condition is intentionally dead. For example: if ((0)) { dead } When this sigil is found, do not emit a dead code warning. When the analysis sees: if (0) it suggests inserting '()' as a Fix-It. llvm-svn: 205069
* Handle and warn on aliases to weak aliases.Rafael Espindola2014-03-271-0/+4
| | | | | | | This produces valid IR now that llvm rejects aliases to weak aliases and warns the user that the resolution is not changed if the weak alias is overridden. llvm-svn: 204935
* Try to fix arm bots by removing a superfluous __cdeclReid Kleckner2014-03-261-1/+1
| | | | llvm-svn: 204872
* -fms-extensions: Add __va_start builtin, which is used for x64Reid Kleckner2014-03-261-0/+14
| | | | | | | | | | The main difference between __va_start and __builtin_va_start is that the address of the va_list has already been taken, and the va_list is always a char*. __va_end and __va_arg are not needed. llvm-svn: 204821
* Capability attributes can now be declared on a typedef declaration as well ↵Aaron Ballman2014-03-241-5/+5
| | | | | | as a structure declaration. This allows for C code to use Boolean expressions on a capability as part of another attribute. Eg) __attribute__((requires_capability(!SomeCapability))) llvm-svn: 204657
* Fix tests in r204576Nico Rieck2014-03-231-4/+4
| | | | | | Proper redeclaration warnings for dllimport are not implemented yet. llvm-svn: 204577
* Treat dllimport globals without explicit storage class as externNico Rieck2014-03-231-0/+27
| | | | | | | dllimport implies a definition which means the 'extern' keyword is optional when declaring imported variables. llvm-svn: 204576
* The release_capability, release_shared_capability and ↵Aaron Ballman2014-03-211-0/+10
| | | | | | release_generic_capability functions are now functionally distinct for capability analysis. The unlock_function attribute maps directly to release_generic_capability. llvm-svn: 204469
* Fixed newlines.Alexander Kornienko2014-03-211-52/+52
| | | | llvm-svn: 204413
* Replacing the exclusive_lock_function, shared_lock_function and ↵Aaron Ballman2014-03-201-9/+2
| | | | | | | | unlock_function attributes with the acquire_capability and release_capability attributes. The old spellings will continue to work, but the underlying semantic attributes have been replaced. Downgraded the capability diagnostics from error to warning to match the desired behavior, and updated the existing test cases. llvm-svn: 204350
* Remove wchar_t* buffer from scanf format fix-it test.Jordan Rose2014-03-201-5/+0
| | | | | | | | | | | | Amends r204300 to not try to test fixing a wchar_t* to "%ls", which we don't do correctly anyway. In C mode, wchar_t is just a typedef for a normal primitive integer type, not a distinct type like it is in C++. To make this work correctly, we'll need to look for the wchar_t typedef, not just the builtin type. Should fix the buildbots. llvm-svn: 204349
* Make format-strings-fixit.c aware of "%hu" uint16_t on wchar_t for targeting ↵NAKAMURA Takumi2014-03-201-2/+2
| | | | | | win32. llvm-svn: 204334
* scanf format checking: include the buffer length in the fix-it for %s.Jordan Rose2014-03-201-2/+26
| | | | | | Patch by Zach Davis! llvm-svn: 204300
* Comment parsing: recognize \param ... on function templates with variadicDmitri Gribenko2014-03-191-0/+20
| | | | | | | | parameters Patch by Joe Ranieri. llvm-svn: 204235
* Creating a printing policy for "half":Yunzhong Gao2014-03-181-1/+1
| | | | | | | | | | | | Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for other languages, error messages and metadata (and hence debug info) should refer to the half-precision floating point as "__fp16" instead of "half" when compiling for non-OpenCL languages. This patch creates a new printing policy for half in a similar manner to what is done for bool and wchar_t. Differential Revision: http://llvm-reviews.chandlerc.com/D2952 llvm-svn: 204164
* Further refine -Wunreachable-code groups so that -Wno-unreachable-code-break ↵Ted Kremenek2014-03-151-9/+49
| | | | | | | | | | doesn't turn off all unreachable code warnings. Also relax unreachable 'break' and 'return' to not check for being preceded by a call to 'noreturn'. That turns out to not be so interesting in practice. llvm-svn: 204000
* Start breaking -Wunreachable-code up into different diagnostic groups.Ted Kremenek2014-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work on -Wunreachable-code has focused on suppressing uninteresting unreachable code that center around "configuration values", but there are still some set of cases that are sometimes interesting or uninteresting depending on the codebase. For example, a dead "break" statement may not be interesting for a particular codebase, potentially because it is auto-generated or simply because code is written defensively. To address these workflow differences, -Wunreachable-code is now broken into several diagnostic groups: -Wunreachable-code: intended to be a reasonable "default" for most users. and then other groups that turn on more aggressive checking: -Wunreachable-code-break: warn about dead break statements -Wunreachable-code-trivial-return: warn about dead return statements that return "trivial" values (e.g., return 0). Other return statements that return non-trivial values are still reported under -Wunreachable-code (this is an area subject to more refinement). -Wunreachable-code-aggressive: supergroup that enables all these groups. The goal is to eventually make -Wunreachable-code good enough to either be in -Wall or on-by-default, thus finessing these warnings into different groups helps achieve maximum signal for more users. TODO: the tests need to be updated to reflect this extra control via diagnostic flags. llvm-svn: 203994
* Sema: demote invalid atomic ordering message to warning.Tim Northover2014-03-111-17/+17
| | | | | | | | | | | | | | Someone could write: if (0) { __c11_atomic_load(ptr, memory_order_release); } or the equivalent, which is perfectly valid, so we shouldn't outright reject invalid orderings on purely static grounds. rdar://problem/16242991 llvm-svn: 203564
* Sema: produce error when invalid ordering is passed to atomic builtinTim Northover2014-03-111-0/+222
| | | | | | | | | This is a conservative check, because it's valid for the expression to be non-constant, and in cases like that we just don't know whether it's valid. rdar://problem/16242991 llvm-svn: 203561
* Move the warning about unused relational comparison from -Wunused-value toRichard Trieu2014-03-111-9/+9
| | | | | | | -Wunused-comparison. Also, newly warn on unused result from overloaded relational comparisons, now also in -Wunused-comparison. llvm-svn: 203535
* [-Wunreachable-code] Handle 'return' with no argument dominated by ↵Ted Kremenek2014-03-081-0/+5
| | | | | | 'noreturn' function. llvm-svn: 203333
* Replace "can not" with "cannot" in diagnostics messages.Ismail Pazarbasi2014-03-071-4/+4
| | | | llvm-svn: 203302
* Fix recent regressions in -Wreturn-type caused by heuristics to ↵Ted Kremenek2014-03-071-1/+35
| | | | | | | | | | | | | | | | | -Wunreachable-code. I had forgotten that the same reachability code is used by both -Wreturn-type and -Wunreachable-code, so the heuristics applied to the latter were indirectly impacting the former. To address this, the reachability code is more refactored so that whiled the logic at its core is shared, the intention of the clients are better captured and segregated in helper APIs. Fixes PR19074, and also some false positives reported offline to me by Nick Lewycky. llvm-svn: 203209
* [-Wunreachable-code] Correctly expand artificial reachability to pruned '&&' ↵Ted Kremenek2014-03-071-2/+2
| | | | | | and '||' branches involving configuration values. llvm-svn: 203194
* [-Wunreachable-code] Teach reachable code analysis heuristics about more ↵Ted Kremenek2014-03-071-1/+13
| | | | | | literal types. llvm-svn: 203193
* C. Compare vector sizes using their raw element size instead ofFariborz Jahanian2014-03-061-0/+10
| | | | | | | | getTypeSize (which rounds up sizes) in order to issue diagnostics when casting to mismatched vector sizes; instead of crashing in IRGen. // rdar:// 16196902. Reviewed offline by John McCall. llvm-svn: 203175
* Add tests for MS inline asm change r203146Reid Kleckner2014-03-061-0/+26
| | | | llvm-svn: 203147
* [-Wunreachable-code] Refine treating all branches of 'switch' as reachable, ↵Ted Kremenek2014-03-061-0/+11
| | | | | | which includes those with all cases covered but with no 'default:'. llvm-svn: 203094
* [-Wunreachable-code] Handle idiomatic do...while() with an uninteresting ↵Ted Kremenek2014-03-061-1/+2
| | | | | | | | | | condition. Sometimes do..while() is used to create a scope that can be left early. In such cases, the unreachable 'while()' test is not usually interesting unless it actually does something that is observable. llvm-svn: 203051
* [-Wunreachable-code] Handle idiomatic do...while() with an uninteresting ↵Ted Kremenek2014-03-061-2/+24
| | | | | | | | | | condition. Sometimes do..while() is used to create a scope that can be left early. In such cases, the unreachable 'while()' test is not usually interesting unless it actually does something that is observable. llvm-svn: 203036
* [-Wunreachable-code] generalize pruning out warning on trivial returns.Ted Kremenek2014-03-051-1/+22
| | | | | | | | Previously we only pruned dead returns preceded by a call to a 'noreturn' function. After looking at the results of the LLVM codebase, there are many others that should be pruned as well. llvm-svn: 203029
* [-Wunreachabe-code] add test for double 'break'.Ted Kremenek2014-03-051-0/+1
| | | | llvm-svn: 203027
* [-Wunreachable-code] include some enum constants in "configuration value" ↵Ted Kremenek2014-03-051-0/+18
| | | | | | heuristic llvm-svn: 203026
* [-Wunreachable-code] generalize configuration value checking to all ↵Ted Kremenek2014-03-051-0/+8
| | | | | | comparison operators. llvm-svn: 203016
* Capabilities are required to pass a name specifying what type of capability ↵Aaron Ballman2014-03-051-1/+4
| | | | | | | | is being annotated. There are currently only two supported names: mutex and role. Adding functionality to check for the capability name and diagnose when it's unexpected. Note that for backwards compatibility, an unnamed capability will default to being a "mutex." This allows the deprecated lockable attribute to continue to function. llvm-svn: 203012
* [-Wunreachable-code] Don't warn about dead code guarded by a "configuration ↵Ted Kremenek2014-03-051-1/+24
| | | | | | | | | | | | | | | value". Some unreachable code is only "sometimes unreachable" because it is guarded by a configuration value that is determined at compile time and is always constant. Sometimes those represent real bugs, but often they do not. This patch causes the reachability analysis to cover such branches even if they are technically unreachable in the CFG itself. There are some conservative heuristics at play here to determine a "configuration value"; these are intended to be refined over time. llvm-svn: 202912
* Tests for LLVM MS inline asm change r202865Reid Kleckner2014-03-041-0/+25
| | | | llvm-svn: 202866
OpenPOWER on IntegriCloud