Commit a4865970 authored by yb9976's avatar yb9976
Browse files

Constify mode API.

parent c2b2f19f
...@@ -164,7 +164,7 @@ FIRM_API void set_mode_link(ir_mode *mode, void *l); ...@@ -164,7 +164,7 @@ FIRM_API void set_mode_link(ir_mode *mode, void *l);
* For modes of the sort float_number this is the most negative value * For modes of the sort float_number this is the most negative value
* bigger than -infinite. * bigger than -infinite.
*/ */
FIRM_API ir_tarval *get_mode_min(ir_mode *mode); FIRM_API ir_tarval *get_mode_min(const ir_mode *mode);
/** /**
* Returns the biggest representable value of a given mode. * Returns the biggest representable value of a given mode.
...@@ -172,7 +172,7 @@ FIRM_API ir_tarval *get_mode_min(ir_mode *mode); ...@@ -172,7 +172,7 @@ FIRM_API ir_tarval *get_mode_min(ir_mode *mode);
* For modes of the sort float_number this is the largest value lower * For modes of the sort float_number this is the largest value lower
* than infinite. * than infinite.
*/ */
FIRM_API ir_tarval *get_mode_max(ir_mode *mode); FIRM_API ir_tarval *get_mode_max(const ir_mode *mode);
/** /**
* Returns the value Zero represented in this mode. * Returns the value Zero represented in this mode.
...@@ -206,7 +206,7 @@ FIRM_API ir_tarval *get_mode_minus_one(ir_mode *mode); ...@@ -206,7 +206,7 @@ FIRM_API ir_tarval *get_mode_minus_one(ir_mode *mode);
* *
* All One is defined only for modes integer, reference and boolean modes * All One is defined only for modes integer, reference and boolean modes
*/ */
FIRM_API ir_tarval *get_mode_all_one(ir_mode *mode); FIRM_API ir_tarval *get_mode_all_one(const ir_mode *mode);
/** /**
* Returns a positive infinite value of a mode. * Returns a positive infinite value of a mode.
...@@ -408,7 +408,7 @@ FIRM_API void set_reference_mode_signed_eq(ir_mode *ref_mode, ir_mode *int_mode) ...@@ -408,7 +408,7 @@ FIRM_API void set_reference_mode_signed_eq(ir_mode *ref_mode, ir_mode *int_mode)
/** /**
* Returns the unsigned integer equivalent mode for an reference mode. * Returns the unsigned integer equivalent mode for an reference mode.
*/ */
FIRM_API ir_mode *get_reference_mode_unsigned_eq(ir_mode *mode); FIRM_API ir_mode *get_reference_mode_unsigned_eq(const ir_mode *mode);
/** /**
* Sets the unsigned integer equivalent mode for an reference mode. * Sets the unsigned integer equivalent mode for an reference mode.
......
...@@ -313,14 +313,14 @@ void (set_mode_link)(ir_mode *mode, void *l) ...@@ -313,14 +313,14 @@ void (set_mode_link)(ir_mode *mode, void *l)
set_mode_link_(mode, l); set_mode_link_(mode, l);
} }
ir_tarval *get_mode_min(ir_mode *mode) ir_tarval *get_mode_min(const ir_mode *mode)
{ {
assert(mode_is_data(mode)); assert(mode_is_data(mode));
return mode->min; return mode->min;
} }
ir_tarval *get_mode_max(ir_mode *mode) ir_tarval *get_mode_max(const ir_mode *mode)
{ {
assert(mode_is_data(mode)); assert(mode_is_data(mode));
...@@ -348,7 +348,7 @@ ir_tarval *get_mode_minus_one(ir_mode *mode) ...@@ -348,7 +348,7 @@ ir_tarval *get_mode_minus_one(ir_mode *mode)
return mode->minus_one; return mode->minus_one;
} }
ir_tarval *get_mode_all_one(ir_mode *mode) ir_tarval *get_mode_all_one(const ir_mode *mode)
{ {
assert(mode_is_data(mode) || mode == mode_b); assert(mode_is_data(mode) || mode == mode_b);
return mode->all_one; return mode->all_one;
...@@ -528,7 +528,7 @@ void set_reference_mode_signed_eq(ir_mode *ref_mode, ir_mode *int_mode) ...@@ -528,7 +528,7 @@ void set_reference_mode_signed_eq(ir_mode *ref_mode, ir_mode *int_mode)
ref_mode->eq_signed = int_mode; ref_mode->eq_signed = int_mode;
} }
ir_mode *get_reference_mode_unsigned_eq(ir_mode *mode) ir_mode *get_reference_mode_unsigned_eq(const ir_mode *mode)
{ {
assert(mode_is_reference(mode)); assert(mode_is_reference(mode));
return mode->eq_unsigned; return mode->eq_unsigned;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment