[PATCH] D133648: Clang, increase upper bound of partially initialized array sizes
    Ofek Shochat via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 14 02:22:54 PDT 2022
    
    
  
OfekShochat marked an inline comment as done.
OfekShochat added a comment.
I created a diff for the AsmPrinter part, its at D133845 <https://reviews.llvm.org/D133845>
================
Comment at: clang/lib/Sema/SemaInit.cpp:866
         ElementEntity.getKind() == InitializedEntity::EK_VectorElement)
       ElementEntity.setElementIndex(Init);
 
----------------
efriedma wrote:
> 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...
oh, right, should I change that after I split the diff in AsmPrinter to another patch?
================
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());
----------------
efriedma wrote:
> Can you split this into a separate patch (with an appropriate testcase)?
yep
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