2024-12-27 23:38:25 +01:00
|
|
|
#include "elna/gcc/elna-diagnostic.h"
|
|
|
|
|
2024-12-28 14:33:35 +01:00
|
|
|
namespace elna
|
2024-12-27 23:38:25 +01:00
|
|
|
{
|
2024-12-28 14:33:35 +01:00
|
|
|
namespace gcc
|
2024-12-27 23:38:25 +01:00
|
|
|
{
|
2024-12-28 14:33:35 +01:00
|
|
|
location_t get_location(const elna::source::position *position)
|
2024-12-27 23:38:25 +01:00
|
|
|
{
|
2024-12-28 14:33:35 +01:00
|
|
|
linemap_line_start(line_table, position->line, 0);
|
|
|
|
|
|
|
|
return linemap_position_for_column(line_table, position->column);
|
2024-12-27 23:38:25 +01:00
|
|
|
}
|
2024-12-28 14:33:35 +01:00
|
|
|
|
|
|
|
const char *print_type(tree type)
|
2024-12-27 23:38:25 +01:00
|
|
|
{
|
2024-12-28 14:33:35 +01:00
|
|
|
gcc_assert(TYPE_P(type));
|
|
|
|
|
|
|
|
if (type == integer_type_node)
|
|
|
|
{
|
|
|
|
return "Int";
|
|
|
|
}
|
|
|
|
else if (type == boolean_type_node)
|
|
|
|
{
|
|
|
|
return "Boolean";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return "<<unknown-type>>";
|
|
|
|
}
|
2024-12-27 23:38:25 +01:00
|
|
|
}
|
|
|
|
}
|
2024-12-28 14:33:35 +01:00
|
|
|
}
|