[Decompiler - New IR] Add AtomicOp (#181)

* wip decompiler ir

* add AtomicOp stuff

* fix windows build and warnings

* add instruction parser

* include

* make minilzo shared

* odr fix

* a

* fix merge conflicts

* move decompiler into namespace

* update the code coverage to include the decompiler

* add demo test

* add register use test to example test
This commit is contained in:
water111
2021-01-06 20:04:15 -05:00
committed by GitHub
parent 3331e9cd00
commit 5093b97cda
71 changed files with 2676 additions and 210 deletions
+5 -2
View File
@@ -11,9 +11,11 @@
#include "decompiler/Function/Function.h"
#include "decompiler/Function/BasicBlocks.h"
#include "decompiler/Disasm/InstructionMatching.h"
#include "decompiler/ObjectFile/LinkedObjectFile.h"
#include "decompiler/IR/IR.h"
#include "common/symbols.h"
namespace decompiler {
namespace {
///////////////////////////////
@@ -135,7 +137,7 @@ std::shared_ptr<IR_Atomic> to_asm_automatic(const std::string& str, Instruction&
}
if (instr.n_src >= 3) {
result->src1 = instr_atom_to_ir(instr.get_src(2), idx);
result->src2 = instr_atom_to_ir(instr.get_src(2), idx);
}
result->set_reg_info();
@@ -2520,7 +2522,7 @@ void add_basic_ops_to_block(Function* func, const BasicBlock& block, LinkedObjec
// everything failed
if (!result) {
// temp hack for debug:
printf("Instruction -> BasicOp failed on %s\n", i.to_string(*file).c_str());
printf("Instruction -> BasicOp failed on %s\n", i.to_string(file->labels).c_str());
func->add_basic_op(std::make_shared<IR_Failed_Atomic>(), instr, instr + 1);
} else {
if (!func->contains_asm_ops && dynamic_cast<IR_AsmOp*>(result.get())) {
@@ -2536,3 +2538,4 @@ void add_basic_ops_to_block(Function* func, const BasicBlock& block, LinkedObjec
}
}
}
} // namespace decompiler