commit e62f95838a98b05cae8b0f4a67460ac96fc9c669
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue May 8 15:54:10 2012 -0400
use gcc_integer_type_get_{max|min}_value
generate-tree-c.py | 4 ++--
proposed-plugin-api/type.xml | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/generate-tree-c.py b/generate-tree-c.py
index 89d12c4..a16bc84 100644
--- a/generate-tree-c.py
+++ b/generate-tree-c.py
@@ -389,10 +389,10 @@ def generate_tree_code_classes():
'gcc_python_make_wrapper_tree(gcc_private_make_tree(c_common_unsigned_type(self->t.inner)))',
'The gcc.IntegerType for the unsigned version of this
type')
add_simple_getter('max_value',
-
'gcc_python_make_wrapper_tree(gcc_private_make_tree(TYPE_MAX_VALUE(self->t.inner)))',
+
'gcc_python_make_wrapper_tree(gcc_integer_constant_as_gcc_tree(gcc_integer_type_get_max_value(gcc_tree_as_gcc_integer_type(self->t))))',
'The maximum possible value for this type, as a
gcc.IntegerCst')
add_simple_getter('min_value',
-
'gcc_python_make_wrapper_tree(gcc_private_make_tree(TYPE_MIN_VALUE(self->t.inner)))',
+
'gcc_python_make_wrapper_tree(gcc_integer_constant_as_gcc_tree(gcc_integer_type_get_min_value(gcc_tree_as_gcc_integer_type(self->t))))',
'The minimum possible value for this type, as a
gcc.IntegerCst')
if tree_type.SYM in ('INTEGER_TYPE', 'REAL_TYPE',
'FIXED_POINT_TYPE'):
diff --git a/proposed-plugin-api/type.xml b/proposed-plugin-api/type.xml
index 1b99320..7c34d37 100644
--- a/proposed-plugin-api/type.xml
+++ b/proposed-plugin-api/type.xml
@@ -61,6 +61,8 @@
</type>
<type name="integer_type" base="type">
+ <attribute name="max_value" kind="integer_constant"/>
+ <attribute name="min_value" kind="integer_constant"/>
</type>
<type name="lang_type" base="type">
Show replies by date