diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-07-08 02:17:35 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-07-08 02:17:35 +0000 |
commit | f2f1a099a767b0faab70079cc00aab3a17ab853c (patch) | |
tree | 74e533c1ffd75cb0dd1f86bf920a678d32b8bd6f /clang/lib/CodeGen/CGExpr.cpp | |
parent | 4ac8e93a4e45d89f8416d48d21712e6393b1093b (diff) | |
download | bcm5719-llvm-f2f1a099a767b0faab70079cc00aab3a17ab853c.tar.gz bcm5719-llvm-f2f1a099a767b0faab70079cc00aab3a17ab853c.zip |
[CodeGen] Use llvm::Type::getVectorNumElements instead of casting to llvm::VectorType and calling getNumElements. This is equivalent and shorter.
llvm-svn: 274823
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 50fbadfff12..3e1ae3604f9 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1758,8 +1758,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, if (const VectorType *VTy = Dst.getType()->getAs<VectorType>()) { unsigned NumSrcElts = VTy->getNumElements(); - unsigned NumDstElts = - cast<llvm::VectorType>(Vec->getType())->getNumElements(); + unsigned NumDstElts = Vec->getType()->getVectorNumElements(); if (NumDstElts == NumSrcElts) { // Use shuffle vector is the src and destination are the same number of // elements and restore the vector mask since it is on the side it will be |