summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-234-134/+144
| | | | llvm-svn: 173277
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-235-13/+66
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Make __attribute__((nonnull)) use the general expression evaluator to search forNick Lewycky2013-01-231-2/+14
| | | | | | | nulls instead of limiting itself to the language-defined "null pointer constant". llvm-svn: 173227
* Small code change to improve performanceFariborz Jahanian2013-01-221-2/+6
| | | | | | in my last patch, suggested by Argyrios. llvm-svn: 173182
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-221-18/+30
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-211-14/+17
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* Eliminate Sema::CompareProperties(), which was walking over a pile ofDouglas Gregor2013-01-212-62/+68
| | | | | | | | | lexical declarations looking for properties when we could more efficiently check for property mismatches at property declaration time. Good for ~1% of -fsyntax-only time when most of the properties we're checking against come from an AST file. llvm-svn: 173079
* Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, whichDouglas Gregor2013-01-212-46/+28
| | | | | | | | | | did a redundant traversal of the lexical declarations in the superclass. Instead, when we declare a new property, look into the superclass to see whether we're redeclaring the property. Goot for 1% of -fsyntax-only time on Cocoa.h and a little less than 3% on my modules test case. llvm-svn: 173073
* Replace some unnecessary O(N^2) lookups for properties withDouglas Gregor2013-01-211-40/+53
| | | | | | | DeclContext lookups. The performance win is negligible in my tests, but it's the Right Thing To Do (TM). llvm-svn: 173068
* Add a fixit for _Noreturn main,Dmitri Gribenko2013-01-211-2/+8
| | | | | | add tests for fixits removing static and inline from main llvm-svn: 173024
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-205-7/+99
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Fixed trailing whitespace.Michael Gottesman2013-01-201-44/+44
| | | | llvm-svn: 172939
* Reapply r172878 with test case.Ted Kremenek2013-01-191-3/+9
| | | | llvm-svn: 172888
* Whitespace.NAKAMURA Takumi2013-01-191-1/+1
| | | | llvm-svn: 172881
* Revert r172878, "Reword warning about using a *static* variable within its ↵NAKAMURA Takumi2013-01-191-10/+4
| | | | | | | | own initialization." It broke, at least, linux, msvc and mingw bots. llvm-svn: 172879
* Reword warning about using a *static* variable within its own initialization.Ted Kremenek2013-01-191-4/+10
| | | | | | | | | The warning is still under -Wuninitialized (although technically this is defined behavior), but under a subgroup -Wstatic-self-init. This addresses PR 10265. llvm-svn: 172878
* Remove windows line endings.David Blaikie2013-01-181-6/+6
| | | | llvm-svn: 172865
* Once we've collected the template arguments for aDouglas Gregor2013-01-181-3/+7
| | | | | | | | partially-substituted parameter pack in a template, forget about the partially-substituted parameter pack: it is now completed. Fixes <rdar://problem/12176336>. llvm-svn: 172859
* When checking the parameter types of an Objective-C method, don'tDouglas Gregor2013-01-181-2/+0
| | | | | | | decay the parameter type immediately; let CheckParameter() do its job. Fixes <rdar://problem/12071218>. llvm-svn: 172780
* One can override an Objective-C ARC ownership qualifier that came fromDouglas Gregor2013-01-171-0/+10
| | | | | | | a template parameter; make that also include one that came from 'auto'. Fixes <rdar://problem/12078752>. llvm-svn: 172770
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-171-0/+38
| | | | | | | | return type of a function by canonicalizing them away. They are useless anyway, and conflict with our rules for template argument deduction and __strong. Fixes <rdar://problem/12367446>. llvm-svn: 172768
* Defer checking for unsequenced operations on the RHS of && and || in order toRichard Smith2013-01-171-7/+17
| | | | | | reduce stack usage and hopefully bring back the linux x86_64 buildbot. llvm-svn: 172765
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-172-3/+18
| | | | llvm-svn: 172761
* -Wunsequenced: if the LHS of an &&, || or ?: is not constant, check forRichard Smith2013-01-171-6/+22
| | | | | | | | | unsequenced operations in the RHS. We don't compare the RHS with the rest of the expression yet; such checks will need care to avoid diagnosing unsequenced operations which are both in conditionally-evaluated subexpressions which actually can't occur together, such as in '(b && ++x) + (!b && ++x)'. llvm-svn: 172760
* [ms-inline asm] Extend the Sema interface to get the size and length of aChad Rosier2013-01-171-5/+19
| | | | | | | VarDecl. Part of rdar://12576868 llvm-svn: 172742
* Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are ↵Joey Gouly2013-01-172-0/+12
| | | | | | not supported. llvm-svn: 172732
* Improve -Wreorder to handle cases of anonymous class member orderingDavid Blaikie2013-01-171-26/+11
| | | | llvm-svn: 172707
* ArrayRef-ize some ctor initializer related APIsDavid Blaikie2013-01-172-32/+24
| | | | llvm-svn: 172701
* Remove some unnecessary castsDavid Blaikie2013-01-171-4/+4
| | | | llvm-svn: 172700
* Suppress all -Wunused-value warnings from macro body expansions.Matt Beaumont-Gay2013-01-171-2/+5
| | | | | | | | | | | | | | | | | | | This is inspired by a number of false positives in real code, including PR14968. I've added test cases reduced from these false positives to test/Sema/unused-expr.c, as well as corresponding test cases that pass the offending expressions as arguments to a no-op macro to ensure that we do warn there. This also removes my previous tweak from r166522/r166534, so that we warn on unused cast expressions in macro arguments. There were several test cases that were using -Wunused-value to test general diagnostic emission features; I changed those to use other warnings or warn on a macro argument expression. I stared at the test case for PR14399 for a while with Richard Smith and we believe the new test case exercises the same codepaths as before. llvm-svn: 172696
* Attempt to work around bug in older GCCs to fix buildbot.Richard Smith2013-01-171-3/+3
| | | | llvm-svn: 172693
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-175-30/+84
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn onRichard Smith2013-01-174-3/+422
| | | | | | | expressions which have undefined behavior due to multiple unsequenced modifications or an unsequenced modification and use of a variable. llvm-svn: 172690
* Treat hidden Objective-C protocol definitions as if they wereDouglas Gregor2013-01-171-1/+3
| | | | | | | undefined, and don't find methods or protocols within those protocol definitions. This completes <rdar://problem/10634711>. llvm-svn: 172686
* Implement a fixit for -Wmain-return-typeDmitri Gribenko2013-01-171-1/+29
| | | | llvm-svn: 172684
* Delay linkage checks when validating the weakref attribute.Rafael Espindola2013-01-162-10/+13
| | | | llvm-svn: 172678
* Fixes crash when illegal function definitions are deleted or defaulted. ↵Aaron Ballman2013-01-161-2/+2
| | | | | | Fixes PR14577. llvm-svn: 172676
* Simplify code. No functionality change.Rafael Espindola2013-01-161-20/+1
| | | | llvm-svn: 172673
* Check for internal weak decls after merging.Rafael Espindola2013-01-162-6/+13
| | | | | | | | This fixes pr14946. The problem was that the linkage computation was done too early, so things like "extern int a;" would be given external linkage, even if a previous declaration was static. llvm-svn: 172667
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-165-103/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Teach global selector lookup to ignore hidden methods, which occurDouglas Gregor2013-01-161-47/+65
| | | | | | | when the methods are declared in a submodule that has not yet been imported. Part of <rdar://problem/10634711>. llvm-svn: 172635
* First step in implementation of mips16 and nomips16 attributes.Reed Kotler2013-01-161-0/+51
| | | | | | Waiting for new llvm attribute code for the next step. llvm-svn: 172626
* One can have an unavailable method overridden by an available method,Douglas Gregor2013-01-161-1/+1
| | | | | | | but not vice-versa. Fix bug introduced in r172567 and noticed by Jordan, thanks! llvm-svn: 172586
* Apply adjustment to function- and array-typed non-type templateDouglas Gregor2013-01-161-0/+13
| | | | | | | parameters (per C++ [temp.param]p8) when computing the type of a reference to a non-type template parameter. Fixes <rdar://problem/13000548>. llvm-svn: 172585
* When checking availability attributes for consistency between anDouglas Gregor2013-01-153-27/+87
| | | | | | | | overriding and overridden method, allow the overridden method to have a narrower contract (introduced earlier, deprecated/obsoleted later) than the overriding method. Fixes <rdar://problem/12992023>. llvm-svn: 172567
* Fix Cast CodeDavid Greene2013-01-151-2/+3
| | | | | | | Eliminate a cast and resulting cast-qual warning by using a temporary as the target of memcpy. llvm-svn: 172557
* Don't crash when binding a reference to a temporary pointer created fromRichard Smith2013-01-151-0/+4
| | | | | | | | resolving an overloaded function reference within an initializer list. Previously we would try to resolve the overloaded function reference without first stripping off the InitListExpr wrapper. llvm-svn: 172517
* PR14950: Fix out-of-bounds function parameter access in literal operator lookup.Richard Smith2013-01-151-1/+1
| | | | llvm-svn: 172514
* Fix behavior of [[gnu::]] function attributes. Per g++'s behavior, theseRichard Smith2013-01-151-0/+14
| | | | | | | | | | | attributes appertain to a declaration, even though they would be much more naturally modelled as appertaining to a function type. Previously, we would try to distribute them from the declarator to the function type, then reject them for being at an incorrect location. Now, we just distribute them as far as the declarator; the existing attribute handling code can actually apply them there just fine. llvm-svn: 172504
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-145-60/+87
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
OpenPOWER on IntegriCloud