diff options
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
-rw-r--r-- | gcc/rust/rust-gcc.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index f8033af..9a13332 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -187,6 +187,8 @@ public: int get_pointer_size (); + Btype *raw_str_type (); + Btype *integer_type (bool, int); Btype *float_type (int); @@ -804,6 +806,14 @@ Gcc_backend::get_pointer_size () } Btype * +Gcc_backend::raw_str_type () +{ + tree char_ptr = build_pointer_type (char_type_node); + tree const_char_type = build_qualified_type (char_ptr, TYPE_QUAL_CONST); + return this->make_type (const_char_type); +} + +Btype * Gcc_backend::integer_type (bool is_unsigned, int bits) { tree type; @@ -1427,8 +1437,7 @@ Bexpression * Gcc_backend::string_constant_expression (const std::string &val) { tree index_type = build_index_type (size_int (val.length ())); - tree const_char_type - = build_qualified_type (unsigned_char_type_node, TYPE_QUAL_CONST); + tree const_char_type = build_qualified_type (char_type_node, TYPE_QUAL_CONST); tree string_type = build_array_type (const_char_type, index_type); TYPE_STRING_FLAG (string_type) = 1; tree string_val = build_string (val.length (), val.data ()); |