[all-commits] [llvm/llvm-project] 28ddbd: [NFC] Refactor ConstantArrayType size storage (#85...

Chris B via All-commits all-commits at lists.llvm.org
Tue Mar 26 12:16:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28ddbd4a863c4c1b6c36deb6edf305ee93412cd4
      https://github.com/llvm/llvm-project/commit/28ddbd4a863c4c1b6c36deb6edf305ee93412cd4
  Author: Chris B <chris.bieneman at me.com>
  Date:   2024-03-26 (Tue, 26 Mar 2024)

  Changed paths:
    M clang/include/clang/AST/Type.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/AST/Interp/ByteCodeExprGen.cpp
    M clang/lib/AST/Interp/EvaluationResult.cpp
    M clang/lib/AST/Interp/Program.cpp
    M clang/lib/AST/JSONNodeDumper.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/AST/ScanfFormatString.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/AST/TypePrinter.cpp
    M clang/lib/Analysis/CFG.cpp
    M clang/lib/Analysis/UnsafeBufferUsage.cpp
    M clang/lib/CodeGen/ABIInfo.cpp
    M clang/lib/CodeGen/ABIInfoImpl.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGExprCXX.cpp
    M clang/lib/CodeGen/CGExprConstant.cpp
    M clang/lib/CodeGen/CGObjCMac.cpp
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenTypes.cpp
    M clang/lib/CodeGen/SwiftCallingConv.cpp
    M clang/lib/CodeGen/Targets/ARM.cpp
    M clang/lib/CodeGen/Targets/LoongArch.cpp
    M clang/lib/CodeGen/Targets/RISCV.cpp
    M clang/lib/CodeGen/Targets/X86.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaInit.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/SemaSYCL.cpp
    M clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
    M clang/lib/StaticAnalyzer/Core/MemRegion.cpp
    M clang/lib/StaticAnalyzer/Core/RegionStore.cpp

  Log Message:
  -----------
  [NFC] Refactor ConstantArrayType size storage (#85716)

In PR #79382, I need to add a new type that derives from
ConstantArrayType. This means that ConstantArrayType can no longer use
`llvm::TrailingObjects` to store the trailing optional Expr*.

This change refactors ConstantArrayType to store a 60-bit integer and
4-bits for the integer size in bytes. This replaces the APInt field
previously in the type but preserves enough information to recreate it
where needed.

To reduce the number of places where the APInt is re-constructed I've
also added some helper methods to the ConstantArrayType to allow some
common use cases that operate on either the stored small integer or the
APInt as appropriate.

Resolves #85124.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list