1# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2# See https://llvm.org/LICENSE.txt for license information. 3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 5try: 6 from ..ir import * 7except ImportError as e: 8 raise RuntimeError("Error loading imports from extension module") from e 9 10class ModuleOp: 11 """Specialization for the module op class.""" 12 13 def __init__(self, *, loc=None, ip=None): 14 super().__init__(self.build_generic(results=[], operands=[], loc=loc, 15 ip=ip)) 16 body = self.regions[0].blocks.append() 17 18 @property 19 def body(self): 20 return self.regions[0].blocks[0] 21