From d4bacd68bf7e8d30bfa0dc483f70600eaf58f40d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 Apr 2008 23:55:33 +0000 Subject: simplify max type computation by making it return an integer (like getFloatingTypeOrder) instead of a type. Fix a fixme. llvm-svn: 49297 --- clang/lib/Sema/SemaExpr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 73e075f7d6a..a661d0172bf 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1068,8 +1068,8 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, const ComplexType *rhsComplexInt = rhs->getAsComplexIntegerType(); if (lhsComplexInt && rhsComplexInt) { - if (Context.getMaxIntegerType(lhsComplexInt->getElementType(), - rhsComplexInt->getElementType()) == lhs) { + if (Context.getIntegerTypeOrder(lhsComplexInt->getElementType(), + rhsComplexInt->getElementType()) >= 0) { // convert the rhs if (!isCompAssign) ImpCastExprToType(rhsExpr, lhs); return lhs; @@ -1088,7 +1088,7 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, } } // Finally, we have two differing integer types. - if (Context.getMaxIntegerType(lhs, rhs) == lhs) { // convert the rhs + if (Context.getIntegerTypeOrder(lhs, rhs) >= 0) { // convert the rhs if (!isCompAssign) ImpCastExprToType(rhsExpr, lhs); return lhs; } -- cgit v1.2.3