[llvm] r372746 - [Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 05:43:55 PDT 2019


Author: rksimon
Date: Tue Sep 24 05:43:55 2019
New Revision: 372746

URL: http://llvm.org/viewvc/llvm-project?rev=372746&view=rev
Log:
[Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.

Modified:
    llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp

Modified: llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp?rev=372746&r1=372745&r2=372746&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp Tue Sep 24 05:43:55 2019
@@ -68,7 +68,7 @@ CtorDtorIterator::Element CtorDtorIterat
     }
   }
 
-  ConstantInt *Priority = dyn_cast<ConstantInt>(CS->getOperand(0));
+  auto *Priority = cast<ConstantInt>(CS->getOperand(0));
   Value *Data = CS->getNumOperands() == 3 ? CS->getOperand(2) : nullptr;
   if (Data && !isa<GlobalValue>(Data))
     Data = nullptr;




More information about the llvm-commits mailing list