mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-09 12:08:05 +03:00

The logging was broken in958cbf38a4
(DSPTool doesn't use dolphin's logging system, so it just produced nothing; the same thing affected comparing before693a29f8ce
). AssemblerError::LabelAlreadyExists (previously ERR_LABEL_EXISTS) simply was never used.
39 lines
772 B
C++
39 lines
772 B
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
namespace DSP
|
|
{
|
|
enum LabelType
|
|
{
|
|
LABEL_IADDR = 1, // Jump addresses, etc
|
|
LABEL_DADDR = 2, // Data addresses, etc
|
|
LABEL_VALUE = 4,
|
|
LABEL_ANY = 0xFF,
|
|
};
|
|
|
|
class LabelMap
|
|
{
|
|
public:
|
|
LabelMap();
|
|
~LabelMap();
|
|
|
|
void RegisterDefaults();
|
|
bool RegisterLabel(std::string label, u16 lval, LabelType type = LABEL_VALUE);
|
|
void DeleteLabel(std::string_view label);
|
|
std::optional<u16> GetLabelValue(std::string_view name, LabelType type = LABEL_ANY) const;
|
|
void Clear();
|
|
|
|
private:
|
|
struct Label;
|
|
std::vector<Label> labels;
|
|
};
|
|
} // namespace DSP
|