18 if ((
'A' <= c && c <=
'Z') || (
'a' <= c && c <=
'z') || (
'0' <= c && c <=
'9') ||
'_' == c)
35 std::string append =
"";
41 append.append(std::to_string(inPorts));
43 append.append(std::to_string(
JlmSize(node->
input(inPorts - 1)->
Type().get())));
47 append.append(
"_OUT");
48 append.append(std::to_string(outPorts));
56 name = std::regex_replace(name, std::regex(
"_+"),
"_");
65 if (jlm::rvsdg::TryGetOwnerNode<jlm::rvsdg::Node>(*port))
75 throw std::logic_error(port->
debug_string() +
" not implemented!");
86 throw std::logic_error(
"nullptr!");
103 throw std::logic_error(port->
debug_string() +
" not implemented!");
118 for (
auto & node : r->
Nodes())
124 else if (
auto oln =
dynamic_cast<LoopNode *
>(&node))
130 throw util::Error(
"Unimplemented op (unexpected structural node) : " + node.DebugString());
139 auto ln =
dynamic_cast<const rvsdg::LambdaNode *
>(region->Nodes().begin().ptr());
140 if (region->numNodes() == 1 && ln)
146 throw util::Error(
"Root should have only one lambda node now");
154 auto base_file_name = source_file_name.substr(0, source_file_name.find_last_of(
'.'));
155 return base_file_name;
std::unordered_map< const rvsdg::Node *, std::string > node_map
static std::string get_port_name(jlm::rvsdg::Input *port)
void create_node_names(rvsdg::Region *r)
static int JlmSize(const jlm::rvsdg::Type *type)
const rvsdg::LambdaNode * get_hls_lambda(llvm::LlvmRvsdgModule &rm)
std::string get_node_name(const rvsdg::Node *node)
static std::string get_base_file_name(const llvm::LlvmRvsdgModule &rm)
const util::FilePath & SourceFileName() const noexcept
Region & GetRootRegion() const noexcept
virtual std::string DebugString() const =0
NodeInput * input(size_t index) const noexcept
NodeOutput * output(size_t index) const noexcept
size_t ninputs() const noexcept
size_t noutputs() const noexcept
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
virtual std::string debug_string() const
size_t index() const noexcept
Represents the argument of a region.
Represent acyclic RVSDG subgraphs.
NodeRange Nodes() noexcept
std::string name() const noexcept
Returns the name of the file, excluding the path.
int JlmSize(const jlm::rvsdg::Type *type)
bool isForbiddenChar(char c)
static std::string type(const Node *n)
Region * TryGetOwnerRegion(const rvsdg::Input &input) noexcept
static std::string strfmt(Args... args)