Files
archived-dolphin/Source/Core/Common/Assembler/GekkoIRGen.h
Martino Fontana a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00

50 lines
1.2 KiB
C++

// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <string_view>
#include <vector>
#include "Common/Assembler/AssemblerShared.h"
#include "Common/CommonTypes.h"
namespace Common::GekkoAssembler::detail
{
struct GekkoInstruction
{
// Combination of a mnemonic index and variant:
// (<GekkoMnemonic> << 2) | (<variant bits>)
size_t mnemonic_index = 0;
// Below refers to GekkoParseResult::operand_pool
Interval op_interval = Interval{0, 0};
// Literal text of this instruction
std::string_view raw_text;
size_t line_number = 0;
bool is_extended = false;
};
using InstChunk = std::vector<GekkoInstruction>;
using ByteChunk = std::vector<u8>;
using PadChunk = size_t;
using ChunkVariant = std::variant<InstChunk, ByteChunk, PadChunk>;
struct IRBlock
{
explicit IRBlock(u32 address) : block_address(address) {}
u32 BlockEndAddress() const;
std::vector<ChunkVariant> chunks;
u32 block_address;
};
struct GekkoIR
{
std::vector<IRBlock> blocks;
std::vector<Tagged<Interval, u32>> operand_pool;
};
FailureOr<GekkoIR> ParseToIR(std::string_view assembly, u32 base_virtual_address);
} // namespace Common::GekkoAssembler::detail