aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGen.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-18 08:04:15 +0000
committer_ov4 <ov4@ov4.org>2026-10-18 08:04:15 +0000
commit927e3fc0384c941f9ad313a28768660c3cdb1777 (patch)
treeee82bef8d8332dad79d05db87f33979f0e7eb423 /lib/CodeGen/CodeGen.cc
parent34a4998658674411ef3b5a392483990467a5d6e2 (diff)
feat(driver): add #LIB directive hiding library lines in runtime errors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/CodeGen.cc')
-rw-r--r--lib/CodeGen/CodeGen.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGen.cc b/lib/CodeGen/CodeGen.cc
index f7c4de6..c9d8c1a 100644
--- a/lib/CodeGen/CodeGen.cc
+++ b/lib/CodeGen/CodeGen.cc
@@ -161,6 +161,11 @@ void CodeGen::selectUnit(size_t Unit) {
CurrentUnit = Unit;
DiagnosticSource = Units->size() > 1 ? (*Units)[Unit].Path : "";
FuncGen->setCurrentUnit(Unit, (*Units)[Unit].Path);
+ RuntimeChecker->setLibraryMode((*Units)[Unit].IsLibrary);
+ FuncGen->setCallHook([this](const FuncSig &Sig) {
+ if (!(*Units)[CurrentUnit].IsLibrary && (*Units)[Sig.OwnerUnit].IsLibrary)
+ RuntimeChecker->setUserLine(DiagnosticLine);
+ });
}
void CodeGen::importSymbols() {