mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00

Given this is a private struct and it's used in a container that supports incomplete types, we can forward-declare it and move it into the cpp file. While we're at it, we can change the name to Label to follow our formatting guidelines.
40 lines
784 B
C++
40 lines
784 B
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#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();
|
|
void RegisterLabel(const std::string& label, u16 lval, LabelType type = LABEL_VALUE);
|
|
void DeleteLabel(const std::string& label);
|
|
std::optional<u16> GetLabelValue(const std::string& label, LabelType type = LABEL_ANY) const;
|
|
void Clear();
|
|
|
|
private:
|
|
struct Label;
|
|
std::vector<Label> labels;
|
|
};
|
|
} // namespace DSP
|