Implement .max and .min type properties
This commit is contained in:
@ -30,6 +30,18 @@ namespace gcc
|
||||
return linemap_position_for_column(line_table, position->column);
|
||||
}
|
||||
|
||||
std::string print_aggregate_name(tree type, const std::string& kind_name)
|
||||
{
|
||||
if (TYPE_IDENTIFIER(type) == NULL_TREE)
|
||||
{
|
||||
return kind_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::string(IDENTIFIER_POINTER(TYPE_IDENTIFIER(type)));
|
||||
}
|
||||
}
|
||||
|
||||
std::string print_type(tree type)
|
||||
{
|
||||
gcc_assert(TYPE_P(type));
|
||||
@ -68,7 +80,7 @@ namespace gcc
|
||||
}
|
||||
else if (is_pointer_type(type))
|
||||
{
|
||||
return std::string("pointer to " + print_type(TREE_TYPE(type)));
|
||||
return std::string("^" + print_type(TREE_TYPE(type)));
|
||||
}
|
||||
else if (is_procedure_type(type))
|
||||
{
|
||||
@ -100,11 +112,11 @@ namespace gcc
|
||||
}
|
||||
else if (TREE_CODE(type) == RECORD_TYPE)
|
||||
{
|
||||
return "record";
|
||||
return print_aggregate_name(type, "record");
|
||||
}
|
||||
else if (TREE_CODE(type) == UNION_TYPE)
|
||||
{
|
||||
return "union";
|
||||
return print_aggregate_name(type, "union");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user