projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
959986e
)
Changed behaviour of new_ir_mode to accept all predefined modes.
author
Matthias Heil
<heil@ipd.info.uni-karlsruhe.de>
Wed, 6 Aug 2003 12:54:05 +0000
(12:54 +0000)
committer
Matthias Heil
<heil@ipd.info.uni-karlsruhe.de>
Wed, 6 Aug 2003 12:54:05 +0000
(12:54 +0000)
[r1638]
ir/ir/irmode.c
patch
|
blob
|
history
diff --git
a/ir/ir/irmode.c
b/ir/ir/irmode.c
index
fe8e54c
..
605607c
100644
(file)
--- a/
ir/ir/irmode.c
+++ b/
ir/ir/irmode.c
@@
-226,29
+226,6
@@
ir_mode *new_ir_mode(const char *name, mode_sort sort, int bit_size, int align,
ir_mode mode_tmpl;
ir_mode *mode;
ir_mode mode_tmpl;
ir_mode *mode;
- /* sanity checks */
- switch (sort)
- {
- case irms_auxiliary:
- case irms_control_flow:
- case irms_memory:
- case irms_internal_boolean:
- assert(0 && "internal modes cannot be user defined");
- return NULL;
- break;
-
- case irms_float_number:
- if(arithmetic != irma_ieee754) {
- assert(0 && "not yet implemented");
- return NULL;
- }
- break;
-
- case irms_int_number:
- case irms_reference:
- case irms_character:
- break;
- }
mode_tmpl.name = new_id_from_str(name);
mode_tmpl.sort = sort;
mode_tmpl.size = bit_size;
mode_tmpl.name = new_id_from_str(name);
mode_tmpl.sort = sort;
mode_tmpl.size = bit_size;
@@
-258,16
+235,32
@@
ir_mode *new_ir_mode(const char *name, mode_sort sort, int bit_size, int align,
mode_tmpl.link = NULL;
mode_tmpl.tv_priv = NULL;
mode_tmpl.link = NULL;
mode_tmpl.tv_priv = NULL;
- /* first check if there already is a matching mode */
mode = find_mode(&mode_tmpl);
if (mode)
{
return mode;
}
mode = find_mode(&mode_tmpl);
if (mode)
{
return mode;
}
- else
+
+ /* sanity checks */
+ switch (sort)
{
{
- return register_mode(&mode_tmpl);
+ case irms_auxiliary:
+ case irms_control_flow:
+ case irms_memory:
+ case irms_internal_boolean:
+ assert(0 && "internal modes cannot be user defined");
+ return NULL;
+
+ case irms_float_number:
+ assert(0 && "not yet implemented");
+ return NULL;
+
+ case irms_int_number:
+ case irms_reference:
+ case irms_character:
+ return register_mode(&mode_tmpl);
}
}
+ return NULL; /* to shut up gcc */
}
/* Functions for the direct access to all attributes od a ir_mode */
}
/* Functions for the direct access to all attributes od a ir_mode */