Index strings
This commit is contained in:
@ -58,11 +58,43 @@ namespace gcc
|
||||
{
|
||||
return "Char";
|
||||
}
|
||||
else if (type == elna_string_type_node)
|
||||
{
|
||||
return "String";
|
||||
}
|
||||
else if (is_void_type(type)) // For procedures without a return type.
|
||||
{
|
||||
return "()";
|
||||
}
|
||||
else if (is_pointer_type(type))
|
||||
{
|
||||
return std::string("\"pointer to " + print_type(TREE_TYPE(type)) + "\"");
|
||||
return std::string("pointer to " + print_type(TREE_TYPE(type)));
|
||||
}
|
||||
else if (TREE_CODE(type) == ARRAY_TYPE)
|
||||
else if (is_procedure_type(type))
|
||||
{
|
||||
std::string output = "proc(";
|
||||
tree parameter_type = TYPE_ARG_TYPES(type);
|
||||
while (parameter_type != NULL_TREE)
|
||||
{
|
||||
output += print_type(TREE_VALUE(parameter_type));
|
||||
parameter_type = TREE_CHAIN(parameter_type);
|
||||
if (TREE_VALUE(parameter_type) == void_type_node)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
output += ", ";
|
||||
}
|
||||
}
|
||||
output += ')';
|
||||
if (!is_void_type(TREE_TYPE(type)))
|
||||
{
|
||||
output += " -> " + print_type(TREE_TYPE(type));
|
||||
}
|
||||
return output;
|
||||
}
|
||||
else if (is_array_type(type))
|
||||
{
|
||||
return "array";
|
||||
}
|
||||
@ -78,6 +110,7 @@ namespace gcc
|
||||
{
|
||||
return "<<unknown-type>>";
|
||||
}
|
||||
gcc_unreachable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user