llvm-capstone/flang/message.cc
2018-01-30 11:53:49 -08:00

25 lines
515 B
C++

#include "message.h"
namespace Fortran {
std::ostream &operator<<(std::ostream &o, const Message &msg) {
if (msg.context()) {
o << *msg.context();
}
o << "at line " << msg.position().lineNumber();
int column = msg.position().column();
if (column > 0) {
o << "(column " << column << ")";
}
o << ": " << msg.message() << '\n';
return o;
}
std::ostream &operator<<(std::ostream &o, const Messages &ms) {
for (const auto &msg : ms) {
o << msg;
}
return o;
}
} // namespace Fortran