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

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 08:37:57 PDT 2024


Author: Timm Baeder
Date: 2024-10-31T16:37:53+01:00
New Revision: 05910b44c987084d53d39c40237a0dfa9804b48e

URL: https://github.com/llvm/llvm-project/commit/05910b44c987084d53d39c40237a0dfa9804b48e
DIFF: https://github.com/llvm/llvm-project/commit/05910b44c987084d53d39c40237a0dfa9804b48e.diff

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

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Program.cpp

Removed: 
    


################################################################################
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