#ifdef HAVE_STRINGS_H
#include <strings.h> /* strings.h also includes bsd only function strcasecmp */
#endif
-#include <stdlib.h>
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#include "strcalc.h"
#include "fltcalc.h"
#include "irtools.h"
+#include "firm_common.h"
/** Size of hash tables. Should correspond to average number of distinct constant
target values */
return hash;
}
-/* finds tarval with value/mode or creates new tarval */
+/** finds tarval with value/mode or creates new tarval */
static tarval *get_tarval(const void *value, int length, ir_mode *mode)
{
tarval tv;
- tv.mode = mode;
+ tv.kind = k_tarval;
+ tv.mode = mode;
tv.length = length;
if (length > 0) {
/* if there already is such a value, it is returned, else value
case irms_int_number:
case irms_character:
- sc_val_from_str(str, len, NULL);
+ sc_val_from_str(str, len, NULL, mode);
return get_tarval(sc_get_buffer(), sc_get_buffer_length(), mode);
case irms_reference:
break;
}
return get_tarval(fc_get_buffer(), fc_get_buffer_length(), m);
-
#if 0
case irms_reference:
/* allow 0 to be casted */
{
ANNOUNCE();
+ tarval_bad->kind = k_tarval;
tarval_bad->mode = mode_BAD;
+
+ tarval_undefined->kind = k_tarval;
tarval_undefined->mode = mode_ANY;
+
+ tarval_b_true->kind = k_tarval;
tarval_b_true->mode = mode_b;
+
+ tarval_b_false->kind = k_tarval;
tarval_b_false->mode = mode_b;
+
+ tarval_P_void->kind = k_tarval;
tarval_P_void->mode = mode_P;
/*