diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-18 08:04:15 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-18 08:04:15 +0000 |
| commit | 927e3fc0384c941f9ad313a28768660c3cdb1777 (patch) | |
| tree | ee82bef8d8332dad79d05db87f33979f0e7eb423 /include/cps/RuntimeCheck.h | |
| parent | 34a4998658674411ef3b5a392483990467a5d6e2 (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 'include/cps/RuntimeCheck.h')
| -rw-r--r-- | include/cps/RuntimeCheck.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/cps/RuntimeCheck.h b/include/cps/RuntimeCheck.h index 30a1910..d2ee1ea 100644 --- a/include/cps/RuntimeCheck.h +++ b/include/cps/RuntimeCheck.h @@ -18,6 +18,8 @@ class RuntimeCheck { llvm::FunctionCallee StderrFunc; // Windows: __acrt_iob_func(2) llvm::GlobalVariable *StderrVar; // elsewhere: the C library's stderr ExceptionHandler &Exceptions; + bool LibraryMode = false; + llvm::GlobalVariable *UserLine; llvm::Value *DivZeroMsg; llvm::Value *OutOfBoundsMsg; llvm::Value *EnumRangeMsg; @@ -31,6 +33,10 @@ public: RuntimeCheck(llvm::Module &M, llvm::LLVMContext &C, llvm::IRBuilder<> &B, ExceptionHandler &EH); + void setLibraryMode(bool Enabled) { LibraryMode = Enabled; } + llvm::Value *lineValue(int Line); + void setUserLine(int Line); + // Format a runtime diagnostic (printf-style) and write it to stderr. void emitStderr(llvm::Value *Msg, llvm::ArrayRef<llvm::Value *> FmtArgs = {}); |
