mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
723ae8d801
Move member declaration to the top of the class definition of `GeneratedCodeBasicInfo` and initialize primitive members. Merge the `run` method into the constructor since all uses have them happening close to each other.
59 lines
2.0 KiB
C++
59 lines
2.0 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/EarlyFunctionAnalysis/CFGAnalyzer.h"
|
|
#include "revng/EarlyFunctionAnalysis/ControlFlowGraph.h"
|
|
#include "revng/Pipebox/TupleTreeContainer.h"
|
|
#include "revng/PipeboxCommon/Common.h"
|
|
#include "revng/PipeboxCommon/LLVMContainer.h"
|
|
|
|
namespace revng::pypeline {
|
|
|
|
using CFGMap = TupleTreeContainer<efa::ControlFlowGraph,
|
|
Kinds::Function,
|
|
"CFGMap">;
|
|
|
|
namespace piperuns {
|
|
|
|
class CollectCFG {
|
|
private:
|
|
const class Model &Model;
|
|
CFGMap &Output;
|
|
|
|
GeneratedCodeBasicInfo GCBI;
|
|
efa::FunctionSummaryOracle Oracle;
|
|
efa::CFGAnalyzer Analyzer;
|
|
|
|
public:
|
|
static constexpr llvm::StringRef Name = "collect-cfg";
|
|
using Arguments = TypeList<PipeRunArgument<LLVMRootContainer,
|
|
"Input",
|
|
"LLVM module to analyze to "
|
|
"produce the CFG",
|
|
// The root container is
|
|
// manipulated to create the
|
|
// CFGMap, hence the need to
|
|
// declare Access::Read and a
|
|
// non-const argument.
|
|
Access::Read>,
|
|
PipeRunArgument<CFGMap,
|
|
"Output",
|
|
"The produced CFG for each "
|
|
"function",
|
|
Access::Write>>;
|
|
|
|
CollectCFG(const class Model &Model,
|
|
llvm::StringRef Config,
|
|
llvm::StringRef DynamicConfig,
|
|
LLVMRootContainer &Input,
|
|
CFGMap &Output);
|
|
void runOnFunction(const model::Function &TheFunction);
|
|
};
|
|
|
|
} // namespace piperuns
|
|
|
|
} // namespace revng::pypeline
|