summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Still more Doxygen documentation fixes:James Dennett2012-06-141-3/+0
| | | | | | | | * Escape #, < and @ symbols where Doxygen would try to interpret them; * Fix several function param documentation where names had got out of sync; * Delete param documentation referring to parameters that no longer exist. llvm-svn: 158472
* This makes SemaCodeComplete.cpp more Doxygen-friendly by changing theJames Dennett2012-06-141-30/+31
| | | | | | | | | | | | | | | | OBJC_AT_KEYWORD_NAME take a string literal argument where previously its second argument was an unquoted token; macro invocations such as OBJC_AT_KEYWORD_NAME(NeedAt,{) confuse Doxygen's parser. While I'm wary of changing code (rather than just comments) to work around Doxygen's limitations, in this case the change makes the code more readable for human beings as well, and the macro derived no benefit from using the preprocessor's stringification operator, as it never has need of the unquoted token. I've also included a couple of trivial drive-by fixes to doc comments. llvm-svn: 158440
* When code completion walks the members of a protocol or interface,Douglas Gregor2012-06-121-13/+45
| | | | | | make sure that we walk the definition. Fixes <rdar://problem/11427742>. llvm-svn: 158357
* Convert comments to proper Doxygen comments.Dmitri Gribenko2012-06-081-3/+3
| | | | llvm-svn: 158241
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-12/+12
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Make BuiltinType::getName return a StringRef and introduce ↵Argyrios Kyrtzidis2012-05-051-1/+1
| | | | | | | | | | | | | BuiltinType::getNameAsCString to get a const char* if necessary. This avoids unnecessary conversions when we want to use the result of getName as a StringRef. Part of rdar://10796159 llvm-svn: 156227
* clang_getCursorLexicalParent should return a translation unit cursor for ↵Douglas Gregor2012-04-301-0/+1
| | | | | | declarations at the global scope, from Evan P. Fixes PR9083. llvm-svn: 155858
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-16/+16
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Include the Objective-C parameter- and return-passing qualifiers whenDouglas Gregor2012-04-101-5/+15
| | | | | | | providing code completions for Objective-C method declarations. Fixes <rdar://problem/11164498>. llvm-svn: 154421
* Don't include the ':' following code-completion suggestions forDouglas Gregor2012-04-101-3/+6
| | | | | | | 'public', 'private', or 'protected', unless code completion patterns are enabled. Fixes <rdar://problem/11189132>. llvm-svn: 154413
* [code-complete] Introduce CodeCompletionTUInfo which will be used for cachingArgyrios Kyrtzidis2012-04-101-37/+114
| | | | | | | | | | | | | | | | | | | code-completion related strings specific to a translation unit (ASTContext and related data) CodeCompletionAllocator does such limited caching, by caching the name assigned to a DeclContext*, but that is not the appropriate place since that object has a lifetime that can extend beyond that of an ASTContext. Introduce CodeCompletionTUInfo which will be always tied to a translation unit to do this kind of caching and move the caching of CodeCompletionAllocator into this object, and propagate it to all the places where it will be needed. The plan is to extend the caching where appropriate, using CodeCompletionTUInfo, to avoid re-calculating code-completion strings. Part of rdar://10796159. llvm-svn: 154408
* Remove more redundant lookups. Add a new "all_lookups_iterator" which providesNick Lewycky2012-04-031-9/+1
| | | | | | | | a view over the contents of a DeclContext without exposing the implementation details of the StoredDeclsMap. Use this in LookupVisibleDecls to find the visible declarations. Fixes PR12339! llvm-svn: 153970
* Introduce a new libclang API to determine the parent context of a codeDouglas Gregor2012-03-271-34/+22
| | | | | | | | | completion item. For example, if the code completion itself represents a declaration in a namespace (say, std::vector), then this API retrieves the cursor kind and name of the namespace (std). Implements <rdar://problem/11121951>. llvm-svn: 153545
* Move CodeCompletionBuilder's chunk adding methods out of line.Benjamin Kramer2012-03-261-38/+31
| | | | | | | This makes sense because chunk's ctor is also out of line and simplifies considerably when inlined with a constant parameter. Shrinks clang on i386-linux-Release+Asserts by 65k. llvm-svn: 153446
* [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() ↵Argyrios Kyrtzidis2012-03-131-3/+2
| | | | | | | | | iterators instead of ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use even if the caller did not check that the interface is a definition. llvm-svn: 152597
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-71/+71
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+20
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* ArrayRef'ize various functions in the AST/Parser/Sema.Ahmed Charles2012-02-251-19/+17
| | | | llvm-svn: 151447
* If code completion patterns are not enabled, use simpler else/else ifDouglas Gregor2012-02-161-12/+16
| | | | | | completions that don't insert braces. Fixes <rdar://problem/10764168>. llvm-svn: 150707
* Implement code completion support for lambda capture lists.Douglas Gregor2012-02-151-13/+92
| | | | llvm-svn: 150583
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* When providing code completions for a switch over a scoped enumerationDouglas Gregor2012-02-011-4/+1
| | | | | | type, be sure to add the qualifier for the enumeration type. llvm-svn: 149471
* SmallBitVectorize the deduced parameter set.Benjamin Kramer2012-01-301-1/+2
| | | | llvm-svn: 149253
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-291-0/+52
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* Added source location for the template keyword in AST template-id expressions.Abramo Bagnara2012-01-271-1/+3
| | | | llvm-svn: 149127
* [libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"Argyrios Kyrtzidis2012-01-241-13/+2
| | | | | | | | for forward references of classes and protocols, this breaks libclang API usage. rdar://10747438. llvm-svn: 148861
* Handle pseudo-object expressions (and any other placeholderDouglas Gregor2012-01-231-3/+7
| | | | | | | expression) when code-completing member access expressions. Fixes <rdar://problem/10717172>. llvm-svn: 148703
* Fix the code completion string for variadic macros with more than oneDouglas Gregor2012-01-211-32/+21
| | | | | | | argument, which was broken and very ugly (and even had a test case to make *sure* it was broken and ugly). Fixes <rdar://problem/10609117>. llvm-svn: 148606
* Remove dead comments as per Chandler's feedback to r148292David Blaikie2012-01-171-2/+0
| | | | llvm-svn: 148294
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-11/+8
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Introduce a CodeCompletionResult::CreateCodeCompletionString() thatArgyrios Kyrtzidis2012-01-171-20/+31
| | | | | | | | does not depend on Sema, it accepts an ASTContext and a Preprocessor. Step towards making clang_getCursorCompletionString not depend on Sema. llvm-svn: 148278
* 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
OpenPOWER on IntegriCloud