add type alias

This commit is contained in:
2over12
2022-08-16 07:49:50 -04:00
parent 486e338578
commit 0b73a3a54b
3 changed files with 9 additions and 8 deletions
+5 -2
View File
@@ -288,12 +288,15 @@ class Arch {
// The decoder takes contextual information in the form of a DecodingContext, making a copy to produce a ContextMap which is a function that maps
// a successor to a new context that updates the old context.
virtual std::optional<DecodingContext::ContextMap>
using DecodingResult = std::optional<DecodingContext::ContextMap>;
virtual DecodingResult
DecodeInstruction(uint64_t address, std::string_view instr_bytes,
Instruction &inst, DecodingContext context) const = 0;
// Decode an instruction that is within a delay slot.
std::optional<DecodingContext::ContextMap>
DecodingResult
DecodeDelayedInstruction(uint64_t address, std::string_view instr_bytes,
Instruction &inst, DecodingContext context) const {
inst.in_delay_slot = true;
+3 -5
View File
@@ -855,11 +855,9 @@ DecodingContext DefaultContextAndLifter::CreateInitialContext(void) const {
return DecodingContext();
}
std::optional<DecodingContext::ContextMap>
DefaultContextAndLifter::DecodeInstruction(uint64_t address,
std::string_view instr_bytes,
Instruction &inst,
DecodingContext context) const {
Arch::DecodingResult DefaultContextAndLifter::DecodeInstruction(
uint64_t address, std::string_view instr_bytes, Instruction &inst,
DecodingContext context) const {
inst.SetLifter(std::make_unique<remill::InstructionLifter>(
this, this->GetInstrinsicTable()));
if (this->ArchDecodeInstruction(address, instr_bytes, inst)) {
+1 -1
View File
@@ -366,7 +366,7 @@ std::string CustomLoadImage::getArchType(void) const {
void CustomLoadImage::adjustVma(long) {}
std::optional<DecodingContext::ContextMap>
SleighArch::DecodingResult
SleighArch::DecodeInstruction(uint64_t address, std::string_view instr_bytes,
Instruction &inst,
DecodingContext context) const {