diff options
author | John McCall <rjmccall@apple.com> | 2010-11-18 19:01:18 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-18 19:01:18 +0000 |
commit | 0943168ac126b8047f30f6bd215fbe7db14d61ba (patch) | |
tree | d4e607bc4eb0ea16a0398f41710e50ef3954e53c /include | |
parent | f4bed3f768a1effac21f3089f4c05f9ab9c37fe3 (diff) |
Add an assertion, fix a whole bunch of bugs, comment the assertion
out because there are still bugs left.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/Expr.h | 12 | ||||
-rw-r--r-- | include/clang/AST/ExprCXX.h | 2 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 21 |
3 files changed, 12 insertions, 23 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 20fd7905eb..2ffaeb55cb 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -267,7 +267,10 @@ public: /// give its value kind. static ExprValueKind getValueKindForType(QualType T) { if (const ReferenceType *RT = T->getAs<ReferenceType>()) - return isa<LValueReferenceType>(RT) ? VK_LValue : VK_XValue; + return (isa<LValueReferenceType>(RT) + ? VK_LValue + : (RT->getPointeeType()->isFunctionType() + ? VK_LValue : VK_XValue)); return VK_RValue; } @@ -2455,8 +2458,8 @@ class ConditionalOperator : public Expr { public: ConditionalOperator(Expr *cond, SourceLocation QLoc, Expr *lhs, SourceLocation CLoc, Expr *rhs, Expr *save, - QualType t, ExprValueKind VK) - : Expr(ConditionalOperatorClass, t, VK, OK_Ordinary, + QualType t, ExprValueKind VK, ExprObjectKind OK) + : Expr(ConditionalOperatorClass, t, VK, OK, // FIXME: the type of the conditional operator doesn't // depend on the type of the conditional, but the standard // seems to imply that it could. File a bug! @@ -3422,7 +3425,8 @@ class ExtVectorElementExpr : public Expr { public: ExtVectorElementExpr(QualType ty, ExprValueKind VK, Expr *base, IdentifierInfo &accessor, SourceLocation loc) - : Expr(ExtVectorElementExprClass, ty, VK, OK_VectorComponent, + : Expr(ExtVectorElementExprClass, ty, VK, + (VK == VK_RValue ? OK_Ordinary : OK_VectorComponent), base->isTypeDependent(), base->isValueDependent()), Base(base), Accessor(&accessor), AccessorLoc(loc) {} diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index a1d464e6fd..5c333f818b 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -423,7 +423,7 @@ public: Operand(Operand), Range(R) { } CXXUuidofExpr(QualType Ty, Expr *Operand, SourceRange R) - : Expr(CXXUuidofExprClass, Ty, /*FIXME*/ VK_LValue, OK_Ordinary, + : Expr(CXXUuidofExprClass, Ty, VK_RValue, OK_Ordinary, false, Operand->isTypeDependent()), Operand(Operand), Range(R) { } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index aa3d790b8e..1790351f63 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -4204,14 +4204,12 @@ public: void ConvertPropertyAssignment(Expr *LHS, Expr *&RHS, QualType& LHSTy); - QualType CheckCommaOperands( // C99 6.5.17 - Expr *lex, Expr *&rex, SourceLocation OpLoc); QualType CheckConditionalOperands( // C99 6.5.15 Expr *&cond, Expr *&lhs, Expr *&rhs, Expr *&save, - ExprValueKind &VK, SourceLocation questionLoc); + ExprValueKind &VK, ExprObjectKind &OK, SourceLocation questionLoc); QualType CXXCheckConditionalOperands( // C++ 5.16 - Expr *&cond, Expr *&lhs, Expr *&rhs, Expr *&save, ExprValueKind &VK, - SourceLocation questionLoc); + Expr *&cond, Expr *&lhs, Expr *&rhs, Expr *&save, + ExprValueKind &VK, ExprObjectKind &OK, SourceLocation questionLoc); QualType FindCompositePointerType(SourceLocation Loc, Expr *&E1, Expr *&E2, bool *NonStandardCompositeType = 0); @@ -4223,19 +4221,6 @@ public: QualType CheckVectorCompareOperands(Expr *&lex, Expr *&rx, SourceLocation l, bool isRel); - /// type checking unary operators (subroutines of ActOnUnaryOp). - /// C99 6.5.3.1, 6.5.3.2, 6.5.3.4 - QualType CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc, - bool isInc, bool isPrefix); - QualType CheckAddressOfOperand(Expr *op, SourceLocation OpLoc); - QualType CheckIndirectionOperand(Expr *op, SourceLocation OpLoc); - QualType CheckRealImagOperand(Expr *&Op, SourceLocation OpLoc, bool isReal); - - /// type checking primary expressions. - QualType CheckExtVectorComponent(QualType baseType, SourceLocation OpLoc, - const IdentifierInfo *Comp, - SourceLocation CmpLoc); - /// type checking declaration initializers (C99 6.7.8) bool CheckInitList(const InitializedEntity &Entity, InitListExpr *&InitList, QualType &DeclType); |