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.
36 lines
698 B
C++
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());
|
|
}
|
|
};
|