diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-04-07 05:30:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-04-07 05:30:13 +0000 |
| commit | 2a3569b5d95e1c34379914818a339db36ce7a4d8 (patch) | |
| tree | 6ac87ab4b6af6ed65ffef92a4b7e79a0d3170ee0 /clang/lib/Sema/SemaExpr.cpp | |
| parent | ae947fe3f9a96ee762fb7188be6b9a8efad95aaa (diff) | |
| download | bcm5719-llvm-2a3569b5d95e1c34379914818a339db36ce7a4d8.tar.gz bcm5719-llvm-2a3569b5d95e1c34379914818a339db36ce7a4d8.zip | |
move ObjCQualifiedIdTypesAreCompatible out of ASTContext into Sema.
While it is similar to the other compatibility predicates in ASTContext,
it is not used by them and is different.
In addition, greatly simplify ObjCQualifiedIdTypesAreCompatible and
fix some canonical type bugs. Also, simplify my Type::getAsObjC* methods.
llvm-svn: 49313
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index a661d0172bf..a528519d265 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1185,9 +1185,8 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) { return Incompatible; } - if (lhsType->isObjCQualifiedIdType() - || rhsType->isObjCQualifiedIdType()) { - if (Context.ObjCQualifiedIdTypesAreCompatible(lhsType, rhsType)) + if (lhsType->isObjCQualifiedIdType() || rhsType->isObjCQualifiedIdType()) { + if (ObjCQualifiedIdTypesAreCompatible(lhsType, rhsType, false)) return Compatible; return Incompatible; } @@ -1368,9 +1367,9 @@ inline QualType Sema::CheckAdditionOperands( // C99 6.5.6 return InvalidOperands(loc, lex, rex); } -inline QualType Sema::CheckSubtractionOperands( // C99 6.5.6 - Expr *&lex, Expr *&rex, SourceLocation loc, bool isCompAssign) -{ +// C99 6.5.6 +QualType Sema::CheckSubtractionOperands(Expr *&lex, Expr *&rex, + SourceLocation loc, bool isCompAssign) { if (lex->getType()->isVectorType() || rex->getType()->isVectorType()) return CheckVectorOperands(loc, lex, rex); @@ -1437,8 +1436,9 @@ inline QualType Sema::CheckSubtractionOperands( // C99 6.5.6 return InvalidOperands(loc, lex, rex); } -inline QualType Sema::CheckShiftOperands( // C99 6.5.7 - Expr *&lex, Expr *&rex, SourceLocation loc, bool isCompAssign) { +// C99 6.5.7 +QualType Sema::CheckShiftOperands(Expr *&lex, Expr *&rex, SourceLocation loc, + bool isCompAssign) { // C99 6.5.7p2: Each of the operands shall have integer type. if (!lex->getType()->isIntegerType() || !rex->getType()->isIntegerType()) return InvalidOperands(loc, lex, rex); @@ -1453,9 +1453,9 @@ inline QualType Sema::CheckShiftOperands( // C99 6.5.7 return lex->getType(); } -inline QualType Sema::CheckCompareOperands( // C99 6.5.8 - Expr *&lex, Expr *&rex, SourceLocation loc, bool isRelational) -{ +// C99 6.5.8 +QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation loc, + bool isRelational) { // C99 6.5.8p3 / C99 6.5.9p4 if (lex->getType()->isArithmeticType() && rex->getType()->isArithmeticType()) UsualArithmeticConversions(lex, rex); @@ -1514,7 +1514,7 @@ inline QualType Sema::CheckCompareOperands( // C99 6.5.8 return Context.IntTy; } if ((lType->isObjCQualifiedIdType() || rType->isObjCQualifiedIdType()) - && Context.ObjCQualifiedIdTypesAreCompatible(lType, rType, true)) { + && ObjCQualifiedIdTypesAreCompatible(lType, rType, true)) { ImpCastExprToType(rex, lType); return Context.IntTy; } |

