| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
shorter and more accurate. The type name might not be qualified.
llvm-svn: 61788
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).
llvm-svn: 61746
|
| |
|
|
|
|
| |
isn't worth the complexity and the code already does a ton of lookahead.
llvm-svn: 61671
|
| |
|
|
|
|
|
| |
only be called when they might be needed now, so make them assert
that their current token is :: or identifier.
llvm-svn: 61662
|
| |
|
|
| |
llvm-svn: 61654
|
| |
|
|
|
|
|
| |
sure to pass it down. This makes the code a bit gross, I will clean
it up in subsequent commits.
llvm-svn: 61650
|
| |
|
|
|
|
|
|
| |
ParseCastExpression into the switch. This gets it out of the hot
path through ParseCastExpression for all the non-identifier and
non-:: tokens.
llvm-svn: 61643
|
| |
|
|
| |
llvm-svn: 61641
|
| |
|
|
| |
llvm-svn: 61638
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DeclContext. Instead, just keep the list of currently-active
declarations and only build the OverloadedFunctionDecl when we
absolutely need it.
This is a half-step toward eliminating the need to explicitly build
OverloadedFunctionDecls that store sets of overloaded
functions. This was suggested by Argiris a while back, and it's a good
thing for several reasons: first, it eliminates the messy logic that
currently tries to keep the OverloadedFunctionDecl in sync with the
declarations that are being added. Second, it will (eventually)
eliminate the need to allocate memory for overload sets, which could
help performance. Finally, it helps set us up for when name lookup can
return multiple (possibly ambiguous) results, as can happen with
lookup of class members in C++.
Next steps: make the IdentifierResolver store overloads as separate
entries in its list rather than replacing them with an
OverloadedFunctionDecl now, then see how far we can go toward
eliminating OverloadedFunctionDecl entirely.
llvm-svn: 61357
|
| |
|
|
|
|
| |
connection.
llvm-svn: 60982
|
| |
|
|
| |
llvm-svn: 60961
|
| |
|
|
| |
llvm-svn: 60928
|
| |
|
|
| |
llvm-svn: 60906
|
| |
|
|
| |
llvm-svn: 60904
|
| |
|
|
| |
llvm-svn: 60900
|
| |
|
|
| |
llvm-svn: 60888
|
| |
|
|
|
|
| |
explicitly calling EnterScope/ExitScope
llvm-svn: 60830
|
| |
|
|
|
|
| |
Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers.
llvm-svn: 60809
|
| |
|
|
| |
llvm-svn: 60791
|
| |
|
|
|
|
| |
variables.
llvm-svn: 60761
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
template<typename T> void f(T x) {
g(x); // g is a dependent name, so don't even bother to look it up
g(); // error: g is not a dependent name
}
Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.
GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.
llvm-svn: 60618
|
| |
|
|
| |
llvm-svn: 60423
|
| |
|
|
| |
llvm-svn: 60421
|
| |
|
|
| |
llvm-svn: 60235
|
| |
|
|
| |
llvm-svn: 60119
|
| |
|
|
|
|
| |
AST nodes in the parser in most cases, even on error.
llvm-svn: 60057
|
| |
|
|
| |
llvm-svn: 59921
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:
Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')
instead of:
Line 10: duplicate interface declaration for category 'MyClass1(Category1)'
I will fix this in a follow-up commit.
As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.
llvm-svn: 59917
|
| |
|
|
|
|
| |
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.
llvm-svn: 59835
|
| |
|
|
|
|
|
|
|
| |
built-in operator candidates. Test overloading of '&' and ','.
In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.
llvm-svn: 59643
|
| |
|
|
|
|
| |
The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic).
llvm-svn: 59639
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
post-decrement, including support for generating all of the built-in
operator candidates for these operators.
C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.
In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.
llvm-svn: 59638
|
| |
|
|
| |
llvm-svn: 59603
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
expressions, both of values and types.
llvm-svn: 59057
|
| |
|
|
| |
llvm-svn: 59042
|
| |
|
|
|
|
|
|
| |
Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.
llvm-svn: 58913
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.
The other kinds of overloadable operators in C++ will follow this same
approach.
Three major issues remain:
1) We don't find member operators
2) Since we don't have user-defined conversion operators, we can't
call any of the built-in overloaded operators in C++ [over.built].
3) Once we've done the semantic checks, we drop the overloaded
operator on the floor; it doesn't get into the AST at all.
llvm-svn: 58821
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 58802
|
| |
|
|
|
|
| |
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.
llvm-svn: 58120
|
| |
|
|
| |
llvm-svn: 57806
|
| |
|
|
|
|
| |
unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.
llvm-svn: 57337
|
| |
|
|
|
|
|
|
|
| |
parentheses, e.g.:
sizeof(int()) -> "int()" is type-id
sizeof(int()+1) -> "int()+1" is expression.
llvm-svn: 57131
|
| |
|
|
|
|
|
|
| |
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.
llvm-svn: 56257
|
| |
|
|
|
|
| |
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier.
llvm-svn: 55495
|
| |
|
|
|
|
|
|
|
|
| |
-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
|
| |
|
|
| |
llvm-svn: 55082
|
| |
|
|
|
|
| |
Chris.
llvm-svn: 54952
|