summaryrefslogtreecommitdiff
path: root/willow/lib/IR/Diagnostic.cpp
diff options
context:
space:
mode:
authorStefan Weigl-Bosker <stefan@s00.xyz>2026-02-19 18:45:44 -0500
committerStefan Weigl-Bosker <stefan@s00.xyz>2026-02-19 18:45:44 -0500
commitaf3d0ad1926eb825f64152cf217fc9a4777f0be3 (patch)
tree8d7f73ce6c3c89863418382d8d553a06c668bbb3 /willow/lib/IR/Diagnostic.cpp
parentd11fbc8268f5775ad783f8570478daad4a9e81cf (diff)
downloadcompiler-af3d0ad1926eb825f64152cf217fc9a4777f0be3.tar.gz
[willow]: more cleanup, testsmore-tests
Diffstat (limited to 'willow/lib/IR/Diagnostic.cpp')
-rw-r--r--willow/lib/IR/Diagnostic.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/willow/lib/IR/Diagnostic.cpp b/willow/lib/IR/Diagnostic.cpp
new file mode 100644
index 0000000..0e2c8bd
--- /dev/null
+++ b/willow/lib/IR/Diagnostic.cpp
@@ -0,0 +1,10 @@
+#include <willow/IR/Diagnostic.h>
+#include <ostream>
+
+//TODO
+std::ostream &operator<<(std::ostream &os, const willow::Diagnostic &diagnostic) {
+ if (diagnostic.location)
+ return os << diagnostic.location.value() << ": " << diagnostic.message;
+ else
+ return os << "<unknown>: " << diagnostic.message;
+}