From 97381d636410ca5e9072206e7ac75c935de7bb87 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Fri, 16 Feb 2018 10:48:13 -0500 Subject: implement missing get_semantic_flag_class_name and get_semantic_flag_group_name --- python/architecture.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'python') diff --git a/python/architecture.py b/python/architecture.py index 028fdeaa..51a7cfba 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -1831,6 +1831,21 @@ class Architecture(object): return sem_class.index return sem_class + def get_semantic_flag_class_name(self, class_index): + """ + ``get_semantic_flag_class_name`` gets the name of a semantic flag class from the index. + + :param int _index: class_index + :return: the name of the semantic flag class + :rtype: str + """ + if not isinstance(class_index, int): + raise ValueError("argument 'class_index' must be an intege") + try: + return self._semantic_flag_classes_by_index[class_index] + except KeyError: + raise AttributeError("argument class_index is not a valid class index") + def get_semantic_flag_group_index(self, sem_group): if isinstance(sem_group, str): return self._semantic_flag_groups[sem_group] @@ -1838,6 +1853,21 @@ class Architecture(object): return sem_group.index return sem_group + def get_semantic_flag_group_name(self, group_index): + """ + ``get_semantic_flag_group_name`` gets the name of a semantic flag group from the index. + + :param int group_index: group_index + :return: the name of the semantic flag group + :rtype: str + """ + if not isinstance(group_index, int): + raise ValueError("argument 'group_index' must be an intege") + try: + return self._semantic_flag_groups_by_index[group_index] + except KeyError: + raise AttributeError("argument group_index is not a valid group index") + def get_intrinsic_name(self, intrinsic): """ ``get_intrinsic_name`` gets an intrinsic name from an intrinsic number. -- cgit v1.3.1