{
tree charvec;
tree argpack = make_node (NONTYPE_ARGUMENT_PACK);
- const char *str = TREE_STRING_POINTER (value);
+ const unsigned char *str
+ = (const unsigned char *) TREE_STRING_POINTER (value);
int sz = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (value))));
int len = TREE_STRING_LENGTH (value) / sz - 1;
tree argvec = make_tree_vec (2);
/* Fill in CHARVEC with all of the parameters. */
charvec = make_tree_vec (len);
- if (sz == 1)
- {
- for (int i = 0; i < len; ++i)
- TREE_VEC_ELT (charvec, i) = build_int_cst (str_char_type_node, str[i]);
- }
- else if (sz == 2)
- {
- const uint16_t *num = (const uint16_t *)str;
- for (int i = 0; i < len; ++i)
- TREE_VEC_ELT (charvec, i) = build_int_cst (str_char_type_node, num[i]);
- }
- else if (sz == 4)
- {
- const uint32_t *num = (const uint32_t *)str;
- for (int i = 0; i < len; ++i)
- TREE_VEC_ELT (charvec, i) = build_int_cst (str_char_type_node, num[i]);
- }
+ for (int i = 0; i < len; ++i)
+ TREE_VEC_ELT (charvec, i)
+ = double_int_to_tree (str_char_type_node,
+ double_int::from_buffer (str + i * sz, sz));
/* Build the argument packs. */
SET_ARGUMENT_PACK_ARGS (argpack, charvec);