mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
296eb9a76f
Make the interface required by `SingleOutputPipe` similar to other piperuns by requiring a constructor, the use of `PipeRunArgument`s and the implementation of a non-static `run` function.
62 lines
1.6 KiB
C++
62 lines
1.6 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include <string>
|
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
|
|
#include "revng/PipeboxCommon/Common.h"
|
|
#include "revng/PipeboxCommon/LLVMContainer.h"
|
|
#include "revng/PipeboxCommon/Model.h"
|
|
#include "revng/Pipeline/ContainerSet.h"
|
|
#include "revng/Pipeline/Contract.h"
|
|
#include "revng/Pipeline/LLVMContainer.h"
|
|
#include "revng/Pipeline/LLVMKind.h"
|
|
#include "revng/Pipeline/Target.h"
|
|
#include "revng/Pipes/Kinds.h"
|
|
|
|
namespace revng::pipes {
|
|
|
|
class LinkSupport {
|
|
public:
|
|
static constexpr auto Name = "link-support";
|
|
|
|
std::array<pipeline::ContractGroup, 1> getContract() const {
|
|
return { pipeline::ContractGroup(kinds::Root,
|
|
0,
|
|
pipeline::InputPreservation::Preserve) };
|
|
}
|
|
|
|
void run(pipeline::ExecutionContext &EC,
|
|
pipeline::LLVMContainer &ModuleContainer);
|
|
};
|
|
|
|
} // namespace revng::pipes
|
|
|
|
namespace revng::pypeline::piperuns {
|
|
|
|
class LinkSupport {
|
|
private:
|
|
const model::Binary &Binary;
|
|
LLVMRootContainer &ModuleContainer;
|
|
|
|
public:
|
|
static constexpr llvm::StringRef Name = "link-support";
|
|
using Arguments = TypeList<PipeRunArgument<LLVMRootContainer,
|
|
"Module",
|
|
"Module to link support into">>;
|
|
|
|
public:
|
|
LinkSupport(const class Model &Model,
|
|
llvm::StringRef Config,
|
|
llvm::StringRef DynamicConfig,
|
|
LLVMRootContainer &ModuleContainer);
|
|
|
|
void run();
|
|
};
|
|
|
|
} // namespace revng::pypeline::piperuns
|