diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-13 05:25:09 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-13 05:25:09 +0000 |
| commit | 38ff4e782ef844a21512eb2ca0e491387ae89ec5 (patch) | |
| tree | d9097aa5c8c5989b7dd4f9ee1c34dbcf28750fcb /include | |
| parent | a6fc1625ea8f825a7161354eb9167a281542fa29 (diff) | |
fix: compare strings by content
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/cps/FileHandler.h | 4 | ||||
| -rw-r--r-- | include/cps/StringHandler.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/cps/FileHandler.h b/include/cps/FileHandler.h index aaad6a0..3898a57 100644 --- a/include/cps/FileHandler.h +++ b/include/cps/FileHandler.h @@ -11,8 +11,8 @@ class RuntimeCheck; // Emits the text-file runtime: a fixed-size open-file table plus internal // __cps_file_* helper functions, synthesized once on first use so programs // without file statements keep their IR unchanged. The table is keyed by -// filename *content* (strcmp) — pseudocode STRING equality is pointer -// identity, so the same file may be named by many different buffers. +// filename *content* (strcmp), so the same file may be named by many +// different buffers. // Leaf module: methods only take and return llvm::Value*s; expression // evaluation, type coercion and the symbol table stay in CodeGen. class FileHandler { diff --git a/include/cps/StringHandler.h b/include/cps/StringHandler.h index e9a8752..0b2447c 100644 --- a/include/cps/StringHandler.h +++ b/include/cps/StringHandler.h @@ -16,6 +16,7 @@ class StringHandler { llvm::FunctionCallee MemCpyFunc; llvm::FunctionCallee StrCpyFunc; llvm::FunctionCallee StrCatFunc; + llvm::FunctionCallee StrCmpFunc; llvm::FunctionCallee ToUpperFunc; llvm::FunctionCallee ToLowerFunc; @@ -30,6 +31,7 @@ public: llvm::Value *emitLength(llvm::Value *Str); llvm::Value *emitConcat(llvm::Value *LHS, llvm::Value *RHS); + llvm::Value *emitCompare(int Op, llvm::Value *LHS, llvm::Value *RHS); llvm::Value *emitMid(llvm::Value *Str, llvm::Value *Start, llvm::Value *Len); llvm::Value *emitRight(llvm::Value *Str, llvm::Value *Len); llvm::Value *emitLeft(llvm::Value *Str, llvm::Value *Len); |
