Author: Timm Baeder Date: 2026-10-02T06:54:43+02:00 New Revision: 5b5d81ca4a95f250488d9d164697a98096578e7f
URL: https://github.com/llvm/llvm-project/commit/5b5d81ca4a95f250488d9d164697a98096578e7f DIFF: https://github.com/llvm/llvm-project/commit/5b5d81ca4a95f250488d9d164697a98096578e7f.diff LOG: [clang][bytecode] Skip `emitInitScope` for `EvalEmitter` (#228092) The opcode ultimately doesn't do anything in `EvalEmitter`, so try to skip it as early as possible. Added: Modified: clang/lib/AST/ByteCode/Compiler.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 6afb424936202..42859942d2925 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -148,7 +148,9 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> { if (!Idx) { Idx = static_cast<unsigned>(this->Ctx->Descriptors.size()); this->Ctx->Descriptors.emplace_back(); - this->Ctx->emitInitScope(*Idx, {}); + + if constexpr (!std::is_same_v<Emitter, EvalEmitter>) + this->Ctx->emitInitScope(*Idx, {}); } Local.EnabledByDefault = this->LocalsAlwaysEnabled; @@ -164,7 +166,8 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> { if (!Idx) { Idx = static_cast<unsigned>(this->Ctx->Descriptors.size()); this->Ctx->Descriptors.emplace_back(); - this->Ctx->emitInitScope(*Idx, {}); + if constexpr (!std::is_same_v<Emitter, EvalEmitter>) + this->Ctx->emitInitScope(*Idx, {}); } } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
