[clang] [clang][bytecode][NFC] Avoid classfiy calls in visitZeroRecordInitial… (PR #192676)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 07:50:29 PDT 2026


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

…izer

We already have the PrimType in the Descriptor.

>From 07fc768c1579ffc41b04ffdd4b1e5734cb99991a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Fri, 17 Apr 2026 16:49:11 +0200
Subject: [PATCH] [clang][bytecode][NFC] Avoid classfiy calls in
 visitZeroRecordInitializer

We already have the PrimType in the Descriptor.
---
 clang/lib/AST/ByteCode/Compiler.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 4714ea5aa8a43..329c11000054e 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4765,7 +4765,7 @@ bool Compiler<Emitter>::visitZeroRecordInitializer(const Record *R,
     const Descriptor *D = Field.Desc;
     if (D->isPrimitive()) {
       QualType QT = D->getType();
-      PrimType T = classifyPrim(D->getType());
+      PrimType T = D->getPrimType();
       if (!this->visitZeroInitializer(T, QT, E))
         return false;
       if (R->isUnion()) {
@@ -4783,7 +4783,7 @@ bool Compiler<Emitter>::visitZeroRecordInitializer(const Record *R,
 
     if (D->isPrimitiveArray()) {
       QualType ET = D->getElemQualType();
-      PrimType T = classifyPrim(ET);
+      PrimType T = D->getPrimType();
       for (uint32_t I = 0, N = D->getNumElems(); I != N; ++I) {
         if (!this->visitZeroInitializer(T, ET, E))
           return false;



More information about the cfe-commits mailing list