summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
Commit message (Collapse)AuthorAgeFilesLines
* More lambda work: semantic analysis of capturing 'this'. It's a bit ↵Eli Friedman2012-01-071-1/+1
| | | | | | complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.) llvm-svn: 147723
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-15/+6
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Move the data that corresponds to the definition of a protocol into aDouglas Gregor2012-01-011-17/+22
| | | | | | | | | separately-allocated DefinitionData structure. Introduce various functions that will help with the separation of declarations from definitions (isThisDeclarationADefinition(), hasDefinition(), getDefinition()). llvm-svn: 147408
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-11/+8
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-151-2/+2
| | | | | | | | | | declarations and definitions) as ObjCInterfaceDecls within the same redeclaration chain. This new representation matches what we do for C/C++ variables/functions/classes/templates/etc., and makes it possible to answer the query "where are all of the declarations of this class?" llvm-svn: 146679
* Move the definition-specific data of ObjCInterfaceDecl into aDouglas Gregor2011-12-151-1/+4
| | | | | | | | | | | | | | | | separately-allocated DefinitionData structure, which we manage the same way as CXXRecordDecl::DefinitionData. This prepares the way for making ObjCInterfaceDecls redeclarable, to more accurately model forward declarations of Objective-C classes and eliminate the mutation of ObjCInterfaceDecl that causes us serious trouble in the AST reader. Note that ObjCInterfaceDecl's accessors are fairly robust against being applied to forward declarations, because Clang (and Sema in particular) doesn't perform RequireCompleteType/hasDefinition() checks everywhere it has to. Each of these overly-robust cases is marked with a FIXME, which we can tackle over time. llvm-svn: 146644
* Introduce proper spacing after the Objective-C parameter qualifiersDouglas Gregor2011-11-091-11/+6
| | | | | | (bycopy, inout, etc.). Fixes <rdar://problem/10402900>. llvm-svn: 144157
* Refactor Sema::IsSimplyAccessible slightly, to work on a DeclContext rather ↵Douglas Gregor2011-11-031-5/+3
| | | | | | than a class llvm-svn: 143615
* Add a printing policy flag to suppress printing "<anonymous>::" priorDouglas Gregor2011-11-031-0/+1
| | | | | | | | | to types. Enable this flag for code completion, where knowing whether something is in an anonymous or inline namespace is actually not useful, since you don't have to type it anyway. Fixes <rdar://problem/10208818>. llvm-svn: 143599
* Provide result types for code completions that describe built-inDouglas Gregor2011-10-181-50/+88
| | | | | | expressions (this, sizeof, etc.). llvm-svn: 142424
* Add code completions for C++0x expressionsDouglas Gregor2011-10-181-1/+28
| | | | llvm-svn: 142357
* Don't format the code completion for parameters of block literalDouglas Gregor2011-10-181-24/+46
| | | | | | | arguments as block literal arguments; the block literal argument code completion should only go one level deep. Fixes <rdar://problem/10291294>. llvm-svn: 142335
* Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations toErik Verbruggen2011-10-141-0/+6
| | | | | | retrieve annotations from completion string. llvm-svn: 141953
* Added CXAvailability_NotAccessible to indicate that a declaration is ↵Erik Verbruggen2011-10-061-2/+10
| | | | | | available, but not accessible from the current code completion context. llvm-svn: 141278
* [libclang] Introduce CXCursor_CXXAccessSpecifier for C++'s ↵Argyrios Kyrtzidis2011-09-301-0/+1
| | | | | | | | public:/private:/protected: specifiers. Patch by Paolo Capriotti! llvm-svn: 140864
* Only print _Bool as 'bool' when 'bool' is defined as an object-likeDouglas Gregor2011-09-271-45/+56
| | | | | | macro whose only replacement token is '_Bool'. llvm-svn: 140656
* When 'bool' is not a built-in type but is defined as a macro, printDouglas Gregor2011-09-271-26/+18
| | | | | | | 'bool' rather than '_Bool' within types, to make things a bit more readable. Fixes <rdar://problem/10063263>. llvm-svn: 140650
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Change all references of type ExprTy to Expr and get rid of the typedefs.Richard Trieu2011-09-091-5/+5
| | | | llvm-svn: 139347
* objective-c: this patch (re)introduces objective-c's default propertyFariborz Jahanian2011-08-311-6/+0
| | | | | | | | | | synthesis. This new feature is currently placed under -fobjc-default-synthesize-properties option and is off by default pending further testing. It will become the default feature soon. // rdar://8843851 llvm-svn: 138913
* objective-c: Treat top-level objective-c declarationsFariborz Jahanian2011-08-271-6/+5
| | | | | | | | | | , such as list of forward @class decls, in a DeclGroup node. Deal with its consequence throught clang. This is in preparation for more Sema work ahead. // rdar://8843851. Feel free to reverse if it breaks something important and I am unavailable. llvm-svn: 138709
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-221-18/+19
| | | | | | failures are resolved. llvm-svn: 138234
* Revers r138040. Need to look at a few buildbot failures.Fariborz Jahanian2011-08-191-19/+18
| | | | llvm-svn: 138049
* objective-c: Bring objective-c handling of decl contextFariborz Jahanian2011-08-191-18/+19
| | | | | | | | | | to modernity. Instead of passing down individual context objects from parser to sema, establish decl context in parser and have sema access current context as needed. I still need to take of Doug's comment for minor cleanups. llvm-svn: 138040
* [libclang] Support code-completion inside macro arguments.Argyrios Kyrtzidis2011-08-181-3/+2
| | | | llvm-svn: 137973
* Do l-value conversion, etc., on a switch condition expression inJohn McCall2011-08-061-4/+5
| | | | | | | | | | ActOnStartOfSwitchStmt (i.e. before binding up a full-expression) instead of ActOnFinishSwitchStmt. Among other things, this means that property l-values are properly converted inside the full-expression. llvm-svn: 137014
* Add code completion to produce "else" blocks after an "if"Douglas Gregor2011-07-301-0/+55
| | | | | | statement. Fixes <rdar://problem/9229438>. llvm-svn: 136564
* When producing code completion results for variadic macros, fold theDouglas Gregor2011-07-301-4/+21
| | | | | | | variadic bit (", ..." or ", args...") into the prior placeholder, like we do with functions and methods. Fixes <rdar://problem/9740808>. llvm-svn: 136563
* Add the various parameter-passing keywords for Distributed ObjectsDouglas Gregor2011-07-301-5/+28
| | | | | | | (such as in, inout, byref, and oneway) to code completion results. Fixes <rdar://problem/8844158>. llvm-svn: 136562
* When performing code completion after at @interface, allow bothDouglas Gregor2011-07-301-19/+25
| | | | | | | | already-defined and forward-declared results. Already-defined results are fine because they could be the start of a category. Fixes <rdar://problem/9811691>. llvm-svn: 136559
* Eliminate a bunch of temporary strings.Benjamin Kramer2011-07-261-4/+4
| | | | llvm-svn: 136092
* Add new libclang API, clang_codeCompleteGetObjCSelector(), whichDouglas Gregor2011-07-261-2/+2
| | | | | | | provides the partial Objective-C selector used in a code completion. From Connor Wakamo! llvm-svn: 136084
* Added clang_getCursorReferenceNameRange to libclang to to retrieve parts ofDouglas Gregor2011-07-251-1/+1
| | | | | | a cursor reference, from Erik Verbruggen! llvm-svn: 135920
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-33/+33
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* New libclang API to expose container type for code completion, fromDouglas Gregor2011-07-211-5/+12
| | | | | | Connor Wakamo! llvm-svn: 135651
* Introduce a new libclang aPI function,Douglas Gregor2011-07-071-19/+38
| | | | | | | | | clang_codeCompleteGetContexts(), that provides the client with information about the context in which code completion has occurred and what kinds of entities make sense as completions at that point. Patch by Connor Wakamo! llvm-svn: 134615
* Automatic Reference Counting.John McCall2011-06-151-20/+77
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Add code completetion code for the new 'atomic' attributeFariborz Jahanian2011-06-111-0/+2
| | | | | | keyword in objc property decl. llvm-svn: 132877
* Expose @synthesize and @dynamic via their own cursor kinds inDouglas Gregor2011-06-031-0/+10
| | | | | | libclang. Fixes <rdar://problem/9537904>. llvm-svn: 132603
* Tweak code completions for Objective-C Key-Value Observing. TheDouglas Gregor2011-06-021-1/+22
| | | | | | | | +keyPathsForValuesAffecting<Key> completion was mislabeled as an instance method, and +automaticallyNotifiesObserversOf<Key> was missing entirely. Fixes <rdar://problem/9516762>. llvm-svn: 132452
* When providing code completions for an Objective-C property access,Douglas Gregor2011-05-051-13/+61
| | | | | | | also include methods with zero-argument selectors. Implements <rdar://problem/9048332>. llvm-svn: 130922
* When adding KVC code completions, keep track of all of the selectorsDouglas Gregor2011-05-041-23/+30
| | | | | | | that we've previously seen, both in declared methods and from previous KVC completions, to eliminate duplicates. Fixes <rdar://problem/9162207>. llvm-svn: 130890
* When providing code completions of ivar names for a propertyDouglas Gregor2011-04-181-18/+30
| | | | | | | | | | | | | | | | implementation such as @synthesize Prop1 = Give priority to ivars whose type matches or closely matches the property type (as we do for several other kinds of results). Additionally, if there is an ivar with the same name as the property, or differs only due to a _ prefix or suffix, give that ivar a priority bump. Finally, verify that this search is properly returning ivars within class extensions and implementations (<rdar://problem/8488854>). llvm-svn: 129699
* When producing code completion results for the Objective-C propertyDouglas Gregor2011-04-181-5/+42
| | | | | | | | | | | implementation @synthesize <property> = also produce a completion for a to-be-synthesized ivar named _<property>. llvm-svn: 129697
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-2/+3
| | | | llvm-svn: 129567
* When determining the "usage" type of a declaration for the purposes of code Douglas Gregor2011-04-141-2/+33
| | | | | | | completion, look through block pointer and function pointer types to the result type of the block/function. Fixes <rdar://problem/9282583>. llvm-svn: 129535
* Don't suggest dynamic_cast or typeid as code completion results whenDouglas Gregor2011-04-121-22/+29
| | | | | | | | RTTI is disabled. Similarly, don't suggest throw or try as code completion results when C++ exceptions are disabled. Fixes <rdar://problem/9193560>. llvm-svn: 129346
* Use ExprResult& instead of Expr *& in SemaJohn Wiegley2011-04-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This patch authored by Eric Niebler. Many methods on the Sema class (e.g. ConvertPropertyForRValue) take Expr pointers as in/out parameters (Expr *&). This is especially true for the routines that apply implicit conversions to nodes in-place. This design is workable only as long as those conversions cannot fail. If they are allowed to fail, they need a way to report their failures. The typical way of doing this in clang is to use an ExprResult, which has an extra bit to signal a valid/invalid state. Returning ExprResult is de riguour elsewhere in the Sema interface. We suggest changing the Expr *& parameters in the Sema interface to ExprResult &. This increases interface consistency and maintainability. This interface change is important for work supporting MS-style C++ properties. For reasons explained here <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013180.html>, seemingly trivial operations like rvalue/lvalue conversions that formerly could not fail now can. (The reason is that given the semantics of the feature, getter/setter method lookup cannot happen until the point of use, at which point it may be found that the method does not exist, or it may have the wrong type, or overload resolution may fail, or it may be inaccessible.) llvm-svn: 129143
* Make helpers static.Benjamin Kramer2011-03-261-3/+3
| | | | llvm-svn: 128339
OpenPOWER on IntegriCloud