/* AILang Str runtime primitives. * * Provides ABI-stable string operations against the existing * constant-Str layout (NUL-terminated byte buffer, passed as * `ptr` in LLVM IR). Lives separately from runtime/rc.c so that * a future heap-Str ABI milestone can swap the implementations * without touching the RC runtime. * * Linked unconditionally by `ail build` (Gc, Bump, Rc) so that * any program that monomorphises `eq__Str` (auto-loaded from * the prelude) finds the symbol. Programs that never call * `eq` on Str leave @ail_str_eq as a dead-stripped no-op at * link time under clang -O2. */ #include #include /* Byte-equality on NUL-terminated strings. Mirrors strcmp(...) == 0 * but exposed under a stable AILang-namespaced ABI so the codegen * caller does not assume libc's strcmp shape. Heap-Str ABI milestone * will replace the body with length-prefixed comparison without * changing the signature. */ bool ail_str_eq(const char *a, const char *b) { return strcmp(a, b) == 0; }