================
@@ -1083,21 +1083,21 @@ bool Compiler<Emitter>::VisitPointerArithBinOp(const
BinaryOperator *E) {
if (Op == BO_Add) {
if (!this->emitAddOffset(OffsetType, E))
return false;
-
- if (classifyPrim(E) != PT_Ptr)
- return this->emitDecayPtr(PT_Ptr, classifyPrim(E), E);
- return true;
- }
- if (Op == BO_Sub) {
+ } else if (Op == BO_Sub) {
if (!this->emitSubOffset(OffsetType, E))
return false;
+ } else {
+ return false;
+ }
----------------
ojhunt wrote:
is it worth changing this to a switch? Not because there are many options but
because it makes it structurally clearer that this is an either/or case?
https://github.com/llvm/llvm-project/pull/176555
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits