summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement code completion for @selector expressionsDouglas Gregor2010-08-261-0/+1
| | | | llvm-svn: 112186
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-3/+1
| | | | | | | | | | | 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-1/+3
| | | | | | 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-3/+1
| | | | | | | | | 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
* Revert "Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-1/+3
| | | | | | | into the clients", because the C standard library sucks. Where's my stable sort, huh? llvm-svn: 112121
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-251-3/+1
| | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. llvm-svn: 112095
* When combining the code-completion results from Sema long with theDouglas Gregor2010-08-251-2/+6
| | | | | | | | code-completion results cached by ASTUnit, sort the resulting result set. This makes testing far, far easier, so this commit also includes tests for the previous few fixes. llvm-svn: 112070
* Add a missing caseDouglas Gregor2010-08-251-0/+1
| | | | llvm-svn: 112065
* Fix an off-by-one error when computing the precompiled preamble forDouglas Gregor2010-08-251-1/+2
| | | | | | | code completion. We were allowing the preamble to include the line that we're code-completing on. Again, testcase is forthcoming. llvm-svn: 112064
* Make the cursor kind of macro-name-only completions produced byDouglas Gregor2010-08-251-1/+4
| | | | | | | ASTUnit match those produced directly by code completion. Test case is forthcoming. llvm-svn: 112063
* Teach Sema to live without CodeCompleteConsumer.h.John McCall2010-08-251-6/+6
| | | | llvm-svn: 112028
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-241-1/+3
| | | | | | arguments. llvm-svn: 111976
* Implement preprocessor code completion where a macro name is expected,Douglas Gregor2010-08-241-5/+22
| | | | | | | e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
* Introduce new libclang API functions that determine the availabilityDouglas Gregor2010-08-231-1/+4
| | | | | | | of a cursor or code-completion result, e.g., whether that result refers to an unavailable, deleted, or deprecated declaration. llvm-svn: 111858
* Don't include macro results when we're completing a declarator.Douglas Gregor2010-08-231-3/+1
| | | | llvm-svn: 111830
* Introduce a new code-completion point when we're parsing aDouglas Gregor2010-08-231-2/+8
| | | | | | | | | declarator. Here, we can only see a few things (e.g., cvr-qualifiers, nested name specifiers) and we do not want to provide other non-macro completions. Previously, we would end up in recovery mode and would provide a large number of non-relevant completions. llvm-svn: 111818
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-1/+1
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
* When performing code-completion in the presence of a preamble, makeDouglas Gregor2010-08-201-8/+13
| | | | | | | | | sure to (1) actually use the remapped files we were given rather than old data, and (2) keep the remapped files alive until the code-completion results are destroyed. Big thanks to Daniel for the test case. llvm-svn: 111597
* When we decide not to reuse a precompiled preamble, clear out theDouglas Gregor2010-08-201-2/+18
| | | | | | previous precompiled preamble completely. Fixes <rdar://problem/8330950>. llvm-svn: 111590
* Fix a loop overrun in ComputePreamble when the last remapped file was erased,Daniel Dunbar2010-08-191-0/+4
| | | | | | | | and reenable crash recovery test. - Reparsing is still very crashy / weird, so I had to sprinkle random code into the remapped input to get it to do what I want (i.e., crash!). llvm-svn: 111550
* Plug a leak when precompiling the preamble in ASTUnit.Douglas Gregor2010-08-191-7/+21
| | | | llvm-svn: 111504
* Make sure to initialize ASTUnit::UnsafeToFreeDouglas Gregor2010-08-191-1/+2
| | | | llvm-svn: 111490
* Rename the ASTReader header files.Sebastian Redl2010-08-181-1/+1
| | | | llvm-svn: 111474
* More PCH -> AST renaming.Sebastian Redl2010-08-181-9/+9
| | | | llvm-svn: 111472
* Rename various classes from PCH to AST.Sebastian Redl2010-08-181-2/+2
| | | | llvm-svn: 111471
* Rename PCHReader to ASTReader.Sebastian Redl2010-08-181-10/+10
| | | | llvm-svn: 111467
* Rename PCHWriter.h to ASTWriter.hSebastian Redl2010-08-181-1/+1
| | | | llvm-svn: 111466
* Rename PCHWriter to ASTWriterSebastian Redl2010-08-181-2/+2
| | | | llvm-svn: 111463
* When creating an ASTUnit by parsing source code, set DisableFree toDouglas Gregor2010-08-181-1/+1
| | | | | | | | false (not true), so that the CompilerInstance will actually free data structures when it's done. This fixes a major leak with libclang's in-process code completion. llvm-svn: 111457
* Simplify the ownership model for DiagnosticClients, which was reallyDouglas Gregor2010-08-181-18/+16
| | | | | | | convoluted and a bit leaky. Now, the Diagnostic object owns its DiagnosticClient. llvm-svn: 111437
* Reintroduce the serialization library, with fixed dependencies.Sebastian Redl2010-08-171-2/+2
| | | | llvm-svn: 111279
* Revert Sebastian's build-breaking patch.Douglas Gregor2010-08-171-2/+2
| | | | llvm-svn: 111265
* Create a new Serialization module that contains all the PCH code, and will ↵Sebastian Redl2010-08-171-2/+2
| | | | | | contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change. llvm-svn: 111258
* When the # of top-level declarations changes after reparsing aDouglas Gregor2010-08-171-1/+15
| | | | | | | | translation unit, refresh code-completion results because they've probably changed. However, enforce a cooldown period between refreshes, to avoid thrashing. llvm-svn: 111218
* Move include to the proper place. No functionality changeDouglas Gregor2010-08-161-0/+1
| | | | llvm-svn: 111204
* Implement support for cached code completions forDouglas Gregor2010-08-161-21/+51
| | | | | | | | | | nested-name-specifiers. Also includes fixes to the generation of nested-name-specifier result in the non-cached case; we were producing lame results for namespaces and namespace aliases, which (1) didn't always have nested-name-specifiers when we want them, and (2) did not have the necessary "::" as part of the completion. llvm-svn: 111203
* Formatting fixes. No functionality changeDouglas Gregor2010-08-161-5/+5
| | | | llvm-svn: 111186
* Implement name hiding of cached global code-completion results.Douglas Gregor2010-08-161-3/+81
| | | | llvm-svn: 111184
* Move some code out-of-line which has long since grown too large to beDouglas Gregor2010-08-161-61/+69
| | | | | | inlined. No functionality change. llvm-svn: 111176
* When caching code completions for global declarations, keep track ofDouglas Gregor2010-08-161-8/+38
| | | | | | | | | | | | | | | | the usage type of each declaration result, then compare those types to the preferred type of the completion. This provides parity in the priority calculation between the code-completion results produced directly from Sema and those cached by ASTUnit. For the standard Cocoa.h (+ others) example, there's a penalty of 3-4 hundredeths of a second when caching the global results (for ~31,000 results), because we need an ASTContext-agnostic representation of types for the comparison, and therefore we use... strings. Eventually, we'd like to implement a more efficient ASTContext-agnostic encoding of types. llvm-svn: 111165
* Dereferencing NULL pointers is such poor form.Douglas Gregor2010-08-161-4/+8
| | | | llvm-svn: 111150
* When caching global completion results, keep track of the simplifiedDouglas Gregor2010-08-161-1/+23
| | | | | | | | | | | type class, so that we can adjust priorities appropriately when the preferred type for the context and the actual type of the completion are similar. This gets us one step closer to parity of the cached completion results with the non-cached completion results. llvm-svn: 111139
* Open AST/PCH files in binary mode.Benjamin Kramer2010-08-151-2/+2
| | | | llvm-svn: 111106
* Extend the code-completion caching infrastructure to include globalDouglas Gregor2010-08-151-6/+90
| | | | | | | | | | | | | | | | | | declarations (in addition to macros). Each kind of declaration maps to a certain set of completion contexts, and the ASTUnit completion logic introduces the completion strings for those declarations if the actual code-completion occurs in one of the contexts where it matters. There are a few new code-completion-context kinds. Without these, certain completions (e.g., after "using namespace") would need to suppress all global completions, which would be unfortunate. Note that we don't get the priorities right for global completions, because we don't have enough type information. We'll need a way to compare types in an ASTContext-agnostic way before this can be implemented. llvm-svn: 111093
* Implement caching of code-completion results for macro definitionsDouglas Gregor2010-08-131-8/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when the CXTranslationUnit_CacheCompletionResults option is given to clang_parseTranslationUnit(). Essentially, we compute code-completion results for macro definitions after we have parsed the file, then store an ASTContext-agnostic version of those results (completion string, cursor kind, priority, and active contexts) in the ASTUnit. When performing code completion in that ASTUnit, we splice the macro definition results into the results provided by the actual code-completion (which has had macros turned off) before libclang gets those results. We use completion context information to only splice in those results that make sense for that context. With a completion involving all of the macros from Cocoa.h and a few other system libraries (totally ~8500 macro definitions) living in a precompiled header, we get about a 9% performance improvement from code completion, since we no longer have to deserialize all of the macro definitions from the precompiled header. Note that macro definitions are merely the canary; the cache is designed to also support other top-level declarations, which should be a bigger performance win. That optimization will be next. Note also that there is no mechanism for determining when to throw away the cache and recompute its contents. llvm-svn: 111051
* Implement clang_saveTranslationUnit(), which saves a translation unitDouglas Gregor2010-08-131-0/+23
| | | | | | into a PCH/AST file. llvm-svn: 111006
* Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor2010-08-131-3/+14
| | | | | | | | used when parsing (or re-parsing) a file. Also, when loading a precompiled header into ASTUnit, create a Sema object that holds onto semantic-analysis information. llvm-svn: 111003
* Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do ↵Sebastian Redl2010-08-111-0/+3
| | | | | | with the breakage. llvm-svn: 110840
* Fix a thinko in the creation of temporary files for the precompiled preambleDouglas Gregor2010-08-111-1/+2
| | | | llvm-svn: 110804
* Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor2010-08-111-3/+0
| | | | | | | | and create separate decl nodes for forward declarations and the definition," which appears to be causing significant Objective-C breakage. llvm-svn: 110803
OpenPOWER on IntegriCloud