forked from OSchip/llvm-project
Fix "pointer is null" static analyzer warning. NFCI.
Use castAs<> instead of getAs<> since we know that the pointer will be valid (and is dereferenced immediately below).
This commit is contained in:
parent
bbbbf8a106
commit
5936717fa6
|
@ -96,7 +96,7 @@ llvm::PointerType *CGOpenCLRuntime::getSamplerType(const Type *T) {
|
|||
}
|
||||
|
||||
llvm::Value *CGOpenCLRuntime::getPipeElemSize(const Expr *PipeArg) {
|
||||
const PipeType *PipeTy = PipeArg->getType()->getAs<PipeType>();
|
||||
const PipeType *PipeTy = PipeArg->getType()->castAs<PipeType>();
|
||||
// The type of the last (implicit) argument to be passed.
|
||||
llvm::Type *Int32Ty = llvm::IntegerType::getInt32Ty(CGM.getLLVMContext());
|
||||
unsigned TypeSize = CGM.getContext()
|
||||
|
@ -106,7 +106,7 @@ llvm::Value *CGOpenCLRuntime::getPipeElemSize(const Expr *PipeArg) {
|
|||
}
|
||||
|
||||
llvm::Value *CGOpenCLRuntime::getPipeElemAlign(const Expr *PipeArg) {
|
||||
const PipeType *PipeTy = PipeArg->getType()->getAs<PipeType>();
|
||||
const PipeType *PipeTy = PipeArg->getType()->castAs<PipeType>();
|
||||
// The type of the last (implicit) argument to be passed.
|
||||
llvm::Type *Int32Ty = llvm::IntegerType::getInt32Ty(CGM.getLLVMContext());
|
||||
unsigned TypeSize = CGM.getContext()
|
||||
|
|
Loading…
Reference in New Issue