aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-07-06 18:59:24 +0200
committerGitHub <noreply@github.com>2025-07-06 18:59:24 +0200
commit9c7320e5d370be7f79ad5835f9f623ac3d30a30a (patch)
treeb10fa2967aa3181997f6a6cd6f25dcf703e1b716 /clang/lib/AST/ByteCode/Compiler.cpp
parentaa9e02cc10f80abb9b9cb3a62f7867c19302f1e4 (diff)
downloadllvm-9c7320e5d370be7f79ad5835f9f623ac3d30a30a.zip
llvm-9c7320e5d370be7f79ad5835f9f623ac3d30a30a.tar.gz
llvm-9c7320e5d370be7f79ad5835f9f623ac3d30a30a.tar.bz2
[clang][bytecode] Fix visiting for-range loop variable (#147188)
Make sure we're properly registering DecompositionDecls.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 5ed65f2..d1c93e4 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -5545,7 +5545,6 @@ bool Compiler<Emitter>::visitCXXForRangeStmt(const CXXForRangeStmt *S) {
const Stmt *BeginStmt = S->getBeginStmt();
const Stmt *RangeStmt = S->getRangeStmt();
const Stmt *EndStmt = S->getEndStmt();
- const VarDecl *LoopVar = S->getLoopVariable();
LabelTy EndLabel = this->getLabel();
LabelTy CondLabel = this->getLabel();
@@ -5570,7 +5569,7 @@ bool Compiler<Emitter>::visitCXXForRangeStmt(const CXXForRangeStmt *S) {
if (!this->jumpFalse(EndLabel))
return false;
- if (!this->visitVarDecl(LoopVar))
+ if (!this->visitDeclStmt(S->getLoopVarStmt(), /*EvaluateConditionDecl=*/true))
return false;
// Body.