summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [code-completion] Strip outer nullability annotations when completing method ↵Argyrios Kyrtzidis2015-07-241-3/+6
| | | | | | | | | | | | implementations. The outer nullability is transferred from the declaration to the implementation so including them is redundant. The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well adding them in the implementation will become redundant and we should strip those as well. rdar://21737451 llvm-svn: 243119
* [CodeCompletion] Don't crash on member inits of templated constructors.Benjamin Kramer2015-07-091-3/+7
| | | | | | | Also fixes a crash (on invalid) member functions with a colon initializer. PR23948. llvm-svn: 241811
* [libclang] Replace ObjC generic parameters when code-completing method ↵Douglas Gregor2015-07-071-1/+4
| | | | | | | | implementations. rdar://20643768 llvm-svn: 241559
* [libclang] Fix code-completion of block parameters that are marked with ↵Douglas Gregor2015-07-071-0/+5
| | | | | | | | nullability specifier. rdar://20755276 llvm-svn: 241558
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-071-38/+75
| | | | | | rdar://19369529 llvm-svn: 241557
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* Replace __double_underscored type nullability qualifiers with ↵Douglas Gregor2015-06-241-3/+3
| | | | | | | | | | | | | | | | _Uppercase_underscored Addresses a conflict with glibc's __nonnull macro by renaming the type nullability qualifiers as follows: __nonnull -> _Nonnull __nullable -> _Nullable __null_unspecified -> _Null_unspecified This is the major part of rdar://problem/21530726, but does not yet provide the Darwin-specific behavior for the old names. llvm-svn: 240596
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-2/+2
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-2/+2
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Code completion for nullability type specifiers.Douglas Gregor2015-06-191-13/+58
| | | | | | Another part of rdar://problem/18868820. llvm-svn: 240159
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-3/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-28/+21
| | | | | | | | | | | | | | 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
* [modules] Determine the set of macros exported by a submodule at the end of ↵Richard Smith2015-04-231-1/+1
| | | | | | | | | | | that submodule. Previously we'd defer this determination until writing the AST, which doesn't allow us to use this information when building other submodules of the same module. This change also allows us to use a uniform mechanism for writing module macro records, independent of whether they are local or imported. llvm-svn: 235614
* [libclang] Fix crash when code-completing inside constructor initializer for ↵Argyrios Kyrtzidis2015-03-131-1/+7
| | | | | | | | a builtin type. rdar://20149746 llvm-svn: 232145
* Cleanup: remove artificial division between lookup results and const lookupRichard Smith2015-02-211-2/+2
| | | | | | | results. No-one was ever modifying a lookup result, and it would not be reasonable to do so. llvm-svn: 230123
* Sema: Turn some applicable functions static. NBC.Francisco Lopes da Silva2015-01-291-9/+10
| | | | llvm-svn: 227418
* Improves overload completion result chunks.Francisco Lopes da Silva2015-01-281-48/+89
| | | | | | | | | | | | | | | | | | | | | 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
* Sema: Formatting. No behavior change.Francisco Lopes da Silva2015-01-251-1/+1
| | | | llvm-svn: 227052
* Sema: require a complete type before lookup.Francisco Lopes da Silva2015-01-251-11/+14
| | | | llvm-svn: 227037
* Sema: code completion for variadic prototypes.Francisco Lopes da Silva2015-01-231-1/+3
| | | | llvm-svn: 226908
* Sema: code completion for pointer and reference to functions.Francisco Lopes da Silva2015-01-221-19/+29
| | | | llvm-svn: 226865
* Sema: Add FIXME noteFrancisco Lopes da Silva2015-01-221-0/+1
| | | | llvm-svn: 226813
* Initial support for C++ parameter completionFrancisco Lopes da Silva2015-01-211-76/+150
| | | | | | | | | | | | | | | | | | | | The improved completion in call context now works with: - Functions. - Member functions. - Constructors. - New expressions. - Function call expressions. - Template variants of the previous. There are still rough edges to be fixed: - Provide support for optional parameters. (fix known) - Provide support for member initializers. (fix known) - Provide support for variadic template functions. (fix unknown) - Others? llvm-svn: 226670
* PR13699: Include friend declarations in code completion results if they had aRichard Smith2015-01-151-3/+6
| | | | | | | | | prior visible declaration. Prefer to take template parameter names from the first declaration. Testcase from a patch by Francisco Lopes! llvm-svn: 226083
* Address review feedback on r221933.Nico Weber2014-12-271-15/+17
| | | | | | | | | | | Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in the low bit of the ObjCMethodDecl pointer, using a PointerIntPair. Most of this patch is replacing ".Method" with ".getMethod()". No intended behavior change. llvm-svn: 224876
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-191-34/+42
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* Typo fix.Yaron Keren2014-11-141-1/+1
| | | | llvm-svn: 222016
* Avoid a crash after loading an #undef'd macro in code completionBen Langmuir2014-09-301-1/+2
| | | | | | | | | | | In code-completion, don't assume there is a MacroInfo for everything, since we aren't serializing the def corresponding to a later #undef in the same module. Also setup the HadMacro bit correctly for undefs to avoid an assertion failure. rdar://18416901 llvm-svn: 218694
* Switch over a few uses of param_begin() to parameters()Alp Toker2014-07-071-2/+2
| | | | llvm-svn: 212442
* Extract an isReservedName() functionAlp Toker2014-06-301-18/+18
| | | | | | | | | | | | | | We'll want to share the implementation if anything else decides to check for reserved names in future, so make this little snippet of code more discoverable. Also remove the __va_list_tag and __builtin_va_list special-case checks. They're leftovers from before when the reserved name logic was added. No change in functionality. llvm-svn: 212006
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-3/+3
| | | | | | takeAs to getAs. llvm-svn: 209800
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-88/+95
| | | | llvm-svn: 209613
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-5/+3
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* Implement [over.match.oper]p3 properly, by filtering the non-candidates outRichard Smith2014-04-171-1/+1
| | | | | | | when building the candidate set, rather than trying to contort name lookup into handling this. llvm-svn: 206436
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-091-1/+6
| | | | | | code-completion results. llvm-svn: 205917
* [C++11] Replacing Scope iterators decl_begin() and decl_end() with ↵Aaron Ballman2014-03-171-3/+2
| | | | | | iterator_range decls(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. llvm-svn: 204052
* [C++11] Replacing ObjCObjectPointerType iterators qual_begin() and ↵Aaron Ballman2014-03-171-12/+6
| | | | | | qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204048
* [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-141-4/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203922
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-4/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203863
* [C++11] Replacing ObjCInterfaceDecl iterators known_categories_begin() and ↵Aaron Ballman2014-03-131-17/+6
| | | | | | known_categories_end() with iterator_range known_categories(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203854
* [C++11] Replacing ObjCInterfaceDecl iterators visible_categories_begin() and ↵Aaron Ballman2014-03-131-23/+8
| | | | | | visible_categories_end() with iterator_range visible_categories(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203851
* [C++11] Replacing ObjCInterfaceDecl iterators ↵Aaron Ballman2014-03-131-4/+2
| | | | | | all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203848
* [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-4/+2
| | | | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases. llvm-svn: 203842
* Renaming the recently-created (r203830) props() range API to properties() ↵Aaron Ballman2014-03-131-2/+2
| | | | | | for clarity. llvm-svn: 203835
* [C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() ↵Aaron Ballman2014-03-131-14/+8
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203832
* [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() ↵Aaron Ballman2014-03-131-13/+5
| | | | | | with iterator_range props(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203830
* [C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() ↵Aaron Ballman2014-03-131-6/+4
| | | | | | with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203808
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-6/+4
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-3/+3
| | | | | | class. llvm-svn: 203640
* [C++11] Replacing DeclBase iterators specific_attr_begin() and ↵Aaron Ballman2014-03-101-6/+2
| | | | | | specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203474
OpenPOWER on IntegriCloud