Skip to content

string: unify string types on i8*#223

Open
omsherikar wants to merge 1 commit intoarxlang:mainfrom
omsherikar:string-model-130
Open

string: unify string types on i8*#223
omsherikar wants to merge 1 commit intoarxlang:mainfrom
omsherikar:string-model-130

Conversation

@omsherikar
Copy link
Contributor

Solves #130

Copilot AI review requested due to automatic review settings March 13, 2026 18:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR unifies string types in the LLVM IR builder by removing the STRING_TYPE (which was a {i32, i8*} struct) and standardizing all string representations on i8* (ASCII_STRING_TYPE). This resolves issue #130 where two incompatible string models coexisted.

Changes:

  • Removed STRING_TYPE field from VariablesLLVM and its initialization as a LiteralStructType
  • Consolidated get_data_type so "string", "stringascii", and "utf8string" all resolve to ASCII_STRING_TYPE
  • Updated UTF8_STRING_TYPE to alias ASCII_STRING_TYPE (both now i8*) and updated the cast visitor accordingly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/irx/builders/llvmliteir.py Removes STRING_TYPE, unifies all string type lookups to ASCII_STRING_TYPE (i8*)
tests/test_llvmlite_helpers.py Updates test assertion to expect ASCII_STRING_TYPE instead of UTF8_STRING_TYPE

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -134,7 +134,7 @@ def test_get_data_type_aliases_and_invalid() -> None:
assert llvm_vars.get_data_type("float16") == llvm_vars.FLOAT16_TYPE
assert llvm_vars.get_data_type("double") == llvm_vars.DOUBLE_TYPE
assert llvm_vars.get_data_type("char") == llvm_vars.INT8_TYPE
@omsherikar
Copy link
Contributor Author

@yuvimittal please look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants