6 #ifndef JLM_LLVM_IR_IPGRAPH_MODULE_HPP
7 #define JLM_LLVM_IR_IPGRAPH_MODULE_HPP
48 static inline std::unique_ptr<GlobalValue>
51 return std::make_unique<GlobalValue>(node);
56 typedef std::unordered_set<const GlobalValue *>::const_iterator
const_iterator;
108 auto v = std::make_unique<llvm::Variable>(std::move(
type), name);
117 static uint64_t c = 0;
140 return it !=
functions_.end() ? it->second :
nullptr;
149 inline const std::string &
155 inline const std::string &
161 static std::unique_ptr<InterProceduralGraphModule>
164 const std::string & targetTriple,
165 const std::string & dataLayout)
167 return std::make_unique<InterProceduralGraphModule>(sourceFilename, targetTriple, dataLayout);
176 std::unordered_set<std::unique_ptr<llvm::Variable>>
variables_;
177 std::unordered_map<const InterProceduralGraphNode *, const llvm::Variable *>
functions_;
184 for (
const auto & n : im.
ipgraph())
194 for (
const auto & node : *f->cfg())
196 if (
auto bb =
dynamic_cast<const BasicBlock *
>(&node))
197 ntacs += bb->tacs().ntacs();
llvm::ControlFlowGraph * cfg() const noexcept
GlobalValue & operator=(GlobalValue &&)=delete
GlobalValue(const GlobalValue &)=delete
GlobalValue(GlobalValue &&)=delete
DataNode * node() const noexcept
~GlobalValue() noexcept override
GlobalValue & operator=(const GlobalValue &)=delete
llvm::Variable * create_variable(std::shared_ptr< const jlm::rvsdg::Type > type, const std::string &name)
llvm::Variable * create_variable(FunctionNode *node)
const jlm::util::FilePath & source_filename() const noexcept
~InterProceduralGraphModule() noexcept=default
std::unordered_set< const GlobalValue * >::const_iterator const_iterator
GlobalValue * create_global_value(DataNode *node)
std::unordered_set< std::unique_ptr< llvm::Variable > > variables_
const InterProceduralGraph & ipgraph() const noexcept
const std::string & target_triple() const noexcept
static std::unique_ptr< InterProceduralGraphModule > create(const jlm::util::FilePath &sourceFilename, const std::string &targetTriple, const std::string &dataLayout)
InterProceduralGraph & ipgraph() noexcept
std::string target_triple_
const_iterator begin() const
InterProceduralGraph clg_
std::unordered_map< const InterProceduralGraphNode *, const llvm::Variable * > functions_
const std::string & data_layout() const noexcept
const llvm::Variable * variable(const InterProceduralGraphNode *node) const noexcept
llvm::Variable * create_variable(std::shared_ptr< const jlm::rvsdg::Type > type)
const_iterator end() const
std::unordered_set< const GlobalValue * > globals_
const jlm::util::FilePath source_filename_
const std::string & name() const noexcept
const std::shared_ptr< const jlm::rvsdg::Type > Type() const noexcept
Global memory state passed between functions.
size_t ntacs(const AggregationNode &root)
static std::unique_ptr< GlobalValue > create_gblvalue(DataNode *node)
static std::string type(const Node *n)
static std::string strfmt(Args... args)