rjmccall added a comment.

In https://reviews.llvm.org/D53738#1277172, @ebevhan wrote:

> I want to float the idea again of adding an AST type to encapsulate an 
> arbitrary fixed-point semantic and using that as the 'common type' for binary 
> operations involving fixed-point types. This would enable 
> UsualArithmeticConversions to handle fixed-point types similarly to how it 
> does today (find the 'common' full precision type, implicitly cast the LHS 
> and RHS if necessary). There is one new thing that it would have to do; the 
> result after the operation should not be the full precision type, but rather 
> be casted to the operand type of highest rank. I don't think the existing 
> code in SemaExpr can handle the case of adding an implicit cast after the 
> operation. I don't think it should be hard to add, though.


I don't think we should add *types* just for this, but if you need to make a 
different kind of `BinaryOperator` that represents that the semantics aren't 
quite the same (the same way that the compound assignments have their own 
subclass), that seems natural to me.


Repository:
  rC Clang

https://reviews.llvm.org/D53738



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

Reply via email to