From: Simon Pilgrim Date: Tue, 24 Sep 2019 11:40:45 +0000 (+0000) Subject: [IR] IntrinsicInst - silence static analyzer dyn_cast<> null dereference warnings... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50c08575a36e8557a78a05ab551e4f0910ba113e;p=llvm [IR] IntrinsicInst - silence static analyzer dyn_cast<> null dereference warnings. 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372733 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/IntrinsicInst.cpp b/lib/IR/IntrinsicInst.cpp index a426c9b4df1..2996cfb5332 100644 --- a/lib/IR/IntrinsicInst.cpp +++ b/lib/IR/IntrinsicInst.cpp @@ -107,7 +107,7 @@ Optional ConstrainedFPIntrinsic::getRoundingMode() const { unsigned NumOperands = getNumArgOperands(); Metadata *MD = - dyn_cast(getArgOperand(NumOperands - 2))->getMetadata(); + cast(getArgOperand(NumOperands - 2))->getMetadata(); if (!MD || !isa(MD)) return None; return StrToRoundingMode(cast(MD)->getString()); @@ -153,7 +153,7 @@ Optional ConstrainedFPIntrinsic::getExceptionBehavior() const { unsigned NumOperands = getNumArgOperands(); Metadata *MD = - dyn_cast(getArgOperand(NumOperands - 1))->getMetadata(); + cast(getArgOperand(NumOperands - 1))->getMetadata(); if (!MD || !isa(MD)) return None; return StrToExceptionBehavior(cast(MD)->getString());