mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
emit-helper-header: new pipeline
This commit is contained in:
committed by
Pietro Fezzardi
parent
c82a01f68b
commit
12355dc51e
@@ -42,4 +42,31 @@ public:
|
||||
void run();
|
||||
};
|
||||
|
||||
class EmitHelperHeader {
|
||||
private:
|
||||
const model::Binary &Binary;
|
||||
const CliftFunctionContainer &Input;
|
||||
PTMLCBytesContainer &Output;
|
||||
|
||||
public:
|
||||
static constexpr llvm::StringRef Name = "emit-helper-header";
|
||||
using Arguments = TypeList<PipeRunArgument<CliftFunctionContainer,
|
||||
"Input",
|
||||
"MLIR container",
|
||||
Access::Read>,
|
||||
PipeRunArgument<PTMLCBytesContainer,
|
||||
"Output",
|
||||
"The helper header",
|
||||
Access::Write>>;
|
||||
|
||||
EmitHelperHeader(const class Model &Model,
|
||||
llvm::StringRef Config,
|
||||
llvm::StringRef DynamicConfig,
|
||||
const CliftFunctionContainer &Input,
|
||||
PTMLCBytesContainer &Output) :
|
||||
Binary(*Model.get().get()), Input(Input), Output(Output){};
|
||||
|
||||
void run();
|
||||
};
|
||||
|
||||
} // namespace revng::pypeline::piperuns
|
||||
|
||||
@@ -176,4 +176,14 @@ void EmitTypeAndGlobalHeader::run() {
|
||||
emitTypeAndGlobalHeaderImpl(*Out, Input.getModule());
|
||||
}
|
||||
|
||||
void EmitHelperHeader::run() {
|
||||
std::unique_ptr<llvm::raw_ostream> Out = Output.getOStream(ObjectID());
|
||||
|
||||
std::vector<mlir::ModuleOp> FunctionModules;
|
||||
for (const auto &Object : Input.objects())
|
||||
FunctionModules.emplace_back(Input.getModule(Object));
|
||||
|
||||
emitHelperHeaderImpl(*Out, FunctionModules);
|
||||
}
|
||||
|
||||
} // namespace revng::pypeline::piperuns
|
||||
|
||||
@@ -135,6 +135,7 @@ static RegisterSingleOutputPipeRun<ImportTypes> P42;
|
||||
static RegisterSingleOutputPipeRun<ImportFunctionDeclarations> P43;
|
||||
static RegisterSingleOutputPipeRun<ImportSegmentDeclarations> P44;
|
||||
static RegisterSingleOutputPipeRun<EmitTypeAndGlobalHeader> P45;
|
||||
static RegisterSingleOutputPipeRun<EmitHelperHeader> P46;
|
||||
|
||||
//
|
||||
// Analyses
|
||||
|
||||
Reference in New Issue
Block a user