Jlm
Loading...
Searching...
No Matches
constant.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2013 2014 Helge Bahmann <hcb@chaoticmind.net>
3 * Copyright 2011 2012 2013 2014 Nico Reißmann <nico.reissmann@gmail.com>
4 * See COPYING for terms of redistribution.
5 */
6
7#ifndef JLM_RVSDG_BITSTRING_CONSTANT_HPP
8#define JLM_RVSDG_BITSTRING_CONSTANT_HPP
9
12#include <jlm/rvsdg/node.hpp>
13#include <jlm/rvsdg/nullary.hpp>
15
16#include <vector>
17
18namespace jlm::rvsdg
19{
20
22{
23public:
25
27
28 bool
30
31 std::string
33
36
39 {
40 return value_;
41 }
42
43 static Output &
45 {
46 return *CreateOpNode<BitConstantOperation>(region, std::move(value)).output(0);
47 }
48
49 static Output &
50 createUndefined(Region & region, const size_t numBits)
51 {
52 const std::string s(numBits, 'X');
53 return create(region, BitValueRepresentation(s.c_str()));
54 }
55
56private:
58};
59
60}
61
62#endif
std::unique_ptr< Operation > copy() const override
Definition constant.cpp:36
std::string debug_string() const override
Definition constant.cpp:27
~BitConstantOperation() noexcept override
const BitValueRepresentation & value() const noexcept
Definition constant.hpp:38
static Output & createUndefined(Region &region, const size_t numBits)
Definition constant.hpp:50
static Output & create(Region &region, BitValueRepresentation value)
Definition constant.hpp:44
BitValueRepresentation value_
Definition constant.hpp:57
Nullary operator (operator taking no formal arguments)
Definition nullary.hpp:22
Represent acyclic RVSDG subgraphs.
Definition region.hpp:213
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872