|
| Scope ()=default |
|
| Scope (Scope &&that) noexcept=default |
|
Scope & | operator= (Scope &&that) noexcept=default |
|
| Scope (const Scope< T > &)=delete |
|
Scope< T > & | operator= (const Scope< T > &)=delete |
|
void | set_containing_scope (const Scope< T > *s) |
| Set the parent scope.
|
|
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type> |
T2 | get (const std::string &name) const |
| Retrieve the value referred to by a name.
|
|
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type> |
T2 & | ref (const std::string &name) |
| Return a reference to an entry.
|
|
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type> |
const T2 * | find (const std::string &name) const |
| Returns a const pointer to an entry if it exists in this scope or any containing scope, or nullptr if it does not.
|
|
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type> |
T2 * | shallow_find (const std::string &name) |
| A version of find that returns a non-const pointer, but ignores containing scope.
|
|
bool | contains (const std::string &name) const |
| Tests if a name is in scope.
|
|
size_t | count (const std::string &name) const |
| How many nested definitions of a single name exist?
|
|
size_t | size () const |
| How many distinct names exist (does not count nested definitions of the same name)
|
|
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type> |
PushToken | push (const std::string &name, T2 &&value) |
| Add a new (name, value) pair to the current scope.
|
|
template<typename T2 = T, typename = typename std::enable_if<std::is_same<T2, void>::value>::type> |
PushToken | push (const std::string &name) |
|
void | pop (const std::string &name) |
| A name goes out of scope.
|
|
void | pop (PushToken p) |
| Pop a name using a token returned by push instead of a string.
|
|
const_iterator | cbegin () const |
|
const_iterator | cend () const |
|
void | swap (Scope< T > &other) noexcept |
|
template<typename T = void>
class Halide::Internal::Scope< T >
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Let or a LetStmt, and that it should hide previous values with the same name until you leave the Let or LetStmt nodes This class helps with that.
Definition at line 94 of file Scope.h.
template<typename T = void>
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type>
template<typename T = void>
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type>
Return a reference to an entry.
Does not consider the containing scope.
Definition at line 144 of file Scope.h.
References internal_error.
template<typename T = void>
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type>
template<typename T = void>
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type>
A version of find that returns a non-const pointer, but ignores containing scope.
Definition at line 175 of file Scope.h.
template<typename T = void>
template<typename T2 = T, typename = typename std::enable_if<!std::is_same<T2, void>::value>::type>
Add a new (name, value) pair to the current scope.
Hide old values that have this name until we pop this name. Returns a token that can be used to pop the same value without doing a fresh lookup.
Definition at line 223 of file Scope.h.
Referenced by Halide::Internal::stmt_or_expr_uses_var().