| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 59426
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)
I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.
llvm-svn: 59306
|
|
|
|
|
|
| |
candidates. Thanks to Chris for the review!
llvm-svn: 59260
|
|
|
|
|
|
|
|
|
|
| |
some more bullet-proofing/enhancements for tryEvaluate. This shouldn't
cause any behavior changes except for handling cases where we were
crashing before and being able to evaluate a few more cases in tryEvaluate.
This should settle the minor mess surrounding r59196.
llvm-svn: 59224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
little rude; I figure it's cleaner to just back this out now so
it doesn't get forgotten or mixed up with other checkins.
The modification to isICE is simply wrong; I've added a test that the
change to isICE breaks.
I'm pretty sure the modification to tryEvaluate is also wrong.
At the very least, there's some serious miscommunication going on here,
as this is going in exactly the opposite direction of r59105. My
understanding is that tryEvaluate is not supposed to care about side
effects. That said, a lot of the clients to tryEvaluate are
expecting it to enforce a no-side-effects policy, so we probably need
another method that provides that guarantee.
llvm-svn: 59212
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Evaluation of , operator used bogus assumption that LHS could be
evaluated as an integral expression even though its type is
unspecified.
This change is making isICE very permissive of the LHS in non-evaluated
contexts because it is not clear what predicate we would use to reject
code here. The standard didn't offer me any guidance; opinions?
llvm-svn: 59196
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functions for built-in operators, e.g., the builtin
bool operator==(int const*, int const*)
can be used for the expression "x1 == x2" given:
struct X {
operator int const*();
} x1, x2;
The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.
There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.
Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.
As part of this change, ImplicitCastExpr can now be an lvalue.
llvm-svn: 59148
|
|
|
|
|
|
| |
expressions, both of values and types.
llvm-svn: 59057
|
|
|
|
| |
llvm-svn: 59042
|
|
|
|
|
|
| |
'super'. Remove ObjCThis from PredefinedExpr
llvm-svn: 58698
|
|
|
|
|
|
| |
expression. Remove CXXThis from PredefinedExpr
llvm-svn: 58695
|
|
|
|
| |
llvm-svn: 58689
|
|
|
|
| |
llvm-svn: 58509
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of copy initialization. Other pieces of the puzzle:
- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).
We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.
llvm-svn: 58353
|
|
|
|
| |
llvm-svn: 58331
|
|
|
|
| |
llvm-svn: 58330
|
|
|
|
|
|
|
|
|
|
|
| |
- Do not allow expressions to ever have reference type
- Extend Expr::isLvalue to handle more cases where having written a
reference into the source implies that the expression is an lvalue
(e.g., function calls, C++ casts).
- Make GRExprEngine::VisitCall treat the call arguments as lvalues when
they are being bound to a reference parameter.
llvm-svn: 58306
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
| |
Stmt.h
- Implement child_begin() and child_end() for AsmStmt. Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement.
- Use ExprIterator for performing iteration over input/output operands.
llvm-svn: 58261
|
|
|
|
| |
llvm-svn: 58218
|
|
|
|
| |
llvm-svn: 58079
|
|
|
|
|
|
| |
CXXFieldDecl is referenced inside a method.
llvm-svn: 58000
|
|
|
|
|
|
|
|
|
| |
aren't trying to compare with address-space qualifiers (for now).
Clean up handing of DeclRefExprs in Expr::isLvalue and refactor part
of the check into a static DeclCanBeLvalue.
llvm-svn: 57980
|
|
|
|
| |
llvm-svn: 57941
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
- Sema::IsQualificationConversion determines whether we have a qualification
conversion.
- Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
performing an implicit conversion from the right-hand side to the type of
the left-hand side rather than checking based on the C notion of
"compatibility". We now rely on the implicit-conversion code to
determine whether the conversion can happen or
not. Sema::TryCopyInitialization has an ugly reference-related
hack to cope with the initialization of references, for now.
- When building DeclRefExprs, strip away the reference type, since
there are no expressions whose type is a reference. We'll need to
do this throughout Sema.
- Expr::isLvalue now permits functions to be lvalues in C++ (but not
in C).
llvm-svn: 57935
|
|
|
|
| |
llvm-svn: 57332
|
|
|
|
|
|
|
|
|
|
| |
- Modify BlockExpr to reference the BlockDecl.
This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).
Still some follow-up work to finish this (forthcoming).
llvm-svn: 57298
|
|
|
|
|
|
| |
commit actually introduced a regression, not fixed a bug.
llvm-svn: 57282
|
|
|
|
|
|
| |
SizeOfAlignOfTypeExpr. This bug was unmasked by recent changes to StmtIterator.
llvm-svn: 57273
|
|
|
|
|
|
|
| |
which is checking for something that can be inconsistent with
what we can constant fold.
llvm-svn: 57159
|
|
|
|
|
|
| |
interface into the constant folding interface.
llvm-svn: 57158
|
|
|
|
|
|
|
| |
__builtin_constant_p properly, and add some scaffolding for
FloatExprEvaluator to eventually handle huge_val and inf.
llvm-svn: 57152
|
|
|
|
|
|
| |
code.
llvm-svn: 57151
|
|
|
|
| |
llvm-svn: 57149
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Enabled for builtins which are always constant expressions
(__builtin_huge_val*, __builtin_inf*, __builtin_constant_p,
__builtin_classify_type, __builtin___CFStringMakeConstantString).
Added Builtin::Context::isConstantExpr.
- Currently overly simply interface which only works for builtins
whose constantexprness does not depend on their arguments.
CallExpr::isBuiltinConstantExpr now takes an ASTContext argument.
llvm-svn: 56983
|
|
|
|
|
|
| |
CompoundStmt*, and use the getBody() method to do the appropriate checking. This both removes the type-punning warnings in Expr.cpp and also makes BlockExpr have more consistency checks against modifications to its body (via StmtIterator).
llvm-svn: 56710
|
|
|
|
|
|
|
|
| |
BlockDeclRef exprs.
This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.
llvm-svn: 56652
|
|
|
|
|
|
|
| |
for type.
- PR2817
llvm-svn: 56482
|
|
|
|
|
|
|
|
| |
Block literals are now represented by the concrete BlockExpr class.
This is cleanup (removes a FIXME).
No functionality change.
llvm-svn: 56288
|
|
|
|
|
|
|
|
| |
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.
llvm-svn: 56257
|
|
|
|
| |
llvm-svn: 56093
|
|
|
|
|
|
| |
this weekend).
llvm-svn: 55862
|
|
|
|
| |
llvm-svn: 55768
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Highlights...
- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().
Next steps...
- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.
llvm-svn: 55710
|
|
|
|
|
|
|
|
|
| |
with correct width.
- PR2728.
Also, fix PR2727 test case.
llvm-svn: 55493
|
|
|
|
|
|
|
|
| |
- PR2727.
Also, fix warning in CodeGenTypes for new BlockPointer type.
llvm-svn: 55479
|
|
|
|
| |
llvm-svn: 55299
|
|
|
|
| |
llvm-svn: 55255
|
|
|
|
| |
llvm-svn: 55249
|
|
|
|
| |
llvm-svn: 55245
|