aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-09-16 07:58:15 +0200
committerGitHub <noreply@github.com>2025-09-16 07:58:15 +0200
commitc8b5b6e0a61a66a0a09798fdc6c91340a0718f0d (patch)
treebb29dfc07ebd7f55434461ef4c4690adcbd75527 /clang/lib/AST/ByteCode/Compiler.cpp
parentea9acc97f1fa8b430c74237968d06b2e60b0ccb1 (diff)
downloadllvm-c8b5b6e0a61a66a0a09798fdc6c91340a0718f0d.zip
llvm-c8b5b6e0a61a66a0a09798fdc6c91340a0718f0d.tar.gz
llvm-c8b5b6e0a61a66a0a09798fdc6c91340a0718f0d.tar.bz2
[clang][ExprConst] Reject unary vector shuffles (#158589)
This is not implemented at compile time and asserts in assertion builds, so reject it here. Fixed the coding style in `BuiltinShuffleVector` at the same time. Fixes #158471
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index cecdb7b..c9ce113 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -3986,6 +3986,10 @@ bool Compiler<Emitter>::VisitConvertVectorExpr(const ConvertVectorExpr *E) {
template <class Emitter>
bool Compiler<Emitter>::VisitShuffleVectorExpr(const ShuffleVectorExpr *E) {
+ // FIXME: Unary shuffle with mask not currently supported.
+ if (E->getNumSubExprs() == 2)
+ return this->emitInvalid(E);
+
assert(Initializing);
assert(E->getNumSubExprs() > 2);