[clang] [clang][bytecode][NFC] Return nullptr instead of {} (PR #176912)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 20 04:14:45 PST 2026


https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/176912

None

>From 046add5c2520c37c5f3c70480f92d50e9e268073 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Tue, 20 Jan 2026 13:10:31 +0100
Subject: [PATCH] [clang][bytecode][NFC] Return nullptr instead of {}

---
 clang/lib/AST/ByteCode/Program.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Program.cpp b/clang/lib/AST/ByteCode/Program.cpp
index d038c30d1ef82..76fec63a8920d 100644
--- a/clang/lib/AST/ByteCode/Program.cpp
+++ b/clang/lib/AST/ByteCode/Program.cpp
@@ -412,7 +412,7 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
         // Arrays of primitives.
         unsigned ElemSize = primSize(*T);
         if ((Descriptor::MaxArrayElemBytes / ElemSize) < NumElems) {
-          return {};
+          return nullptr;
         }
         return allocateDescriptor(D, *T, MDSize, NumElems, IsConst, IsTemporary,
                                   IsMutable);
@@ -425,7 +425,7 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
           return nullptr;
         unsigned ElemSize = ElemDesc->getAllocSize() + sizeof(InlineDescriptor);
         if (std::numeric_limits<unsigned>::max() / ElemSize <= NumElems)
-          return {};
+          return nullptr;
         return allocateDescriptor(D, Ty, ElemDesc, MDSize, NumElems, IsConst,
                                   IsTemporary, IsMutable);
     }



More information about the cfe-commits mailing list