This revision was automatically updated to reflect the committed changes.
Closed by commit rGfd7a34186137: [Fixed Point] Move the compassign LHS type
correction a bit further down. NFCI. (authored by ebevhan).
Changed prior to commit:
https://reviews.llvm.org/D78294?vs=258033&id=258251#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78294/new/
https://reviews.llvm.org/D78294
Files:
clang/lib/Sema/SemaExpr.cpp
Index: clang/lib/Sema/SemaExpr.cpp
===================================================================
--- clang/lib/Sema/SemaExpr.cpp
+++ clang/lib/Sema/SemaExpr.cpp
@@ -13639,14 +13639,6 @@
if (ResultTy.isNull() || LHS.isInvalid() || RHS.isInvalid())
return ExprError();
- // The LHS is not converted to the result type for fixed-point compound
- // assignment as the common type is computed on demand. Reset the CompLHSTy
- // to the LHS type we would have gotten after unary conversions.
- if (!CompLHSTy.isNull() &&
- (LHS.get()->getType()->isFixedPointType() ||
- RHS.get()->getType()->isFixedPointType()))
- CompLHSTy = UsualUnaryConversions(LHS.get()).get()->getType();
-
if (ResultTy->isRealFloatingType() &&
(getLangOpts().getFPRoundingMode() != RoundingMode::NearestTiesToEven ||
getLangOpts().getFPExceptionMode() != LangOptions::FPE_Ignore))
@@ -13705,6 +13697,12 @@
OK = LHS.get()->getObjectKind();
}
+ // The LHS is not converted to the result type for fixed-point compound
+ // assignment as the common type is computed on demand. Reset the CompLHSTy
+ // to the LHS type we would have gotten after unary conversions.
+ if (CompResultTy->isFixedPointType())
+ CompLHSTy = UsualUnaryConversions(LHS.get()).get()->getType();
+
if (ConvertHalfVec)
return convertHalfVecBinOp(*this, LHS, RHS, Opc, ResultTy, VK, OK, true,
OpLoc, CurFPFeatures);
Index: clang/lib/Sema/SemaExpr.cpp
===================================================================
--- clang/lib/Sema/SemaExpr.cpp
+++ clang/lib/Sema/SemaExpr.cpp
@@ -13639,14 +13639,6 @@
if (ResultTy.isNull() || LHS.isInvalid() || RHS.isInvalid())
return ExprError();
- // The LHS is not converted to the result type for fixed-point compound
- // assignment as the common type is computed on demand. Reset the CompLHSTy
- // to the LHS type we would have gotten after unary conversions.
- if (!CompLHSTy.isNull() &&
- (LHS.get()->getType()->isFixedPointType() ||
- RHS.get()->getType()->isFixedPointType()))
- CompLHSTy = UsualUnaryConversions(LHS.get()).get()->getType();
-
if (ResultTy->isRealFloatingType() &&
(getLangOpts().getFPRoundingMode() != RoundingMode::NearestTiesToEven ||
getLangOpts().getFPExceptionMode() != LangOptions::FPE_Ignore))
@@ -13705,6 +13697,12 @@
OK = LHS.get()->getObjectKind();
}
+ // The LHS is not converted to the result type for fixed-point compound
+ // assignment as the common type is computed on demand. Reset the CompLHSTy
+ // to the LHS type we would have gotten after unary conversions.
+ if (CompResultTy->isFixedPointType())
+ CompLHSTy = UsualUnaryConversions(LHS.get()).get()->getType();
+
if (ConvertHalfVec)
return convertHalfVecBinOp(*this, LHS, RHS, Opc, ResultTy, VK, OK, true,
OpLoc, CurFPFeatures);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits