Add string type
This commit is contained in:
@ -4,8 +4,23 @@
|
||||
|
||||
tree elna_global_trees[ELNA_TI_MAX];
|
||||
|
||||
void elna_init_ttree(void)
|
||||
namespace elna
|
||||
{
|
||||
elna_char_type_node = make_unsigned_type(8);
|
||||
TYPE_STRING_FLAG(elna_char_type_node) = 1;
|
||||
namespace gcc
|
||||
{
|
||||
void init_ttree()
|
||||
{
|
||||
elna_char_type_node = make_unsigned_type(8);
|
||||
elna_string_type_node = build_pointer_type(
|
||||
build_qualified_type(char_type_node, TYPE_QUAL_CONST)); /* const char* */
|
||||
TYPE_STRING_FLAG(elna_char_type_node) = 1;
|
||||
}
|
||||
|
||||
bool is_string_type(tree type)
|
||||
{
|
||||
gcc_assert(TYPE_P(type));
|
||||
return TREE_CODE(type) == POINTER_TYPE
|
||||
&& TYPE_MAIN_VARIANT(TREE_TYPE(type)) == char_type_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user