17 const std::string &message,
26 std::ostringstream formatted_message;
30 formatted_message <<
file <<
'(' << line <<
"): ";
33 formatted_message <<
"error: ";
35 formatted_message <<
"warning: ";
37 formatted_message << message;
39 const auto full_path = location.
full_path();
41 if(full_path.has_value() && !line.empty())
47 const auto line_number = std::stoull(line);
48 std::string source_line;
49 for(std::size_t l = 0; l < line_number; l++)
50 std::getline(in, source_line);
54 formatted_message <<
'\n';
55 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.
optionalt< std::string > full_path() const
Get a path to the file, including working directory.
const irep_idt & get_file() const
const irep_idt & get_line() const
const std::string & id2string(const irep_idt &d)
#define widen_if_needed(s)