zahiraam marked 2 inline comments as done.
zahiraam added inline comments.

================
Comment at: clang/lib/CodeGen/CGExprComplex.cpp:896
+
+ComplexPairTy ComplexExprEmitter::EmitPromoted(const Expr *E) {
+  if (auto *BinOp = dyn_cast<BinaryOperator>(E->IgnoreParens())) {
----------------
rjmccall wrote:
> `EmitPromoted` should take the promotion type.
> 
> You are missing the logic in this file which handles *unpromoted* emission 
> (where you have a binary operator but the context wants an unpromoted value) 
> by recognizing that you need to do a promoted operation and then truncate.
Sorry but not sure what you mean here. A case where we don't want any promotion 
would be:

float _Complex add(float _Complex a, float _Complex b) {
  return a + b;
}

In this case, getPromotionType would return the null type and EmitBinOps would 
just go through the  "older" control path where there is no promotion.
Unless I misunderstood your comment?




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113107/new/

https://reviews.llvm.org/D113107

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to