aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGen.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 09:09:03 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 09:09:03 +0000
commitdc645a36aaade7087ade574cefe69ce7bb29753e (patch)
treed10a4f3ab8947c014f79b940d4658e9ff9730e9d /lib/CodeGen/CodeGen.cc
parent5097edca0619007eb4237e52fcc07f0e0b4b99e2 (diff)
refactor(diag): file-qualified diagnostic locations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/CodeGen.cc')
-rw-r--r--lib/CodeGen/CodeGen.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGen.cc b/lib/CodeGen/CodeGen.cc
index 0107910..d3459ef 100644
--- a/lib/CodeGen/CodeGen.cc
+++ b/lib/CodeGen/CodeGen.cc
@@ -1,3 +1,4 @@
+#include "cps/Diagnostics.h"
#include "cps/CodeGen.h"
#include "cps/ArrayHandler.h"
#include "cps/FileHandler.h"
@@ -25,7 +26,7 @@ void CodeGen::reportError(const char *Fmt, ...) {
va_start(Args, Fmt);
fprintf(stderr, "error: ");
vfprintf(stderr, Fmt, Args);
- if (DiagnosticLine) fprintf(stderr, " at line %d", DiagnosticLine);
+ if (DiagnosticLine) fprintf(stderr, "%s", lineSuffix(DiagnosticLine).c_str());
fprintf(stderr, "\n");
va_end(Args);
HadError = true;