@@ -136,6 +136,11 @@ def set_sourceinfo(value: ir.Value, info: sourceinfo.SourceInfo):
136136 value .meta [_SOURCEINFO_FIELD ] = info
137137
138138
139+ def is_base_type_bool (attr : ir .Attr ) -> bool :
140+ """Check if the attribute is a boolean type."""
141+ # FIXME: Add meta to attributes
142+ attr .meta [_SOURCEINFO_FIELD ]
143+
139144@dataclasses .dataclass
140145class ASTMeta :
141146 """Metadata for an AST node.
@@ -276,20 +281,6 @@ def __init__(
276281 self ._value_env = _ValueEnvironment (self )
277282 self .meta : defaultdict [ast .AST , ASTMeta ] = defaultdict (ASTMeta )
278283
279- # def _init_function_translation(self) -> None:
280- # """Initialize self for translating a new (top-level) function."""
281- # self._outer = []
282- # # TODO(justinchuby): Update this
283- # self._current_fn = ir.Function(
284- # domain=self._opset.domain,
285- # name="",
286- # graph=ir.Graph((), (), nodes=[]),
287- # attributes={},
288- # )
289- # self._nextvar = 0
290- # self._used_vars = set()
291- # self._locals: List[Dict[str, LocalSymValue]] = [{}]
292-
293284 def _source_of (self , node : ast .AST ) -> sourceinfo .SourceInfo :
294285 return sourceinfo .SourceInfo (node , self ._source , self ._current_fn .name )
295286
0 commit comments