2020-09-12 14:26:58 -07:00
|
|
|
#include "DebugBlockGuard.h"
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/codegen/InstructionEmitter.h"
|
|
|
|
|
#include "bscript/compiler/model/LocalVariableScopeInfo.h"
|
|
|
|
|
#include "bscript/compiler/model/Variable.h"
|
2020-09-12 14:26:58 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
DebugBlockGuard::DebugBlockGuard( InstructionEmitter& emitter,
|
|
|
|
|
LocalVariableScopeInfo& local_variable_scope_info )
|
|
|
|
|
: emitter( emitter ),
|
|
|
|
|
previous_block_id( emitter.enter_debug_block( local_variable_scope_info ) )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
DebugBlockGuard::~DebugBlockGuard()
|
|
|
|
|
{
|
|
|
|
|
emitter.set_debug_block( previous_block_id );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|