[llvm] r372501 - AMDGPUPrintfRuntimeBinding - silence static analyzer null dereference warnings. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 22 06:01:49 PDT 2019
Author: rksimon
Date: Sun Sep 22 06:01:49 2019
New Revision: 372501
URL: http://llvm.org/viewvc/llvm-project?rev=372501&view=rev
Log:
AMDGPUPrintfRuntimeBinding - silence static analyzer null dereference warnings. NFCI.
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp?rev=372501&r1=372500&r2=372501&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp Sun Sep 22 06:01:49 2019
@@ -163,8 +163,7 @@ bool AMDGPUPrintfRuntimeBinding::lowerPr
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::lowerPr
// erase the printf calls
for (auto P : Printfs) {
- CallInst *CI = dyn_cast<CallInst>(P);
+ auto CI = cast<CallInst>(P);
CI->eraseFromParent();
}
More information about the llvm-commits
mailing list