From faa5b39e4e06f5645638471a1f86091806916fc8 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 26 Sep 2019 10:56:07 +0000 Subject: PGOMemOPSizeOpt - silence static analyzer dyn_cast null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast directly and if not assert will fire for us. llvm-svn: 372959 --- llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp b/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp index ac78b4d993e..9f81bb16d0a 100644 --- a/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp +++ b/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp @@ -374,8 +374,8 @@ bool MemOPSizeOpt::perform(MemIntrinsic *MI) { Ctx, Twine("MemOP.Case.") + Twine(SizeId), &Func, DefaultBB); Instruction *NewInst = MI->clone(); // Fix the argument. - MemIntrinsic * MemI = dyn_cast(NewInst); - IntegerType *SizeType = dyn_cast(MemI->getLength()->getType()); + auto *MemI = cast(NewInst); + auto *SizeType = dyn_cast(MemI->getLength()->getType()); assert(SizeType && "Expected integer type size argument."); ConstantInt *CaseSizeId = ConstantInt::get(SizeType, SizeId); MemI->setLength(CaseSizeId); -- cgit v1.2.3