[PATCH] D133648: Clang, increase upper bound of partially initialized array sizes

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 14:13:39 PDT 2022


efriedma added inline comments.


================
Comment at: clang/lib/Sema/SemaInit.cpp:866
         ElementEntity.getKind() == InitializedEntity::EK_VectorElement)
       ElementEntity.setElementIndex(Init);
 
----------------
shafik wrote:
> `setElementIndex(...)` takes `unsigned` as well and therefore `InitializedEntity` also uses `unsigned`.
> 
> I briefly looked at this with another bug https://github.com/llvm/llvm-project/issues/57317
> 
> and I believe the 32 bit assumption is made in a lot of this code in this area. 
You don't need to solve everything at once...


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:3167
   // Print the fields in successive locations. Pad to align if needed!
-  unsigned Size = DL.getTypeAllocSize(CS->getType());
+  uint64_t Size = DL.getTypeAllocSize(CS->getType());
   const StructLayout *Layout = DL.getStructLayout(CS->getType());
----------------
Can you split this into a separate patch (with an appropriate testcase)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133648/new/

https://reviews.llvm.org/D133648



More information about the llvm-commits mailing list