diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-15 16:40:20 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-16 13:02:40 +0000 |
| commit | 19c5057e8df62e75b26e881dfc8f8f32686fe75c (patch) | |
| tree | 5bd7d47bfc8a06b24c5db0a531296e27573a4874 /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 39d6b6c21f744e9c2503aa267a2561032de1326c (diff) | |
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 038078bbe88d..feb8d000eca3 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1357,7 +1357,7 @@ void CodeGenModule::GenOpenCLArgMetadata(llvm::Function *Fn, std::string typeName; if (isPipe) typeName = ty.getCanonicalType() - ->getAs<PipeType>() + ->castAs<PipeType>() ->getElementType() .getAsString(Policy); else @@ -1371,7 +1371,7 @@ void CodeGenModule::GenOpenCLArgMetadata(llvm::Function *Fn, std::string baseTypeName; if (isPipe) baseTypeName = ty.getCanonicalType() - ->getAs<PipeType>() + ->castAs<PipeType>() ->getElementType() .getCanonicalType() .getAsString(Policy); |
