[PATCH] D156175: [clang][ConstExprEmitter] handle NullToPointer ImplicitCastExpr

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 15:31:51 PDT 2023


nickdesaulniers added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1131-1132
+    case CK_NullToPointer: {
+      if (llvm::Constant *C = Visit(subExpr, destType))
+        if (C->isNullValue())
+          return CGM.EmitNullConstant(destType);
----------------
FWIW, I would have thought these might be unnecessary, but we do trip 2 tests without these guards IIRC.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156175



More information about the cfe-commits mailing list