diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 03:45:06 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 03:58:26 +0000 |
| commit | 1d2bb133b7a3540aeb81c5f9616cb366aebc919f (patch) | |
| tree | b4b90c1d991ad8dd05033dfbdbb18a60a1343cfe /lib/CodeGen/ExpressionGen.cc | |
| parent | 91e506e404c0d285ec1ec77196e83248c8c77161 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/ExpressionGen.cc')
| -rw-r--r-- | lib/CodeGen/ExpressionGen.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/CodeGen/ExpressionGen.cc b/lib/CodeGen/ExpressionGen.cc index 3377a39..ece055a 100644 --- a/lib/CodeGen/ExpressionGen.cc +++ b/lib/CodeGen/ExpressionGen.cc @@ -225,11 +225,7 @@ Value *CodeGen::emitCall(const std::string &Callee, return Memory->emitRelease(Address, Line); } if (Name == "EOF") { - if (isWholeArrayVar(ArgExprs[0].get())) { - reportError("Cannot use a whole array as the EOF filename"); - return nullptr; - } - Value *FileName = emitCStringExpr(ArgExprs[0].get()); + Value *FileName = emitFileNameOperand(ArgExprs[0].get(), "EOF"); if (!FileName) return nullptr; return Files->emitEof(FileName, Line); } |
