[PATCH] D67252: [IR] CallBrInst: scan+update arg list when indirect dest list changes
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 09:58:10 PDT 2019
craig.topper added inline comments.
================
Comment at: llvm/include/llvm/IR/Instructions.h:4085
BasicBlock *getIndirectDest(unsigned i) const {
- return cast<BasicBlock>(*(&Op<-1>() - getNumIndirectDests() + i));
+ return cast_or_null<BasicBlock>(*(&Op<-1>() - getNumIndirectDests() + i));
}
----------------
Why is this change needed?
================
Comment at: llvm/lib/IR/Instructions.cpp:827
+ assert(getNumIndirectDests() > i && "IndirectDest # out of range for callbr");
+ if (BasicBlock *OldBB = getIndirectDest(i)) {
+ BlockAddress *Old = BlockAddress::get(OldBB);
----------------
When would this fail?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67252/new/
https://reviews.llvm.org/D67252
More information about the llvm-commits
mailing list