diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-07-06 18:59:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-06 18:59:24 +0200 |
commit | 9c7320e5d370be7f79ad5835f9f623ac3d30a30a (patch) | |
tree | b10fa2967aa3181997f6a6cd6f25dcf703e1b716 /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | aa9e02cc10f80abb9b9cb3a62f7867c19302f1e4 (diff) | |
download | llvm-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.cpp | 3 |
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. |