elna/gcc/elna-tree.cc

27 lines
612 B
C++
Raw Normal View History

2024-12-29 22:28:53 +01:00
#include "elna/gcc/elna-tree.h"
2025-01-01 23:02:19 +01:00
#include "stor-layout.h"
2024-12-29 22:28:53 +01:00
tree elna_global_trees[ELNA_TI_MAX];
2025-01-01 23:02:19 +01:00
2025-01-03 22:18:35 +01:00
namespace elna
2025-01-01 23:02:19 +01:00
{
2025-01-03 22:18:35 +01:00
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;
}
}
2025-01-01 23:02:19 +01:00
}