diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 03:33:22 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 03:58:36 +0000 |
| commit | 0881f6881161fc30953b872ae108e5a8d359cb5c (patch) | |
| tree | 8f157814db90683fb390ea767b4f3c24e769fd7b /include | |
| parent | a84128bbc1b69ab5b763d2c607b6f9f1c667802b (diff) | |
refactor(codegen): share the READ-mode check of file read and EOF helpers
__cps_file_read and __cps_file_eof both emitted the same mode load,
comparison and ErrNotRead check after the slot lookup; emit it through
FileHandler::emitRequireReadMode instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/cps/FileHandler.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/cps/FileHandler.h b/include/cps/FileHandler.h index 20ece16..fc754e8 100644 --- a/include/cps/FileHandler.h +++ b/include/cps/FileHandler.h @@ -54,6 +54,7 @@ class FileHandler { llvm::Function *createHelper(const char *Name, llvm::FunctionType *FT); llvm::Value *emitSlotGEP(llvm::GlobalVariable *Table, llvm::Type *ElemTy, llvm::Value *Idx); llvm::Value *emitLookupOrFail(llvm::Value *Name, llvm::Value *Line); + void emitRequireReadMode(llvm::Value *Idx, llvm::Value *Name, llvm::Value *Line); void buildFindFn(); void buildOpenFn(); void buildReadFn(); |
