summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/complete-macros.c
Commit message (Collapse)AuthorAgeFilesLines
* [CodeComplete] Fix ASTUnit cached completion of macros from preamble, broken ↵Sam McCall2019-07-181-0/+3
| | | | | | | | | | | | | | | | | | in r342528 Summary: The problem is the default LoadExternal with no completer, which happens when loading global results. Reviewers: ilya-biryukov, nik Subscribers: arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64864 llvm-svn: 366409
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-1/+1
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-091-10/+13
| | | | | | code-completion results. llvm-svn: 205917
* If a macro has been #undef'd in a precompiled header, we still need toDouglas Gregor2012-10-091-2/+3
| | | | | | | | | | | | write out the macro history for that macro. Similarly, we need to cope with reading a macro definition that has been #undef'd. Take advantage of this new ability so that global code-completion results can refer to #undef'd macros, rather than losing them entirely. For multiply defined/#undef'd macros, we will still get the wrong result, but it's better than getting no result. llvm-svn: 165502
* Fix the code completion string for variadic macros with more than oneDouglas Gregor2012-01-211-2/+4
| | | | | | | 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
* When producing code completion results for variadic macros, fold theDouglas Gregor2011-07-301-0/+14
| | | | | | | variadic bit (", ..." or ", args...") into the prior placeholder, like we do with functions and methods. Fixes <rdar://problem/9740808>. llvm-svn: 136563
* Swap the priorities of constants and types, so that we prefer types.Douglas Gregor2010-09-161-2/+2
| | | | llvm-svn: 114086
* When caching global completion results, keep track of the simplifiedDouglas Gregor2010-08-161-0/+2
| | | | | | | | | | | 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
* Implement caching of code-completion results for macro definitionsDouglas Gregor2010-08-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* During code completion, give the "nil" and "NULL" macros the sameDouglas Gregor2010-07-081-1/+14
| | | | | | | priority as other constants. And, if we're in a place where we prefer a pointer type, consider "nil" and "NULL" to be close matches. llvm-svn: 107910
* Code completion results that refer to macros now get the cursor kindDouglas Gregor2010-04-051-0/+11
of macro definitions when passed to CIndex. Add test for code completion of macros via CIndex. llvm-svn: 100431
OpenPOWER on IntegriCloud