ladybird/Libraries/LibJS/Bytecode/Label.h
Andreas Kling ef8ac6ea7d LibJS: Remove unused C++ bytecode block classes
The Rust bytecode generator now owns basic block construction.
The old C++ BasicBlock class no longer has any users.

Label no longer needs to translate from BasicBlock.
Remove the now-empty Label.cpp from the build as well.
2026-06-14 20:27:59 +02:00

36 lines
698 B
C++

/*
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Format.h>
namespace JS::Bytecode {
class Label {
public:
explicit Label(u32 address)
: m_address(address)
{
}
size_t address() const { return m_address; }
void set_address(size_t address) { m_address = address; }
private:
u32 m_address { 0 };
};
}
template<>
struct AK::Formatter<JS::Bytecode::Label> : AK::Formatter<FormatString> {
ErrorOr<void> format(FormatBuilder& builder, JS::Bytecode::Label const& label)
{
return AK::Formatter<FormatString>::format(builder, "@{:x}"sv, label.address());
}
};