From 0cf54b4f77ccf8376341950b02ceb7c1d1268ed7 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 30 Oct 2026 14:31:07 +0000 Subject: refactor(strings): construct string values implicitly from raw literals Keep double-quoted literals and text constants as C_STRING values. Use marked STRING constructors for text and CHAR conversion, preserving string operations and I/O through the existing class machinery. Co-Authored-By: Claude Opus 5.5 --- include/cps/CodeGen.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index c0ae997..4844861 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -139,17 +139,15 @@ class CodeGen { bool requireWritable(const SymbolInfo &Info, const std::string &Name); const SymbolInfo *lookupWritableSymbol(const std::string &Name); void emitConstantStmt(ConstantStmtAST *Stmt); - std::map StringConstants; const TypeInfo *requireStringType(); llvm::Value *emitStringFromCString(llvm::Value *Text); - llvm::Value *emitStringFromChar(llvm::Value *Ch); llvm::Value *emitCharFromString(ExprAST *Expr, int Line); 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; const FuncSig *findImplicitConstructor(const TypeInfo *Source, const TypeInfo *Target); - bool canImplicitlyConvert(const TypeInfo *Source, const TypeInfo *Target); + int implicitConversionRank(const TypeInfo *Source, const TypeInfo *Target); llvm::Value *emitImplicitConstruct(const FuncSig &Constructor, const TypeInfo *Target, llvm::Value *Argument, const std::vector &Transfers = {}); -- cgit v1.3.1-4-g156e