[llvm-branch-commits] [llvm] [NFCI][IR] Add DataLayout-aware `isZeroValue`/`getNullValue` and `getZeroValue` APIs (PR #183208)

Alexander Richardson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Apr 27 14:55:30 PDT 2026


================
@@ -370,8 +392,11 @@ bool Constant::containsConstantExpression() const {
   return false;
 }
 
-/// Constructor to create a '0' constant of arbitrary type.
-Constant *Constant::getNullValue(Type *Ty) {
+Constant *Constant::getNullValue(Type *Ty, const DataLayout *DL) {
+  return getZeroValue(Ty);
+}
+
+Constant *Constant::getZeroValue(Type *Ty) {
----------------
arichardson wrote:

Add an optional `, const DataLayout *DL` parameter?

https://github.com/llvm/llvm-project/pull/183208


More information about the llvm-branch-commits mailing list