summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/CodeCompleteConsumer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-3/+3
| | | | | | No functionality change intended. llvm-svn: 284730
* Fix unnecessary default switch warningSimon Pilgrim2016-07-271-1/+1
| | | | llvm-svn: 276889
* Implement filtering for code completion of identifiers.Vassil Vassilev2016-07-271-0/+25
| | | | | | | | Patch by Cristina Cristescu and Axel Naumann! Agreed on post commit review (D17820). llvm-svn: 276878
* Silence some MSVC false positive warnings about integer zexts and falling ↵Reid Kleckner2016-02-101-1/+1
| | | | | | off the end of a covered switch llvm-svn: 260411
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-071-2/+4
| | | | | | rdar://19369529 llvm-svn: 241557
* Teach Twine to support SmallString.Yaron Keren2015-03-171-10/+7
| | | | | | | | Enable removing .str() member calls for these frequent cases. http://reviews.llvm.org/D6372 llvm-svn: 232465
* Improves overload completion result chunks.Francisco Lopes da Silva2015-01-281-2/+28
| | | | | | | | | | | | | | | | | | | | | The code building the code completion string for overloads was providing less detail compared to the one building completion strings for function declarations. There was no information about optionals and no information about what's a parameter and what's a function identifier, everything besides ResultType, CurrentParameter and special characters was classified as Text. This makes code completion strings for overload candidates to follow a pattern very similar, but not identical, to the one in use for function declarations: - return type chunk: ResultType - function identifier chunk: Text - parameter chunks: Placeholder - optional parameter chunks: Optional - current parameter chunk: CurrentParameter llvm-svn: 227309
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-5/+5
| | | | llvm-svn: 209613
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-031-1/+0
| | | | llvm-svn: 207896
* Allow the computation of the base priority for a declaration code completion ↵Douglas Gregor2013-01-311-28/+0
| | | | | | result to consider the completion context llvm-svn: 174037
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-231-15/+16
| | | | llvm-svn: 173277
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-2/+2
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* [libclang] Remove the ParentKind cursor kind from code-completion results.Argyrios Kyrtzidis2012-09-261-5/+2
| | | | | | This is to reduce dependency to cursors for the code-completion results. llvm-svn: 164705
* Add a new libclang completion API to get brief documentation comment that isDmitri Gribenko2012-07-021-5/+14
| | | | | | | | | | | | | | | | attached to a declaration in the completion string. Since extracting comments isn't free, a new code completion option is introduced. A new code completion option that enables including brief comments into CodeCompletionString should be a, err, code completion option. But because ASTUnit caches global declarations during parsing before even completion consumer is created, the option is duplicated as a translation unit option (in both libclang and ASTUnit, like the option to cache code completion results). llvm-svn: 159539
* Bitpack CodeCompletionResults.Benjamin Kramer2012-05-201-7/+1
| | | | llvm-svn: 157158
* [code-complete] Introduce CodeCompletionTUInfo which will be used for cachingArgyrios Kyrtzidis2012-04-101-52/+69
| | | | | | | | | | | | | | | | | | | 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
* Introduce a new libclang API to determine the parent context of a codeDouglas Gregor2012-03-271-9/+80
| | | | | | | | | 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-0/+34
| | | | | | | 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
* When determining the availability of an enum constant, also considerDouglas Gregor2012-03-171-2/+11
| | | | | | | the availability of the enumeration type itself. Fixes <rdar://problem/10996386>. llvm-svn: 152977
* 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
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-5/+4
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-2/+5
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-2/+8
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-141-1/+1
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations toErik Verbruggen2011-10-141-4/+28
| | | | | | retrieve annotations from completion string. llvm-svn: 141953
* Added CXAvailability_NotAccessible to indicate that a declaration is ↵Erik Verbruggen2011-10-061-1/+4
| | | | | | available, but not accessible from the current code completion context. llvm-svn: 141278
* When performing code completion after at @interface, allow bothDouglas Gregor2011-07-301-1/+1
| | | | | | | | 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
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+5
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Introduce a new libclang aPI function,Douglas Gregor2011-07-071-1/+7
| | | | | | | | | 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
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* When code-completing a case statement for a switch on a value ofDouglas Gregor2011-02-181-0/+1
| | | | | | | enumeration type, prioritize the enumeration constants and don't provide completions for any other expressions. Fixes <rdar://problem/7283668>. llvm-svn: 125991
* Implement code completion results for the Objective-C Key-Value CodingDouglas Gregor2011-02-171-0/+9
| | | | | | (KVC) and Key-Value Observing (KVO) protocols. llvm-svn: 125696
* Revert r124704, which uniqued code-completion strings. The spaceDouglas Gregor2011-02-021-31/+0
| | | | | | | | | savings of 25% sounds impressive, except that this amounted to only about 360k in our standard "large" completion result set (40,000 results). Since code completion is performance-sensitive, the 4% slowdown due to uniquing outweighs the 360k benefit. llvm-svn: 124737
* Unique code-completion strings. On Cocoa.h, this costs us about 4% inDouglas Gregor2011-02-011-0/+31
| | | | | | speed but saves us about 25% of the memory usage for strings. llvm-svn: 124704
* Create a special allocator class for code completion, so that all ofDouglas Gregor2011-02-011-0/+7
| | | | | | | the string copying goes through a single place that can have associated state. llvm-svn: 124698
* Allocate CodeCompletionString and all of its components in aDouglas Gregor2011-02-011-106/+31
| | | | | | | | | | | | BumpPtrAllocator, rather than manually new/delete'ing them. This optimization also allows us to avoid allocating memory for and copying constant strings (e.g., "return", "class"). This also required embedding the priority and availability of results within the code completion string, to avoid extra memory allocation within libclang. llvm-svn: 124673
* Eliminate the (de-)serialization of code completion results, now thatDouglas Gregor2010-10-111-154/+0
| | | | | | libclang does not support out-of-process code completion. llvm-svn: 116253
* Synchronize globally-cached code completion results with the resultsDouglas Gregor2010-09-231-1/+2
| | | | | | | | | | | | | | provided when the optimization is disabled. In particular, split the completion context CCC_Other into two contexts: CCC_Other, which means that it's an undisclosed context for which any other results are unwelcome, and CCC_Recovery, which is used in recovery cases. Since we're now using the completion context within the completion results builder, make sure that it's always set to something. Fixes <rdar://problem/8470644>. llvm-svn: 114704
* Add code completion for C++ constructors wherever we see the class (orDouglas Gregor2010-09-211-0/+40
| | | | | | class template) and are in a context where we can have a value. llvm-svn: 114441
* Give the Objective-C _cmd an "unlikely" code completion priority; it'sDouglas Gregor2010-09-181-1/+9
| | | | | | very rarely used. llvm-svn: 114286
* Synchronize code-completion cursor kinds with indexing cursorDouglas Gregor2010-09-031-87/+5
| | | | | | kinds. How shameful that this code was duplicated! llvm-svn: 113033
* Simplify code-completion result sorting a bitDouglas Gregor2010-09-031-8/+0
| | | | llvm-svn: 112968
* Rename DeclContext::getLookupContext to getRedeclContext and change its ↵Sebastian Redl2010-08-311-1/+1
| | | | | | semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them. llvm-svn: 112563
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-1/+8
| | | | | | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. Provide a libclang function that sorts the results. 3rd try. How embarrassing. llvm-svn: 112180
* Revert r112149, "Move the sorting of code-completion results out of the mainDaniel Dunbar2010-08-261-8/+1
| | | | | | path and ...", it is failing tests. llvm-svn: 112161
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-1/+8
| | | | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. Provide a libclang function that sorts the results. llvm-svn: 112149
OpenPOWER on IntegriCloud