diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-11 15:33:25 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-11 16:02:23 +0000 |
| commit | 16c53ffcb9d040f0396bf1ab42ca366f7e1f1e4d (patch) | |
| tree | 7baa4582dae8a0ba3a419684306edeb0af922fb8 /clang/lib/CodeGen/CGExprScalar.cpp | |
| parent | ded237b58d56299f90ef44853ef79b039248b85e (diff) | |
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 4338d1c3dcdf..31487accf410 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -3835,8 +3835,7 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E, *SecondVecArg = RHS; QualType ElTy = LHSTy->castAs<VectorType>()->getElementType(); - const BuiltinType *BTy = ElTy->getAs<BuiltinType>(); - BuiltinType::Kind ElementKind = BTy->getKind(); + BuiltinType::Kind ElementKind = ElTy->castAs<BuiltinType>()->getKind(); switch(E->getOpcode()) { default: llvm_unreachable("is not a comparison operation"); |
