summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/CodeCompleteConsumer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-55/+55
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Optionally add code completion results for arrow instead of dotIvan Donchevskii2018-05-251-0/+18
| | | | | | | | | | | | | Currently getting such completions requires source correction, reparsing and calling completion again. And if it shows no results and rollback is required then it costs one more reparse. With this change it's possible to get all results which can be later filtered to split changes which require correction. Differential Revision: https://reviews.llvm.org/D41537 llvm-svn: 333272
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-2/+2
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [Sema] Revert r329346 because of memory sanitizer failures.Eugene Zelenko2018-04-051-10/+10
| | | | llvm-svn: 329357
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-04-051-10/+10
| | | | | | other minor fixes (NFC). llvm-svn: 329346
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-201-32/+31
| | | | | | other minor fixes (NFC). llvm-svn: 325544
* [CodeComplete] Avoid name clashes of 'Kind' inside CodeCompletionContext. NFCIlya Biryukov2018-02-191-3/+3
| | | | | | | | | | CodeCompletionContext had declarations of field and enum inside, both named 'Kind'. It caused gcc 4.8 to give an incorrent warning when refering to enum as `enum CodeCompletionContext::Kind`. Avoid that warning by renaming the private field to CCKind. llvm-svn: 325496
* [CodeComplete] Add a helper to print CodeCompletionContext::KindIlya Biryukov2018-02-191-0/+75
| | | | | | | | | | | | | | Summary: Will be used in clangd. See D43377. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D43379 llvm-svn: 325490
* Silence a bunch of implicit fallthrough warningsAdrian Prantl2017-12-191-1/+1
| | | | llvm-svn: 321115
* [clang] Expose orderedString from CodeCompletionResult. NFCSam McCall2017-11-151-16/+12
| | | | llvm-svn: 318286
* 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
OpenPOWER on IntegriCloud