[clang][bytecode] Only override constant-context state if we have an EvalEmitter (#211475)
This does not make sense when emitting bytecode, as the bytecode would just contain a `PushCC`/`PopCC` pair with nothing in between.
This commit is contained in:
parent
6cdc7bd8c9
commit
3fd07e3235
1 changed files with 8 additions and 4 deletions
|
|
@ -8276,12 +8276,16 @@ bool Compiler<Emitter>::visitDeclRef(const ValueDecl *D, const Expr *E) {
|
|||
bool IsConstexprUnknown = true) -> bool {
|
||||
llvm::SaveAndRestore CURS(this->VariablesAreConstexprUnknown,
|
||||
IsConstexprUnknown);
|
||||
if (!this->emitPushCC(VD->hasConstantInitialization(), E))
|
||||
return false;
|
||||
if constexpr (std::is_same_v<Emitter, EvalEmitter>) {
|
||||
if (!this->emitPushCC(VD->hasConstantInitialization(), E))
|
||||
return false;
|
||||
}
|
||||
auto VarState = this->visitDecl(VD);
|
||||
|
||||
if (!this->emitPopCC(E))
|
||||
return false;
|
||||
if constexpr (std::is_same_v<Emitter, EvalEmitter>) {
|
||||
if (!this->emitPopCC(E))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VarState.notCreated())
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue