[Hexagon] Don't dereference dyn_cast<ConstantFPSDNode> result. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 22 Sep 2019 12:38:21 +0000 (12:38 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 22 Sep 2019 12:38:21 +0000 (12:38 +0000)
The static analyzer is warning about potential null dereference, but we should be able to use cast<ConstantFPSDNode> directly and if not assert will fire for us.

llvm-svn: 372499

llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp

index 605fcfc..4684d8e 100644 (file)
@@ -697,7 +697,7 @@ void HexagonDAGToDAGISel::SelectIntrinsicWOChain(SDNode *N) {
 //
 void HexagonDAGToDAGISel::SelectConstantFP(SDNode *N) {
   SDLoc dl(N);
-  ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
+  auto *CN = cast<ConstantFPSDNode>(N);
   APInt A = CN->getValueAPF().bitcastToAPInt();
   if (N->getValueType(0) == MVT::f32) {
     SDValue V = CurDAG->getTargetConstant(A.getZExtValue(), dl, MVT::i32);