summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Spell function pointer correctly.Daniel Dunbar2009-09-221-1/+1
| | | | llvm-svn: 82543
* Revert "Switch a few clients over to StringLiteral::getString.", this is ↵Daniel Dunbar2009-09-221-7/+11
| | | | | | breaking some projects, but I don't have a test case yet. llvm-svn: 82539
* Switch a few clients over to StringLiteral::getString.Daniel Dunbar2009-09-221-11/+7
| | | | | | - Switching all of them out-of-my-current-scope-of-interest, sorry. llvm-svn: 82515
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-2115-126/+126
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Code completion for ordinary names when we're starting a declaration, ↵Douglas Gregor2009-09-212-0/+19
| | | | | | expression, or statement llvm-svn: 82481
* When providing a code-completion suggestion for a hidden name, includeDouglas Gregor2009-09-211-73/+94
| | | | | | | | | | | | | | a nested-name-specifier that describes how to refer to that name. For example, given: struct Base { int member; }; struct Derived : Base { int member; }; the code-completion result for a member access into "Derived" will provide both "member" to refer to Derived::member (no qualification needed) and "Base::member" to refer to Base::member (qualification included). llvm-svn: 82476
* Enhance "case" code completion in C++ to suggest qualified names forDouglas Gregor2009-09-211-12/+91
| | | | | | | | | enumerators when either the user intentionally wrote a qualified name (in which case we just use that nested-name-specifier to match the user's code) or when this is the first "case" statement and we need a qualified name to refer to an enumerator in a different scope. llvm-svn: 82474
* Code completion for "case" statements within a switch on an expressionDouglas Gregor2009-09-212-0/+74
| | | | | | of enumeration type, providing the various unused enumerators as options. llvm-svn: 82467
* Refactor and simplify the CodeCompleteConsumer, so that all of theDouglas Gregor2009-09-214-870/+919
| | | | | | | real work is performed within Sema. Addresses Chris's comments, but still retains the heavyweight list-of-multimaps data structure. llvm-svn: 82459
* In C++ code completion, only suggest the "template" keyword after ".",Douglas Gregor2009-09-181-4/+18
| | | | | | | "->", or "::" if we will be looking into a dependent context. It's not wrong to use the "template" keyword, but it's to needed, either. llvm-svn: 82307
* Make the construction of the code-completion string for a functionDouglas Gregor2009-09-183-10/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | template smarter, by taking into account which function template parameters are deducible from the call arguments. For example, template<typename RandomAccessIterator> void sort(RandomAccessIterator first, RandomAccessIterator last); will have a code-completion string like sort({RandomAccessIterator first}, {RandomAccessIterator last}) since the template argument for its template parameter is deducible. On the other hand, template<class X, class Y> X* dyn_cast(Y *Val); will have a code-completion string like dyn_cast<{class X}>({Y *Val}) since the template type parameter X is not deducible from the function call. llvm-svn: 82306
* Introduce code completion patterns for templates, which provide theDouglas Gregor2009-09-181-0/+88
| | | | | | angle brackets < > along with placeholder template arguments. llvm-svn: 82304
* Introduce code completion strings, which describe how to *use* theDouglas Gregor2009-09-181-2/+131
| | | | | | | results of code completion, e.g., by providing function call syntax with placeholders for each of the parameters. llvm-svn: 82293
* C++ code completion after the "operator" keyword. Provide overloadedDouglas Gregor2009-09-183-1/+83
| | | | | | operators, type specifiers, type names, and nested-name-specifiers. llvm-svn: 82264
* Introduce four new code-completion hooks for C++:Douglas Gregor2009-09-183-2/+102
| | | | | | | | | | - after "using", show anything that can be a nested-name-specifier. - after "using namespace", show any visible namespaces or namespace aliases - after "namespace", show any namespace definitions in the current scope - after "namespace identifier = ", show any visible namespaces or namespace aliases llvm-svn: 82251
* Don't perform name lookup into a given declaration context more than once ↵Douglas Gregor2009-09-181-4/+31
| | | | | | during code completion llvm-svn: 82234
* Handle using declarations and overload sets in code completion.Douglas Gregor2009-09-181-2/+15
| | | | llvm-svn: 82233
* For code completion in C++ member access expressions and tag names,Douglas Gregor2009-09-181-9/+32
| | | | | | | | | | | | | look into the current scope for anything that could start a nested-names-specifier. These results are ranked worse than any of the results actually found in the lexical scope. Perform a little more pruning of the result set, eliminating constructors, __va_list_tag, and any duplication of declarations in the result set. For the latter, implemented NamespaceDecl::getCanonicalDecl. llvm-svn: 82231
* When gathering results for code completion, only include hiddenDouglas Gregor2009-09-181-1/+38
| | | | | | | results when there is some way to refer to them in the language, such as with a qualified name in C++. llvm-svn: 82223
* Implement code completion for tags, e.g., code completion after "enum"Douglas Gregor2009-09-184-20/+188
| | | | | | | | | | | | | will provide the names of various enumerations currently visible. Introduced filtering of code-completion results when we build the result set, so that we can identify just the kinds of declarations we want. This implementation is incomplete for C++, since we don't consider that the token after the tag keyword could start a nested-name-specifier. llvm-svn: 82222
* Initial implementation of a code-completion interface in Clang. InDouglas Gregor2009-09-176-4/+396
| | | | | | | | | | | | | | | | | | | | | | | | | | | essence, code completion is triggered by a magic "code completion" token produced by the lexer [*], which the parser recognizes at certain points in the grammar. The parser then calls into the Action object with the appropriate CodeCompletionXXX action. Sema implements the CodeCompletionXXX callbacks by performing minimal translation, then forwarding them to a CodeCompletionConsumer subclass, which uses the results of semantic analysis to provide code-completion results. At present, only a single, "printing" code completion consumer is available, for regression testing and debugging. However, the design is meant to permit other code-completion consumers. This initial commit contains two code-completion actions: one for member access, e.g., "x." or "p->", and one for nested-name-specifiers, e.g., "std::". More code-completion actions will follow, along with improved gathering of code-completion results for the various contexts. [*] In the current -code-completion-dump testing/debugging mode, the file is truncated at the completion point and EOF is translated into "code completion". llvm-svn: 82166
* Merge uninstantiated default arguments more carefully, and try not toDouglas Gregor2009-09-172-3/+9
| | | | | | | complain about specializations of member functions that are not definitions. Fixes PR4995. llvm-svn: 82159
* Fix two crashes on value dependent expressions (shift and null-pointer check).Daniel Dunbar2009-09-171-1/+2
| | | | | | | | - Doug, please check. - PR4940. llvm-svn: 82129
* Remove trailing whitespace.Daniel Dunbar2009-09-171-8/+7
| | | | llvm-svn: 82128
* When creating function types, remove any top-level CVR qualifications in the ↵Anders Carlsson2009-09-162-4/+20
| | | | | | function type argument types. llvm-svn: 82093
* Improved representation and support for friend class templates. Angst about ↵John McCall2009-09-163-35/+62
| | | | | | same. llvm-svn: 82088
* Improve handling of vector casts in C++.Anders Carlsson2009-09-161-0/+26
| | | | llvm-svn: 82072
* Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls evenDouglas Gregor2009-09-163-24/+71
| | | | | | | | | | when we are not instantiating the corresponding "current instantiation." This happens, e.g., when we are instantiating a declaration reference that refers into the "current instantiation" but occurs in a default function argument. The libstdc++ vector default constructor now instantiates properly. llvm-svn: 82069
* Fix a typo in a FIXMEDouglas Gregor2009-09-161-1/+1
| | | | llvm-svn: 81960
* When implicitly declaring operators new, new[], delete, and delete[],Douglas Gregor2009-09-155-25/+94
| | | | | | | | | | | | give them the appropriate exception specifications. This, unfortunately, requires us to maintain and/or implicitly generate handles to namespace "std" and the class "std::bad_alloc". However, every other approach I've come up with was more hackish, and this standard requirement itself is quite the hack. Fixes PR4829. llvm-svn: 81939
* 1) don't do overload resolution in selecting conversionFariborz Jahanian2009-09-151-26/+20
| | | | | | | | to pointer function for delete expression. 2) Treat type conversion function and its 'const' version as identical in building the visible conversion list. llvm-svn: 81930
* Add back the workaround since it lead to constructor conversion bugs :(Anders Carlsson2009-09-151-0/+6
| | | | llvm-svn: 81917
* When printing an overload candidate that is a function template specialization,Douglas Gregor2009-09-151-0/+7
| | | | | | | | | | point at the template and print out its template arguments, e.g., ambiguous-ovl-print.cpp:5:8: note: candidate function template specialization [with T = int] void f(T*, long); llvm-svn: 81907
* Issue good diagnostics when initialization failes due toFariborz Jahanian2009-09-153-26/+39
| | | | | | ambiguity in type conversion function selection. llvm-svn: 81898
* Add an assertion and a test case, in a fruitless attempt to track down an ↵Douglas Gregor2009-09-151-0/+3
| | | | | | existing bug llvm-svn: 81885
* Perform overload resolution when selecting a pointer conversionFariborz Jahanian2009-09-151-12/+25
| | | | | | | function for delete of a class expression and issue good diagnostic when result is ambiguous. llvm-svn: 81870
* Slightly improved template argument deduction for use in partialDouglas Gregor2009-09-152-1/+15
| | | | | | | ordering, along with another test case for partial ordering of partial specializations. llvm-svn: 81869
* Implement partial ordering of class template partial specializations Douglas Gregor2009-09-155-21/+202
| | | | | | (C++ [temp.class.order]). llvm-svn: 81866
* Use getTrueExpr/getFalseExpr as suggested by Doug.Anders Carlsson2009-09-151-2/+2
| | | | llvm-svn: 81863
* If a conversion operator exists in a base class, make sure to cast the ↵Anders Carlsson2009-09-151-1/+7
| | | | | | object to that base class. llvm-svn: 81852
* When performing an user defined conversion sequence, perform the initial ↵Anders Carlsson2009-09-152-10/+21
| | | | | | standard conversion sequence. This lets us remove a workaround in SemaCompleteConstructorCall. llvm-svn: 81847
* Revert for real.Anders Carlsson2009-09-151-5/+3
| | | | llvm-svn: 81844
* Whoops, didn't mean to commit this.Anders Carlsson2009-09-151-5/+1
| | | | llvm-svn: 81842
* Only reuse an already existing ImplicitCastExpr if the cast kinds are the same.Anders Carlsson2009-09-152-7/+17
| | | | llvm-svn: 81841
* Get rid of the CastInfo struct.Anders Carlsson2009-09-152-6/+4
| | | | llvm-svn: 81839
* Handle reinterpret_cast between integral types and pointer types.Anders Carlsson2009-09-151-7/+12
| | | | llvm-svn: 81837
* Issue a good diagnostics when attempt to selectFariborz Jahanian2009-09-152-4/+17
| | | | | | a type convesion function results in ambiguity. llvm-svn: 81812
* Diagnose taking the address of a bit-field inside a conditional operator.Anders Carlsson2009-09-141-0/+4
| | | | llvm-svn: 81808
* Implement partial ordering of function templates when calling aDouglas Gregor2009-09-141-1/+2
| | | | | | conversion function. llvm-svn: 81807
* Test function template partial ordering when resolving the address ofDouglas Gregor2009-09-141-1/+1
| | | | | | an overloaded function (template). llvm-svn: 81804
OpenPOWER on IntegriCloud