diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-13 14:31:03 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-13 15:07:56 +0000 |
commit | 40311f9724953541ab7b755fb6a96b31c1e63f00 (patch) | |
tree | 9e7f6bea6e515f89789bdb7d1d0e367244ec71d1 /clang/lib/AST/ASTContext.cpp | |
parent | 7af67259cdd66811941514a263dd0f81c491d8f1 (diff) | |
download | bcm5719-llvm-40311f9724953541ab7b755fb6a96b31c1e63f00.tar.gz bcm5719-llvm-40311f9724953541ab7b755fb6a96b31c1e63f00.zip |
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointers are always dereferenced and castAs will perform the null assertion for us.
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index d26e7f789d0..0b2d8b4d1e2 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -8707,8 +8707,8 @@ QualType ASTContext::mergeFunctionParameterTypes(QualType lhs, QualType rhs, QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, bool OfBlockPointer, bool Unqualified) { - const auto *lbase = lhs->getAs<FunctionType>(); - const auto *rbase = rhs->getAs<FunctionType>(); + const auto *lbase = lhs->castAs<FunctionType>(); + const auto *rbase = rhs->castAs<FunctionType>(); const auto *lproto = dyn_cast<FunctionProtoType>(lbase); const auto *rproto = dyn_cast<FunctionProtoType>(rbase); bool allLTypes = true; |