[clang] [clang][bytecode][NFC] Use const auto* for Type cast result (PR #114405)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 06:54:35 PDT 2024


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

None

>From 8fc295989d876b32542860ca3ed73a7f8e6b42e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Thu, 31 Oct 2024 14:51:52 +0100
Subject: [PATCH] [clang][bytecode][NFC] Use const auto* for Type cast result

---
 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 0da518ec92afae..04e0b1884e3d6b 100644
--- a/clang/lib/AST/ByteCode/Program.cpp
+++ b/clang/lib/AST/ByteCode/Program.cpp
@@ -399,10 +399,10 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
   }
 
   // Arrays.
-  if (const auto ArrayType = Ty->getAsArrayTypeUnsafe()) {
+  if (const auto *ArrayType = Ty->getAsArrayTypeUnsafe()) {
     QualType ElemTy = ArrayType->getElementType();
     // Array of well-known bounds.
-    if (auto CAT = dyn_cast<ConstantArrayType>(ArrayType)) {
+    if (const auto *CAT = dyn_cast<ConstantArrayType>(ArrayType)) {
       size_t NumElems = CAT->getZExtSize();
       if (std::optional<PrimType> T = Ctx.classify(ElemTy)) {
         // Arrays of primitives.



More information about the cfe-commits mailing list