summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Some tweaks suggested by ArgirisDouglas Gregor2008-11-191-5/+5
| | | | llvm-svn: 59661
* Extend DeclarationName to support C++ overloaded operators, e.g.,Douglas Gregor2008-11-181-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | operator+, directly, using the same mechanism as all other special names. Removed the "special" identifiers for the overloaded operators from the identifier table and IdentifierInfo data structure. IdentifierInfo is back to representing only real identifiers. Added a new Action, ActOnOperatorFunctionIdExpr, that builds an expression from an parsed operator-function-id (e.g., "operator +"). ActOnIdentifierExpr used to do this job, but operator-function-ids are no longer represented by IdentifierInfo's. Extended Declarator to store overloaded operator names. Sema::GetNameForDeclarator now knows how to turn the operator name into a DeclarationName for the overloaded operator. Except for (perhaps) consolidating the functionality of ActOnIdentifier, ActOnOperatorFunctionIdExpr, and ActOnConversionFunctionExpr into a common routine that builds an appropriate DeclRefExpr by looking up a DeclarationName, all of the work on normalizing declaration names should be complete with this commit. llvm-svn: 59526
* Change a couple of the Parser::Diag methods to return DiagnosticInfoChris Lattner2008-11-181-9/+5
| | | | | | | | | and let the clients push whatever they want into the DiagnosticInfo instead of hard coding a few forms. Also switch various clients to use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the canonical form to simplify the code a bit. llvm-svn: 59509
* Updated IdentifierResolver to deal with DeclarationNames. The names ofDouglas Gregor2008-11-171-5/+9
| | | | | | | | | | | | | | | | | | | | | C++ constructors, destructors, and conversion functions now have a FETokenInfo field that IdentifierResolver can access, so that these special names are handled just like ordinary identifiers. A few other Sema routines now use DeclarationNames instead of IdentifierInfo*'s. To validate this design, this code also implements parsing and semantic analysis for id-expressions that name conversion functions, e.g., return operator bool(); The new parser action ActOnConversionFunctionExpr takes the result of parsing "operator type-id" and turning it into an expression, using the IdentifierResolver with the DeclarationName of the conversion function. ActOnDeclarator pushes those conversion function names into scope so that the IdentifierResolver can find them, of course. llvm-svn: 59462
* Some cleanups for C++ operator overloadingDouglas Gregor2008-11-171-11/+7
| | | | llvm-svn: 59443
* Implement C++ 'typeid' parsing and sema.Sebastian Redl2008-11-111-0/+48
| | | | llvm-svn: 59042
* Some cleanups to the declaration/checking of overloaded operators in C++. ↵Douglas Gregor2008-11-101-2/+2
| | | | | | Thanks to Sebastian for the review llvm-svn: 58986
* Implement support for C++ nested-name-specifiers ('foo::bar::x') in the ↵Argyrios Kyrtzidis2008-11-081-6/+159
| | | | | | | | Parser side. No Sema functionality change, just the signatures of the Action/Sema methods. llvm-svn: 58913
* Silence a gcc warning.Daniel Dunbar2008-11-081-1/+1
| | | | llvm-svn: 58888
* Parsing, ASTs, and semantic analysis for the declaration of conversionDouglas Gregor2008-11-071-0/+61
| | | | | | | | | | | | | functions in C++, e.g., struct X { operator bool() const; }; Note that these conversions don't actually do anything, since we don't yet have the ability to use them for implicit or explicit conversions. llvm-svn: 58860
* Assert that Parser::MaybeParseOperatorFunctionId is called when token is ↵Argyrios Kyrtzidis2008-11-071-3/+2
| | | | | | kw_operator, and replace ExpectAndConsume for the 'operator' token with a ConsumeToken. llvm-svn: 58855
* Parsing, ASTs, and semantic analysis for the declaration of overloadedDouglas Gregor2008-11-061-0/+75
| | | | | | | | | operators in C++. Overloaded operators can be called directly via their operator-function-ids, e.g., "operator+(foo, bar)", but we don't yet implement the semantics of operator overloading to handle, e.g., "foo + bar". llvm-svn: 58817
* Refactor the expression class hierarchy for casts. Most importantly:Douglas Gregor2008-10-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | - CastExpr is the root of all casts - ImplicitCastExpr is (still) used for all explicit casts - ExplicitCastExpr is now the root of all *explicit* casts - ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++ - CXXFunctionalCastExpr inherits from ExplicitCastExpr - CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all of the C++ named cast expression types (static_cast, dynamic_cast, etc.) - Added classes CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, and CXXConstCastExpr to Also, fixed returned-stack-addr.cpp, which broke once when we fixed reinterpret_cast to diagnose double->int* conversions and again when we eliminated implicit conversions to reference types. The fix is in both testcase and SemaChecking.cpp. Most of this patch is simply support for the renaming. There's very little actual change in semantics. llvm-svn: 58264
* Disambiguate between a declaration or expression for the 'condition' part of ↵Argyrios Kyrtzidis2008-10-051-1/+1
| | | | | | a if/switch/while/for statement. llvm-svn: 57109
* Implement parser support for the 'condition' part of C++ ↵Argyrios Kyrtzidis2008-09-091-0/+49
| | | | | | | | selection-statements and iteration-statements (if/switch/while/for). Add new 'ActOnCXXConditionDeclarationExpr' action, called when the 'condition' is a declaration instead of an expression. llvm-svn: 56007
* Add support for C++'s "type-specifier ( expression-list )" expression:Argyrios Kyrtzidis2008-08-221-0/+128
| | | | | | | | | | -The Parser calls a new "ActOnCXXTypeConstructExpr" action. -Sema, depending on the type and expressions number: -If the type is a class, it will treat it as a class constructor. [TODO] -If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node -If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node. llvm-svn: 55177
* Move handling of postfix-expression suffixes out of ParseCXXThis and into ↵Argyrios Kyrtzidis2008-08-161-6/+1
| | | | | | | | ParseCastExpression. No functionality change, this follows the convention of how postfix-expressions are handled. llvm-svn: 54849
* Add parsing support for C++ classes.Argyrios Kyrtzidis2008-06-241-0/+16
| | | | | | | Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place. Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass. llvm-svn: 52694
* minor simplificationChris Lattner2008-04-061-4/+2
| | | | llvm-svn: 49267
* finish up throw parsing.Chris Lattner2008-04-061-7/+15
| | | | llvm-svn: 49266
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+99
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud