summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-13 14:31:03 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-13 15:07:56 +0000
commit40311f9724953541ab7b755fb6a96b31c1e63f00 (patch)
tree9e7f6bea6e515f89789bdb7d1d0e367244ec71d1 /clang/lib/AST/ASTContext.cpp
parent7af67259cdd66811941514a263dd0f81c491d8f1 (diff)
downloadbcm5719-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.cpp4
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;
OpenPOWER on IntegriCloud