From 62b605c6c0ea13e9763c0a0115464007b13a8831 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 20 Oct 2026 11:57:16 +0000 Subject: refactor(strings): replace compiler builtins with the STRING library Construct literals as STRING values and route string operations through ordinary library functions and operators. Preserve value ownership in records, arrays, constants and file I/O. Co-Authored-By: Claude Opus 5.5 --- include/cps/StringConversionHandler.h | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 include/cps/StringConversionHandler.h (limited to 'include/cps/StringConversionHandler.h') diff --git a/include/cps/StringConversionHandler.h b/include/cps/StringConversionHandler.h deleted file mode 100644 index c4879aa..0000000 --- a/include/cps/StringConversionHandler.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -#include "llvm/IR/IRBuilder.h" -#include "llvm/IR/LLVMContext.h" -#include "llvm/IR/Module.h" - -namespace cps { - -class StringConversionHandler { - llvm::LLVMContext &Context; - llvm::IRBuilder<> &Builder; - llvm::Module &Module; - - llvm::FunctionCallee SnprintfFunc; - llvm::FunctionCallee StrtollFunc; - llvm::FunctionCallee StrtodFunc; - llvm::FunctionCallee MallocFunc; - -public: - StringConversionHandler(llvm::LLVMContext &Ctx, llvm::IRBuilder<> &B, llvm::Module &M); - - void setupExternalFunctions(); - - // NUM TO STR(x) RETURNS STRING - llvm::Value *emitNumToStr(llvm::Value *Num, bool IsReal); - - // STR TO NUM(x) RETURNS NUMBER - llvm::Value *emitStrToNum(llvm::Value *Str, bool AsReal); - - // IS NUM(ThisString) RETURNS BOOLEAN - llvm::Value *emitIsNum(llvm::Value *Str); -}; - -} // namespace cps -- cgit v1.3.1-4-g156e