From a545c7f4a10ff4a90fcdcbbff2b1e06e397ff2e1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 6 Jan 2023 15:43:02 +0100 Subject: [PATCH] [IR] Use isEntryBlock() API (NFC) --- llvm/lib/IR/Instructions.cpp | 2 +- llvm/lib/IR/Verifier.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index d1d7e14454a4..b5575260cab1 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -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(); } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index e4948b1d8280..0067491d9511 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -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()) {