[PATCH] D83829: [IR] Add a few asserts to provide a better failure signature if you try to create a load/store/alloca with no alignment or insertion position

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 16:29:20 PDT 2020


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

LGTM with one minor comment



================
Comment at: llvm/lib/IR/Instructions.cpp:1265
 static Align computeAllocaDefaultAlign(Type *Ty, BasicBlock *BB) {
+  assert(BB && "Insertion BB cannot be null when alignment not provided!");
   const DataLayout &DL = BB->getModule()->getDataLayout();
----------------
Maybe also assert BB->getParent() is non-null?  Someone mentioned an issue in some downstream code where the function was null.


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

https://reviews.llvm.org/D83829





More information about the llvm-commits mailing list