diff options
author | Tim Northover <tnorthover@apple.com> | 2014-02-12 12:04:59 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-02-12 12:04:59 +0000 |
commit | 3402dc7d52db844b9d77a3f32dbaee9f4f9d6069 (patch) | |
tree | 530d161067047706544483c8918947cd38888102 /clang/lib/Sema/SemaChecking.cpp | |
parent | e7f8cba892635db6b2be0a8c566075ec5f6767c8 (diff) | |
download | bcm5719-llvm-3402dc7d52db844b9d77a3f32dbaee9f4f9d6069.tar.gz bcm5719-llvm-3402dc7d52db844b9d77a3f32dbaee9f4f9d6069.zip |
ARM NEON: fix range checking on immediates.
Previously, range checking on the __builtin_neon_XYZ_v Clang intrinsics didn't
take account of the type actually passed to the call, which meant a request
like "vext_s16(a, b, 7)" was allowed through (TableGen was conservative and
allowed 0-7 for all types). This caused an assert in the backend because the
lane doesn't make sense.
llvm-svn: 201232
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 07f25c15faa..dfacba84efe 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -326,9 +326,9 @@ Sema::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } // Get the valid immediate range for the specified NEON type code. -static unsigned RFT(unsigned t, bool shift = false) { +static unsigned RFT(unsigned t, bool shift = false, bool ForceQuad = false) { NeonTypeFlags Type(t); - int IsQuad = Type.isQuad(); + int IsQuad = ForceQuad ? true : Type.isQuad(); switch (Type.getEltType()) { case NeonTypeFlags::Int8: case NeonTypeFlags::Poly8: |