summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-5/+3
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() ↵Aaron Ballman2014-03-081-5/+3
| | | | | | with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203353
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-071-16/+8
| | | | | | iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-071-11/+5
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203255
* Fully reverting r203236 -- it seems the only bots that are happy are the ↵Aaron Ballman2014-03-071-5/+6
| | | | | | MSVC bots. llvm-svn: 203237
* [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range ↵Aaron Ballman2014-03-071-6/+5
| | | | | | attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203236
* [C++11] Replace verbose functors with succinct lambdasBenjamin Kramer2014-03-011-19/+6
| | | | | | No functionality change. llvm-svn: 202590
* When completing Objective-C instance method invocations, perform a ↵Anders Carlsson2014-02-281-1/+8
| | | | | | contextual conversion to an Objective-C pointer type of the target expression if needed. This fixes code completion of method invocations where the target is a smart pointer that has an explicit conversion operator to an Objective-C type. llvm-svn: 202529
* [code-completion] Style guideline for Cocoa has custom accessor in property ↵Argyrios Kyrtzidis2014-02-201-2/+2
| | | | | | | | declarations without spaces around '='. rdar://16059171 llvm-svn: 201765
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-22/+19
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Introduce and use Decl::getAsFunction() to simplify templated function checksAlp Toker2014-01-221-9/+3
| | | | | | | | | | | | | | Lift the getFunctionDecl() utility out of the parser into a general Decl::getAsFunction() and use it to simplify other parts of the implementation. Reduce isFunctionOrFunctionTemplate() to a simple type check that works the same was as the other is* functions and move unwrapping of shadowed decls to callers so it doesn't get run twice. Shuffle around canSkipFunctionBody() to reduce virtual dispatch on ASTConsumer. There's no need to query when we already know the body can't be skipped. llvm-svn: 199794
* Update FunctionTypeLoc and related names to match r199686Alp Toker2014-01-211-5/+5
| | | | llvm-svn: 199699
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-9/+10
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* It turns out the problem was a bit more wide-spread. Removing a lot of ↵Aaron Ballman2014-01-031-1/+1
| | | | | | | | unneeded typecasts. getScopeRep() already returns a NestedNameSpecifier. No functional changes intended. llvm-svn: 198414
* Convert anachronistic use of 'void *' to 'DeclContext *' in Scope that was a ↵Ted Kremenek2013-10-081-4/+4
| | | | | | holdover from the long-dead Action interface. llvm-svn: 192203
* Switch the semantic DeclContext for a block-scope declaration of a function orRichard Smith2013-09-201-7/+11
| | | | | | | | | | | | | | variable from being the function to being the enclosing namespace scope (in C++) or the TU (in C). This allows us to fix a selection of related issues where we would build incorrect redeclaration chains for such declarations, and fail to notice type mismatches. Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern, which is only found when searching scopes, and not found when searching DeclContexts. Such a declaration is only made visible in its DeclContext if there are no non-LocalExtern declarations. llvm-svn: 191064
* Cleanup of OpaquePtr. No functionality changes.Serge Pavlov2013-08-271-1/+1
| | | | | | | | - Some documenation were added. - Usages of OpaquePtr<A>.getAsVal<A>() were replaced by OpaquePtr<A>.get(). - Methods getAs and getAsVal were renamed to getPtrTo and getPtrAs respectively. llvm-svn: 189346
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-231-3/+2
| | | | | | No functionality change intended. llvm-svn: 189112
* Omit llvm:: before ArrayRef, as we have using llvm::ArrayRef in ↵Robert Wilhelm2013-08-091-3/+2
| | | | | | include/clang/Basic/LLVM.h. llvm-svn: 188089
* Add option to disable module loading.Daniel Jasper2013-08-051-1/+1
| | | | | | | This patch was created by Lawrence Crowl and reviewed in: http://llvm-reviews.chandlerc.com/D963 llvm-svn: 187738
* Compress pairs. No functionality change.Benjamin Kramer2013-06-291-5/+6
| | | | llvm-svn: 185264
* ArrayRef'ize Sema::CodeCompleteConstructorInitializerDmitri Gribenko2013-06-231-14/+14
| | | | | | Patch by Robert Wilhelm. llvm-svn: 184675
* ArrayRef'ize Sema::CodeComplete*Dmitri Gribenko2013-06-161-76/+59
| | | | | | Patch by Robert Wilhelm. llvm-svn: 184052
* [libclang] For "@import .." code-completion results, associate a ↵Argyrios Kyrtzidis2013-05-291-2/+2
| | | | | | CXCursor_ModuleImportDecl cursor instead of CXCursor_NotImplemented. llvm-svn: 182871
* Enhance the ObjC global method pool to record whether there were 0, 1, or >= ↵Argyrios Kyrtzidis2013-04-171-3/+3
| | | | | | | | | 2 methods (with a particular selector) inside categories. This is done by extending ObjCMethodList (which is only used by the global method pool) to have 2 extra bits of information. We will later take advantage of this info in global method pool for the overridden methods calculation. llvm-svn: 179652
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-121-4/+3
| | | | | | semantics as __thread for now. llvm-svn: 179424
* Add 178663 back.Rafael Espindola2013-04-031-1/+1
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-1/+1
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-1/+1
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* Support C11 _Atomic type qualifier. This is more-or-less just syntactic ↵Richard Smith2013-03-281-0/+3
| | | | | | sugar for the _Atomic type specifier. llvm-svn: 178210
* [Preprocessor/Modules] Separate the macro directives kinds into their own ↵Argyrios Kyrtzidis2013-03-261-1/+1
| | | | | | | | | | | | | | | | MacroDirective's subclasses. For each macro directive (define, undefine, visibility) have a separate object that gets chained to the macro directive history. This has several benefits: -No need to mutate a MacroDirective when there is a undefine/visibility directive. Stuff like PPMutationListener become unnecessary. -No need to keep extra source locations for the undef/visibility locations for the define directive object (which is the majority of the directives) -Much easier to hide/unhide a section in the macro directive history. -Easier to track the effects of the directives across different submodules. llvm-svn: 178037
* documentation parsing: when providing code completion commentFariborz Jahanian2013-03-231-2/+9
| | | | | | | for a getter used in property-dot syntax, if geter has its own comment use it. // rdar://12791315 llvm-svn: 177797
* documentation parsing. Provide code completion comment Fariborz Jahanian2013-03-221-0/+14
| | | | | | | | for self.GetterName where GetterName is the getter method for a property with name different from the property name (declared via a property getter attribute) // rdar://12791315 llvm-svn: 177744
* Don't try to typo-correct 'super' in an objc method.Argyrios Kyrtzidis2013-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | This created 2 issues: 1) Performance issue, since typo-correction with PCH/modules is rather expensive. 2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would be emitted, like this: 3.m:8:3: error: unknown type name 'super'; did you mean 'super1'? super.x = 0; ^~~~~ super1 t3.m:5:13: note: 'super1' declared here typedef int super1; ^ t3.m:8:8: error: expected identifier or '(' super.x = 0; ^ llvm-svn: 177126
* Add TagDecl::hasNameForLinkage(), which is true if the tagJohn McCall2013-03-091-1/+1
| | | | | | is non-anonymous or is defined in a typedef of itself. llvm-svn: 176742
* Add code completion for @import <rdar://problem/13344306>.Douglas Gregor2013-03-071-0/+8
| | | | llvm-svn: 176666
* objective-C code completion. Property accessors may notFariborz Jahanian2013-02-281-1/+6
| | | | | | | | have their own code completion comments. Use those in their properties in this case. // rdar://12791315 llvm-svn: 176271
* [preprocessor] Split the MacroInfo class into two separate concepts, ↵Argyrios Kyrtzidis2013-02-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | MacroInfo class for the data specific to a macro definition (e.g. what the tokens are), and MacroDirective class which encapsulates the changes to the "macro namespace" (e.g. the location where the macro name became active, the location where it was undefined, etc.) (A MacroDirective always points to a MacroInfo object.) Usually a macro definition (MacroInfo) is where a macro name becomes active (MacroDirective) but splitting the concepts allows us to better model the effect of modules to the macro namespace (also as a bonus it allows better modeling of push_macro/pop_macro #pragmas). Modules can have their own macro history, separate from the local (current translation unit) macro history; MacroDirectives will be used to model the macro history (changes to macro namespace). For example, if "@import A;" imports macro FOO, there will be a new local MacroDirective created to indicate that "FOO" became active at the import location. Module "A" itself will contain another MacroDirective in its macro history (at the point of the definition of FOO) and both MacroDirectives will point to the same MacroInfo object. Introducing the separation of macro concepts is the first part towards better modeling of module macros. llvm-svn: 175585
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-18/+17
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* Remove a const_cast by propagating constness to called functionsDmitri Gribenko2013-02-141-2/+2
| | | | llvm-svn: 175161
* Remove some stray uses of <ctype.h> functions.Jordan Rose2013-02-091-1/+2
| | | | | | These are causing assertions on some MSVC builds. llvm-svn: 174805
* When code completing in a statement, parenthesized expression, orDouglas Gregor2013-01-311-1/+9
| | | | | | | | Objective-C message receiver, the user is as likely to want to write a type name as any other declaration, so give types the same priority as other declarations. Fixes <rdar://problem/12480600>. llvm-svn: 174038
* Allow the computation of the base priority for a declaration code completion ↵Douglas Gregor2013-01-311-19/+65
| | | | | | result to consider the completion context llvm-svn: 174037
* Add "instancetype" as a code completion result for the return type ofDouglas Gregor2013-01-301-0/+5
| | | | | | an Objective-C method. Fixes <rdar://problem/13069990>. llvm-svn: 173905
* The instance methods of the root class of an Objective-C hieararchyDouglas Gregor2013-01-301-2/+6
| | | | | | | can be messaged via the metaclass. Provide code completions for this case. Fixes <rdar://problem/12560296>. llvm-svn: 173903
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-231-116/+125
| | | | llvm-svn: 173277
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-27/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Constify parameter of clang::getCursorKindForDeclDmitri Gribenko2013-01-111-2/+2
| | | | llvm-svn: 172249
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-5/+5
| | | | llvm-svn: 171367
OpenPOWER on IntegriCloud