[PATCH] D80044: AllocaInst should store Align instead of MaybeAlign.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 21:54:17 PDT 2020


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

Maybe split the one part off but everything LGTM.



================
Comment at: llvm/lib/AsmParser/LLParser.cpp:7071
+  SmallPtrSet<Type *, 4> Visited;
+  if (!Alignment && !Ty->isSized(&Visited))
     return Error(ExplicitTypeLoc, "loading unsized types is not allowed");
----------------
efriedma wrote:
> I guess it's worth briefly noting what this is about: if isSized is passed a SmallPtrSet, it uses that set to catch infinitely recursive types (for example, a struct that has itself as a member).  Otherwise, it just crashes on such types.
> 
> An existing test for alloca caught this, so while I was here I extended the same check to load/store.
LGTM for committing this separately. I guess it would be perfect if you could add a test as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80044





More information about the llvm-commits mailing list