rjmccall added inline comments.

================
Comment at: lib/CodeGen/CGExprConstant.cpp:1395
 
+static bool isZeroInitializer(ConstantEmitter &CE, const Expr *Init) {
+  QualType InitTy = Init->getType().getCanonicalType();
----------------
You should have a comment here clarifying that this is checking whether the 
initializer is equivalent to a C++ zero initialization, not checking whether 
the initializer produces a zero bit-pattern.


================
Comment at: lib/CodeGen/CGExprConstant.cpp:1414
+      return true;
+    }
+  }
----------------
You should check the array fill expression here; for now, the test case would 
be something like `StructWithNonTrivialDefaultInit sArr[10] = {};`.


================
Comment at: lib/CodeGen/CGExprConstant.cpp:1415
+    }
+  }
+  return false;
----------------
I would suggest doing your primary switch over the form of Init instead of its 
type, and you can just have an isIntegerConstantExpr check at the end.

You should also check for a null pointer expression.


Repository:
  rC Clang

https://reviews.llvm.org/D46241



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

Reply via email to