AMDGPUPrintfRuntimeBinding - silence static analyzer null dereference warnings. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 22 Sep 2019 13:01:49 +0000 (13:01 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 22 Sep 2019 13:01:49 +0000 (13:01 +0000)
llvm-svn: 372501

llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp

index 90ea246..261d628 100644 (file)
@@ -163,8 +163,7 @@ bool AMDGPUPrintfRuntimeBinding::lowerPrintfForGpu(
   const char NonLiteralStr[4] = "???";
 
   for (auto P : Printfs) {
-    CallInst *CI = dyn_cast<CallInst>(P);
-
+    auto CI = cast<CallInst>(P);
     unsigned NumOps = CI->getNumArgOperands();
 
     SmallString<16> OpConvSpecifiers;
@@ -566,7 +565,7 @@ bool AMDGPUPrintfRuntimeBinding::lowerPrintfForGpu(
 
   // erase the printf calls
   for (auto P : Printfs) {
-    CallInst *CI = dyn_cast<CallInst>(P);
+    auto CI = cast<CallInst>(P);
     CI->eraseFromParent();
   }