aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-05-14 16:13:01 +0200
committerGitHub <noreply@github.com>2025-05-14 16:13:01 +0200
commit9ca8248a9173e7756fbeb7ec3562332639d36423 (patch)
treee5f7cf5b245360c453ae403b6b9f256692c8d371 /clang/lib/AST/ByteCode/Compiler.cpp
parentedc9d91ca4957e3a7b2e10848f3c71fae765fe07 (diff)
downloadllvm-9ca8248a9173e7756fbeb7ec3562332639d36423.zip
llvm-9ca8248a9173e7756fbeb7ec3562332639d36423.tar.gz
llvm-9ca8248a9173e7756fbeb7ec3562332639d36423.tar.bz2
[clang] Save ShuffleVectorExpr args as ConstantExpr (#139709)
The passed indices have to be constant integers anyway, which we verify before creating the ShuffleVectorExpr. Use the value we create there and save the indices using a ConstantExpr instead. This way, we don't have to evaluate the args every time we call getShuffleMaskIdx().
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 3d1311a..67b6ae4 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -3883,7 +3883,7 @@ bool Compiler<Emitter>::VisitShuffleVectorExpr(const ShuffleVectorExpr *E) {
return false;
}
for (unsigned I = 0; I != NumOutputElems; ++I) {
- APSInt ShuffleIndex = E->getShuffleMaskIdx(Ctx.getASTContext(), I);
+ APSInt ShuffleIndex = E->getShuffleMaskIdx(I);
assert(ShuffleIndex >= -1);
if (ShuffleIndex == -1)
return this->emitInvalidShuffleVectorIndex(I, E);