mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
19f67c8223
Add a mixin class for piperuns that work on an LLVM module and need both the model function and the `llvm::Function`. Pipe that inherit this mixin will receive both the model and LLVM function in the `runOnLLVMFunction` method.
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/BasicAnalyses/GeneratedCodeBasicInfo.h"
|
|
#include "revng/PipeboxCommon/Helpers/PipeRuns/LLVMFunctionMixin.h"
|
|
#include "revng/PipeboxCommon/LLVMContainer.h"
|
|
|
|
namespace revng::pypeline::piperuns {
|
|
|
|
class PromoteCSVs : public LLVMFunctionMixin<PromoteCSVs> {
|
|
private:
|
|
const model::Binary &Binary;
|
|
|
|
public:
|
|
static constexpr llvm::StringRef Name = "promote-csvs";
|
|
using Arguments = TypeList<PipeRunArgument<LLVMFunctionContainer,
|
|
"Module",
|
|
"The LLVM Module(s) where the CSV "
|
|
"will be promoted">>;
|
|
|
|
PromoteCSVs(const class Model &Model,
|
|
llvm::StringRef Config,
|
|
llvm::StringRef DynamicConfig,
|
|
LLVMFunctionContainer &ModuleContainer) :
|
|
LLVMFunctionMixin(ModuleContainer), Binary(*Model.get().get()) {}
|
|
|
|
void runOnLLVMFunction(const model::Function &Function,
|
|
llvm::Function &LLVMFunction);
|
|
};
|
|
|
|
} // namespace revng::pypeline::piperuns
|