From 0b68a825ac1a3af837b9bec4dcaadbd3e15ec4ce Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 22 Sep 2019 12:38:21 +0000 Subject: [PATCH] [Hexagon] Don't dereference dyn_cast result. NFCI. The static analyzer is warning about potential null dereference, but we should be able to use cast directly and if not assert will fire for us. llvm-svn: 372499 --- llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp index 605fcfc..4684d8e 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp @@ -697,7 +697,7 @@ void HexagonDAGToDAGISel::SelectIntrinsicWOChain(SDNode *N) { // void HexagonDAGToDAGISel::SelectConstantFP(SDNode *N) { SDLoc dl(N); - ConstantFPSDNode *CN = dyn_cast(N); + auto *CN = cast(N); APInt A = CN->getValueAPF().bitcastToAPInt(); if (N->getValueType(0) == MVT::f32) { SDValue V = CurDAG->getTargetConstant(A.getZExtValue(), dl, MVT::i32); -- 2.7.4