[IR] Use isEntryBlock() API (NFC)

This commit is contained in:
Nikita Popov 2023-01-06 15:43:02 +01:00
parent a6a526ec54
commit a545c7f4a1
2 changed files with 3 additions and 3 deletions

View File

@ -1519,7 +1519,7 @@ bool AllocaInst::isStaticAlloca() const {
// Must be in the entry block.
const BasicBlock *Parent = getParent();
return Parent == &Parent->getParent()->front() && !isUsedWithInAlloca();
return Parent->isEntryBlock() && !isUsedWithInAlloca();
}
//===----------------------------------------------------------------------===//

View File

@ -5250,8 +5250,8 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
break;
case Intrinsic::localescape: {
BasicBlock *BB = Call.getParent();
Check(BB == &BB->getParent()->front(),
"llvm.localescape used outside of entry block", Call);
Check(BB->isEntryBlock(), "llvm.localescape used outside of entry block",
Call);
Check(!SawFrameEscape, "multiple calls to llvm.localescape in one function",
Call);
for (Value *Arg : Call.args()) {