Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: courgette/disassembler_elf_32_x86.h

Issue 2462993003: [Courgette] Refactor: Add and use Instruction*Receptor classes; call ParseFile() in 2 passes. (Closed)
Patch Set: Make AssemblyProgram::CreateInstruction*Receptor() return CheckBool. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: courgette/disassembler_elf_32_x86.h
diff --git a/courgette/disassembler_elf_32_x86.h b/courgette/disassembler_elf_32_x86.h
index bea7d78033c8430ec06bd0ba5373e2d2992aaa7a..ff4fad8707a9ea05a0f73cca920d47967c10cacb 100644
--- a/courgette/disassembler_elf_32_x86.h
+++ b/courgette/disassembler_elf_32_x86.h
@@ -17,6 +17,7 @@
namespace courgette {
class AssemblyProgram;
+class InstructionReceptor;
class DisassemblerElf32X86 : public DisassemblerElf32 {
public:
@@ -32,8 +33,8 @@ class DisassemblerElf32X86 : public DisassemblerElf32 {
// TypedRVA interfaces.
CheckBool ComputeRelativeTarget(const uint8_t* op_pointer) override;
- CheckBool EmitInstruction(AssemblyProgram* program,
- Label* label) override;
+ CheckBool EmitInstruction(Label* label,
+ InstructionReceptor* receptor) override;
uint16_t op_size() const override;
};
@@ -50,8 +51,8 @@ class DisassemblerElf32X86 : public DisassemblerElf32 {
CheckBool RelToRVA(Elf32_Rel rel,
RVA* result) const override WARN_UNUSED_RESULT;
CheckBool ParseRelocationSection(const Elf32_Shdr* section_header,
- AssemblyProgram* program)
- override WARN_UNUSED_RESULT;
+ InstructionReceptor* receptor) const override
+ WARN_UNUSED_RESULT;
CheckBool ParseRel32RelocsFromSection(const Elf32_Shdr* section)
override WARN_UNUSED_RESULT;

Powered by Google App Engine
This is Rietveld 408576698