1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

AMDGPUPrintfRuntimeBinding - don't dereference a dyn_cast<> pointer. NFCI.

We dereference the dyn_cast<> in all paths - use cast<> to silence the clang static analyzer warning.
This commit is contained in:
Simon Pilgrim 2021-01-28 12:38:30 +00:00
parent 3d244dcde9
commit 5fc2b65dfd

View File

@ -356,8 +356,7 @@ bool AMDGPUPrintfRuntimeBindingImpl::lowerPrintfForGpu(Module &M) {
//
ConstantPointerNull *zeroIntPtr =
ConstantPointerNull::get(PointerType::get(Type::getInt8Ty(Ctx), 1));
ICmpInst *cmp =
dyn_cast<ICmpInst>(Builder.CreateICmpNE(pcall, zeroIntPtr, ""));
auto *cmp = cast<ICmpInst>(Builder.CreateICmpNE(pcall, zeroIntPtr, ""));
if (!CI->use_empty()) {
Value *result =
Builder.CreateSExt(Builder.CreateNot(cmp), I32Ty, "printf_res");