17 const std::string &message,
26 std::ostringstream formatted_message;
29 formatted_message <<
"error: warning treated as error\n";
33 formatted_message << file <<
'(' << line <<
"): ";
36 formatted_message <<
"error: ";
38 formatted_message <<
"warning: ";
40 formatted_message << message;
42 const auto full_path = location.
full_path();
44 if(full_path.has_value() && !line.empty())
50 const auto line_number = std::stoull(line);
51 std::string source_line;
52 for(std::size_t l = 0; l < line_number; l++)
53 std::getline(in, source_line);
57 formatted_message <<
'\n';
58 formatted_message << file <<
'(' << line <<
"): " << source_line;
void print(unsigned, const xmlt &) override
void print(unsigned, const xmlt &) override
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const irep_idt & get_line() const
const irep_idt & get_file() const
std::optional< std::string > full_path() const
Get a path to the file, including working directory.
const std::string & id2string(const irep_idt &d)
#define widen_if_needed(s)