From 1d2bb133b7a3540aeb81c5f9616cb366aebc919f Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 03:45:06 +0000 Subject: refactor(codegen): share file keyword filename operand emission EOF, OPENFILE, READFILE and CLOSEFILE each rejected a whole-array filename and then emitted it as a C string. Route them through a private emitFileNameOperand helper; diagnostics are unchanged. WRITEFILE keeps its own combined check. Co-Authored-By: Claude Opus 5.5 --- include/cps/CodeGen.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 73068bf..2d77284 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -128,6 +128,7 @@ class CodeGen { llvm::Value *emitStringFromCString(llvm::Value *Text); llvm::Value *emitStringCString(llvm::Value *Value); llvm::Value *emitCStringExpr(ExprAST *Expr); + llvm::Value *emitFileNameOperand(ExprAST *E, const char *Keyword); bool containsString(const TypeInfo *Type) const; std::unique_ptr Types; -- cgit v1.3.1-4-g156e