summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexCodeCompletion.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-1/+5
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* [libclang] Remove the ParentKind cursor kind from code-completion results.Argyrios Kyrtzidis2012-09-261-2/+0
| | | | | | 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-4/+21
| | | | | | | | | | | | | | | | 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
* [code-complete] Introduce CodeCompletionTUInfo which will be used for cachingArgyrios Kyrtzidis2012-04-101-7/+13
| | | | | | | | | | | | | | | | | | | 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
* [libclang] Rename setBackGroundPriority -> setThreadBackgroundPriority.Argyrios Kyrtzidis2012-03-281-1/+1
| | | | llvm-svn: 153566
* [libclang] Introduce options to control the priority for the threadsArgyrios Kyrtzidis2012-03-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | that libclang creates. -Introduce CXGlobalOptFlags enum for the new options that can be set on the CXIndex object. -CXGlobalOpt_ThreadBackgroundPriorityForIndexing affects: clang_indexSourceFile clang_indexTranslationUnit clang_parseTranslationUnit clang_saveTranslationUnit -CXGlobalOpt_ThreadBackgroundPriorityForEditing affects: clang_reparseTranslationUnit clang_codeCompleteAt clang_annotateTokens rdar://9075282 llvm-svn: 153562
* Introduce a new libclang API to determine the parent context of a codeDouglas Gregor2012-03-271-1/+15
| | | | | | | | | 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
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-5/+5
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-5/+5
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* drop more llvm:: prefixes on SmallString<>Dylan Noblesmith2012-02-131-6/+6
| | | | | | More cleanup after r149799. llvm-svn: 150380
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-2/+1
| | | | llvm-svn: 148577
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-4/+2
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations toErik Verbruggen2011-10-141-0/+14
| | | | | | retrieve annotations from completion string. llvm-svn: 141953
* Make sure we initialize the "extra" data within the libclang codeDouglas Gregor2011-10-101-1/+6
| | | | | | | | | completion context, in case we end up having no code-completion callback. Individual instances of this problem are always bugs that need to be fixed, but it's better to make sure we have initialized data here. llvm-svn: 141598
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+2
| | | | llvm-svn: 140478
* [libclang] Workaround potential race condition with code completion ↵Ted Kremenek2011-08-171-0/+13
| | | | | | | | | AllocatedResults being freed after a CXTranslationUnit. The Container USR's CXString had its underlying data owned by the CXTranslationUnit's string pool. This would result in trying to access freed memory. llvm-svn: 137887
* 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
* Eliminate a bunch of temporary strings.Benjamin Kramer2011-07-261-1/+1
| | | | llvm-svn: 136092
* Add new libclang API, clang_codeCompleteGetObjCSelector(), whichDouglas Gregor2011-07-261-2/+31
| | | | | | | provides the partial Objective-C selector used in a code completion. From Connor Wakamo! llvm-svn: 136084
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-11/+11
| | | | | | | | 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-6/+86
| | | | | | Connor Wakamo! llvm-svn: 135651
* Introduce a new libclang aPI function,Douglas Gregor2011-07-071-0/+192
| | | | | | | | | 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
* When the environment variable LIBCLANG_RESOURCE_USAGE is set, teachDouglas Gregor2011-05-051-1/+2
| | | | | | | libclang to emit information about resource usage after parsing, code completion, etc. llvm-svn: 130946
* Improve crash recovery cleanup to recovery CompilerInstances during crash ↵Ted Kremenek2011-03-211-6/+6
| | | | | | | | | | recovery. This was a huge resource "root" during crashes. This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance object. llvm-svn: 128011
* Correctly store and keep track of the FileSystemOptions in ASTUnit and in ↵Anders Carlsson2011-03-181-3/+6
| | | | | | clang_codeCompleteAt. llvm-svn: 127890
* Teach the CXCodeCompleteResults results structure, which storesDouglas Gregor2011-02-161-1/+11
| | | | | | | | | code-completion results accessed via libclang, to extend the lifetime of the allocator used for cached global code-completion results at least until these completion results are destroyed. Fixes <rdar://problem/8997369>. llvm-svn: 125678
* Fix name lookup issueDouglas Gregor2011-02-011-1/+1
| | | | llvm-svn: 124700
* Create a special allocator class for code completion, so that all ofDouglas Gregor2011-02-011-2/+2
| | | | | | | 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-48/+26
| | | | | | | | | | | | 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
* Use atomic operations for libclang's object count tracking.Douglas Gregor2010-12-071-3/+4
| | | | llvm-svn: 121073
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120297
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-4/+4
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* give FileManager a 'FileSystemOptions' ivar, which will be usedChris Lattner2010-11-231-1/+3
| | | | | | | to simplify a bunch of code in it. It should ultimately get inlined into FileManager. llvm-svn: 120007
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-181-1/+3
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* Make definition of CXTranslationUnitImpl privateTed Kremenek2010-11-171-0/+1
| | | | | | to libclang. llvm-svn: 119585
* Fix source-range information for Objective-C properties. Previously,Douglas Gregor2010-11-171-1/+17
| | | | | | | | | | | | we were just getting a range covering only the property name, which is certainly not correct (and broke token annotation, among other things). Also, teach libclang about the relationship between @synthesize/@dynamic and @property, so we get property name and cursor-reference information for @synthesize and @dynamic. llvm-svn: 119409
* Change CXTranslationUnit to not directly cast to an ASTUnit*,Ted Kremenek2010-11-161-4/+4
| | | | | | | | | | | | | | | | | | | but to wrap both an ASTUnit and a "string pool" that will be used for fast USR generation. This requires a bunch of mechanical changes, as there was a ton of code that assumed that CXTranslationUnit and ASTUnit* were the same. Along with this change, introduce CXStringBuf, which provides an llvm::SmallVector<char> backing for repeatedly generating CXStrings without a huge amount of malloc() traffic. This requires making some changes to the representation of CXString by renaming a few fields (but keeping the size of the object the same). llvm-svn: 119337
* Move CXString creation/management routines intoTed Kremenek2010-11-161-0/+1
| | | | | | | their own .cpp file and make the interpretation of its flags private. llvm-svn: 119319
* libclang: Add some support for running certain entry points in a "safety"Daniel Dunbar2010-11-051-1/+1
| | | | | | | thread, primarily to get a larger stack. - Yes, I feel dirty. llvm-svn: 118274
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-4/+7
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Introduce code completion results for Objective-C methods, both whenDouglas Gregor2010-10-181-6/+52
| | | | | | | | | declaring methods and when sending messages to them, by bringing all of the selector into TypedCheck chunks in the completion result. This way, we can improve the sorting of these results to account for the full selector name rather than just the first chunk. llvm-svn: 116746
* Eliminate clang_codeComplete(). libclang clients should be using theDouglas Gregor2010-10-111-293/+0
| | | | | | faster, in-process, more-configurable clang_codeCompleteAt(). llvm-svn: 116245
* Switch c-index-test from clang_codeComplete() over toDouglas Gregor2010-10-111-7/+36
| | | | | | | | | | clang_codeCompleteAt(). This uncovered a few issues with the latter: - ASTUnit wasn't saving/restoring diagnostic state appropriately between reparses and code completions. - "Overload" completions weren't being passed through to the client llvm-svn: 116241
* Fix the mapping of vertical-space cursor kinds to produce a newline,Douglas Gregor2010-10-081-4/+1
| | | | | | rather than a space. llvm-svn: 116097
* Add some missing concurrency checks into libclangDouglas Gregor2010-09-231-0/+2
| | | | llvm-svn: 114682
* Fix my silly sorting predicate. I hate integer-to-bool conversionsDouglas Gregor2010-09-101-1/+1
| | | | llvm-svn: 113656
* Make it clear that libclang does not modify the command-line argumentsDouglas Gregor2010-09-011-1/+1
| | | | | | it is given. llvm-svn: 112717
* Teach clang_codeComplete to always sort its code-completion resultsDouglas Gregor2010-08-271-0/+1
| | | | llvm-svn: 112292
* Implement code completion for @selector expressionsDouglas Gregor2010-08-261-1/+1
| | | | llvm-svn: 112186
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-0/+35
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud