from cdsl.predicates import FieldPredicate
from .formats import UnaryGlobalValue, InstructionFormat
try:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from cdsl.formats import InstructionFormat, FormatField except ImportError:
pass
class IsColocatedFunc(FieldPredicate):
def __init__(self, field):
super(IsColocatedFunc, self).__init__(
field, 'is_colocated_func', ('func',))
class IsColocatedData(FieldPredicate):
def __init__(self):
super(IsColocatedData, self).__init__(
UnaryGlobalValue.global_value, 'is_colocated_data', ('func',))
class LengthEquals(FieldPredicate):
def __init__(self, iform, num):
super(LengthEquals, self).__init__(
iform.args(), 'has_length_of', (num, 'func'))