mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
ee0b8f44c1
This is a big step to split revng-lift in two parts: one that only writes the model and one that actually lifts to LLVM IR. * Introduce `revng import binary` * Split off `BinaryFile.h` * Drop `revng.h` * `GeneratedCodeBasicInfo`: use model * Reduce role of `GeneratedCodeBasicInfo` in favor of `model::Architecture` and `model::Register` methods * `CodeGenerator`: adopt `RawBinaryView` and model * `JumpTargetManager`: adopt `RawBinaryView` and model * `ExternalJumpsHandler`: adopt model * `InstructionTranslator`: discard `Architecture` in favor of `EndianessMismatch` * Many other changes
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include <cstdint>
|
|
|
|
#include "llvm/Support/Error.h"
|
|
|
|
#include "revng/Model/Binary.h"
|
|
|
|
namespace llvm {
|
|
namespace object {
|
|
class ELFObjectFileBase;
|
|
class COFFObjectFile;
|
|
class MachOObjectFile;
|
|
} // namespace object
|
|
} // namespace llvm
|
|
|
|
llvm::Error importELF(TupleTree<model::Binary> &Model,
|
|
const llvm::object::ELFObjectFileBase &TheBinary,
|
|
uint64_t PreferredBaseAddress);
|
|
llvm::Error importPECOFF(TupleTree<model::Binary> &Model,
|
|
const llvm::object::COFFObjectFile &TheBinary,
|
|
uint64_t PreferredBaseAddress);
|
|
llvm::Error importMachO(TupleTree<model::Binary> &Model,
|
|
llvm::object::MachOObjectFile &TheBinary,
|
|
uint64_t PreferredBaseAddress);
|
|
|
|
template<typename... Ts>
|
|
llvm::Error createError(char const *Fmt, const Ts &...Vals) {
|
|
return llvm::createStringError(llvm::inconvertibleErrorCode(), Fmt, Vals...);
|
|
}
|