summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve diagnostics reporting of un-implementedFariborz Jahanian2010-10-291-2/+6
| | | | | | | methods in protocols when protocols are in system headers and thus ignored. //rdar: //8227199 llvm-svn: 117739
* When doing name lookup for members don't look into global/namespace scope.Argyrios Kyrtzidis2010-10-291-0/+4
| | | | | | Better performance and fixes rdar://8603569. llvm-svn: 117656
* Implement an indirect-goto optimization for goto *&&lbl and respect thisJohn McCall2010-10-281-1/+20
| | | | | | | | | | | | | | in the scope checker. With that done, turn an indirect goto into a protected scope into a hard error; otherwise IR generation has to start worrying about declarations not dominating their scopes, as exemplified in PR8473. If this really affects anyone, I can probably adjust this to only hard-error on possible indirect gotos into VLA scopes rather than arbitrary scopes. But we'll see how people cope with the aggressive change on the marginal feature. llvm-svn: 117539
* Implement the newest status quo for method override checking. The idea nowJohn McCall2010-10-281-60/+89
| | | | | | | | | | | | | is that we need more information to decide the exact conditions for whether one ObjCObjectPointer is an acceptable return/parameter override for another, so we're going to disable that entire class of warning for now. The "forward developement" warning category, -Wmethod-signatures, can receive unrestricted feature work, and when we're happy with how it acts, we'll turn it on by default. This is a pretty conservative change, and nobody's totally content with it. llvm-svn: 117524
* Decay array/function types of a statement-expression.Fariborz Jahanian2010-10-271-2/+1
| | | | | | // rdar: // 8600553. llvm-svn: 117484
* patch to do array-to-pointer conversion in aFariborz Jahanian2010-10-271-0/+2
| | | | | | statement-expression. // rdar: //8600553 llvm-svn: 117479
* Remove redundant testDouglas Gregor2010-10-271-1/+1
| | | | llvm-svn: 117446
* Avoid calculating linkage until the more obvious checks have run whenJohn McCall2010-10-271-15/+18
| | | | | | deciding whether to queue a decl for unused-declaration warnings. llvm-svn: 117431
* Don't compute linkage for a declaration as part of the #pragma weakJohn McCall2010-10-271-8/+12
| | | | | | | forward-declaration support unless there's really a mapping for that name. llvm-svn: 117426
* Teach typo correction not to return the same keyword that matches aDouglas Gregor2010-10-261-1/+20
| | | | | | | | typo. This can happen with context-sensitive keywords like "super", when typo correction didn't know that "super" wasn't permitted in this context. llvm-svn: 117372
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-2610-121/+111
| | | | | | anymore. llvm-svn: 117357
* Actually, that doesn't really work, and anyway we should chooseJohn McCall2010-10-261-10/+1
| | | | | | conversion to id over conversion to void*. llvm-svn: 117355
* Consider conversions of Objective-C pointers to 'id' to be basically ofJohn McCall2010-10-261-1/+10
| | | | | | | | | | the same rank as conversions of normal pointers to 'void*'. Also, resurrect a test case. Fixes rdar://problem/8592139 llvm-svn: 117354
* Delay complete-type checking for arguments to no-prototype functionsDouglas Gregor2010-10-261-12/+6
| | | | | | | | until after we've checked/promoted the argument. Hopefully fixes the Emacs regression due to my recent change that expanded type-checking in the presence of K&R function definitions. llvm-svn: 117353
* Pending further discussion, re-enable warnings for Objective CJohn McCall2010-10-261-10/+20
| | | | | | | | | | | covariant/contravariant overrides and implementations, but do so under control of a new flag (-Wno-objc-covariant-overrides, which yes does cover contravariance too). *At least* the covariance cases will probably be enabled by default shortly, but that's not totally uncontroversial. llvm-svn: 117346
* Patch for mis-compile of statement expressions withFariborz Jahanian2010-10-251-6/+28
| | | | | | | non-trivial copy constructors. // rdar: //8540501. A test will be added to llvm nightly tests. llvm-svn: 117324
* Look through the address-of operator to find the function beingDouglas Gregor2010-10-251-0/+4
| | | | | | called. Fixes another aspect of PR8314. llvm-svn: 117308
* When we're calling a function that we know based on its K&R-styleDouglas Gregor2010-10-251-10/+37
| | | | | | | | function definition, we should still use a prototype to type-check and convert the function arguments, if such a prototype exists. Fixes PR8314. llvm-svn: 117305
* Only warn for mismatched types in Objective-C methods when they are ↵David Chisnall2010-10-251-4/+94
| | | | | | | | | | incompatible, not when they are simply different. Now we test whether the difference in types breaks the principle of substitutability, rather than whether they are different. A common idiom in Objective-C is to provide a definition of a method in a subclass that returns a more-specified version of an object than the superclass. This does not violate the principle of substitutability, because you can always use the object returned by the subclass anywhere that you could use the type returned by the superclass. It was, however, generating warnings with clang, leading people to believe that semantically correct code was incorrect and requiring less accurate type specification and explicit down-casts (neither of which is a good thing to encourage). This change ensures that any method definition has parameter and return types that make it accept anything that something conforming to the declaration may pass and return something that the caller will expect, but allows stricter definitions. llvm-svn: 117271
* Improve the tracking of source locations for parentheses in constructor calls.Chandler Carruth2010-10-254-17/+38
| | | | | | | | | | | | This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. llvm-svn: 117254
* C++ [basic.scope.hiding] allows an ordinary name to hide a non-tagDouglas Gregor2010-10-231-2/+7
| | | | | | | name *in the same scope*, but not across scopes. Implement the highlighted condition. llvm-svn: 117212
* Warn if a variable marked with the "unused" attribute is used. Patch by ↵Anders Carlsson2010-10-222-1/+9
| | | | | | Darin Adler! llvm-svn: 117184
* Parse attributes on enumerators and instantiate attributes on enum decls.John McCall2010-10-222-8/+14
| | | | llvm-svn: 117182
* In the presence of using declarations, we can find the same classDouglas Gregor2010-10-221-30/+66
| | | | | | | | members in class subobjects of different types. So long as the underlying declaration sets are the same, and the declaration sets involve non-instance members, this is not an ambiguity. llvm-svn: 117163
* When performing name lookup for a namespace definition, only look intoDouglas Gregor2010-10-221-9/+11
| | | | | | | the current context's redeclaration context, ignoring using directives. Fixes PR8430. llvm-svn: 117097
* Tweak diagnostics for redeclaration of a @property in a class extension ↵Ted Kremenek2010-10-211-1/+10
| | | | | | | | | | where the redelcaration and original declaration have the 'readwrite' attribute. This is a common case, and we can issue a more lucid diagnostic. Fixes <rdar://problem/7629420>. llvm-svn: 117045
* Tidy up comment (remove extraneous text).Ted Kremenek2010-10-211-2/+1
| | | | llvm-svn: 117044
* Implement the integral promotion rules for the C++0x char16_t andDouglas Gregor2010-10-211-14/+31
| | | | | | | char32_t character types and enable built-in overloaded operator candidates for these types. Fixes PR8432. llvm-svn: 117038
* Diagnose the declaration of template template parameters thatDouglas Gregor2010-10-211-1/+6
| | | | | | | | themselves have no template parameters. This is actually a restriction due to the grammar of template template parameters, but we choose to diagnose it in Sema to provide better recovery. llvm-svn: 117032
* Always treat 'main' as an extern "C" function, so that we detectDouglas Gregor2010-10-211-0/+5
| | | | | | | | | redeclarations of main appropriately rather than allowing it to be overloaded. Also, disallowing declaring main as a template. Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C. llvm-svn: 117029
* When checking whether a return statement returns a stack-localDouglas Gregor2010-10-211-4/+11
| | | | | | | variable, handle conditional operators involving a throw-expression. Fixes GCC DejaGNU's g++.dg/template/cond4.C. llvm-svn: 117027
* Previously, the printf warnings would say your arguments type was 'int' when ↵Ted Kremenek2010-10-211-2/+5
| | | | | | | | | | it was really a 'char' or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints. Patch by Justin Bogner! llvm-svn: 116996
* Pass TInfo to CXXDestructorDecl::Create(), just like we do for otherCraig Silverstein2010-10-213-6/+3
| | | | | | | | function decls. Reviewed by rjmccall and nlewycky. llvm-svn: 116979
* Access control polish: drop the note on the original declaration andJohn McCall2010-10-201-1/+43
| | | | | | say 'implicitly' when it was implicit. Resolves PR 7930 and my peace of mind. llvm-svn: 116916
* When matching template parameter lists to template-ids in a scope specifierJohn McCall2010-10-201-18/+98
| | | | | | | on a friend declaration, skip template-ids which do not depend on the current parameter list. llvm-svn: 116911
* Fix handling of property and ivar lookup in typo correction; the twoDouglas Gregor2010-10-202-58/+68
| | | | | | | kinds of lookup into Objective-C classes were tangled together, a situation that was compounded by automatically synthesized ivars. llvm-svn: 116907
* Introduce a simple cache for unqualified typo corrections, so that weDouglas Gregor2010-10-201-26/+70
| | | | | | | | | | | don't repeatedly loop through identifiers, correcting the same typo'd identifier over and over again. We still bail out after 20 typo corrections, but this should help improve performance in the common case where we're typo-correcting because the user forgot to include a header. llvm-svn: 116901
* Eliminate another ordering dependency in typo correction. Re-enable typo.m, ↵Douglas Gregor2010-10-201-1/+4
| | | | | | which seems to be working properly. llvm-svn: 116894
* Provide an upper bound to the edit-distance algorithm when performingDouglas Gregor2010-10-191-1/+7
| | | | | | typo correction, to allow early exits. llvm-svn: 116868
* Improve the performance of typo correction, by using a simpleDouglas Gregor2010-10-191-0/+6
| | | | | | | | | | computation to compute the lower bound of the edit distance, so that we can avoid computing the edit distance for names that will clearly be rejected later. Since edit distance is such an expensive algorithm (M x N), this leads to a 7.5x speedup when correcting NSstring -> NSString in the presence of a Cocoa PCH. llvm-svn: 116849
* Fixes a bug in ivar lookup in the new objc's defaultFariborz Jahanian2010-10-191-1/+6
| | | | | | | property synthesis mode, when dealing with legacy code. Fixes //rdar: //8565343. llvm-svn: 116846
* This patch implements Next's IRGen for -fconstant-string-class=class-name.Fariborz Jahanian2010-10-191-1/+8
| | | | | | PR6056, //rdar: //8564463 llvm-svn: 116819
* When marking declarations referenced within an expression (e.g.,Douglas Gregor2010-10-191-0/+4
| | | | | | | | within a default argument), recurse into default arguments. Fixes PR8401, a regression I introduced in r113700 while refactoring our handling of "used" declarations in default arguments. llvm-svn: 116817
* When instantiating a dependently-scoped friend function declaration,John McCall2010-10-191-0/+3
| | | | | | we may need to complete the type before looking into it. llvm-svn: 116795
* Instantiate enclosing template parameter lists when instantiating friends.John McCall2010-10-191-0/+19
| | | | llvm-svn: 116789
* Uncomputable contexts are always records but can exist.John McCall2010-10-191-5/+9
| | | | llvm-svn: 116787
* Redirect templated friend class decls to a new Sema callback andJohn McCall2010-10-193-8/+122
| | | | | | | construct an unsupported friend when there's a friend with a templated scope specifier. Fixes a consistency crash, rdar://problem/8540527 llvm-svn: 116786
* Fix the translation of the PCC_ForInit code-completion context forDouglas Gregor2010-10-181-2/+8
| | | | | | | | C++/C99/Objective-C, so that we properly include types. This fix affects global caching of code-completion results; without caching, the behavior was already correct. llvm-svn: 116757
* Introduce code completion results for Objective-C methods, both whenDouglas Gregor2010-10-181-6/+8
| | | | | | | | | declaring methods and when sending messages to them, by bringing all of the selector into TypedCheck chunks in the completion result. This way, we can improve the sorting of these results to account for the full selector name rather than just the first chunk. llvm-svn: 116746
* When providing code completions of Objective-C method declarationsDouglas Gregor2010-10-181-48/+28
| | | | | | | (after - or +), always traverse superclasses and all categories. The programmer may want to complete a method from *anywhere*. llvm-svn: 116723
OpenPOWER on IntegriCloud