Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ValueTracking] Add CharWidth argument to getConstantStringInfo (NFC) #106541

Draft
wants to merge 1 commit into
base: users/s-barannikov/byte/5-match-ptradd
Choose a base branch
from

Conversation

s-barannikov
Copy link
Contributor

The method assumes that host chars and target chars have the same width.
Add a CharWidth argument so that it can bail out if the requested char
width differs from the host char width.

Alternatively, the check could be done at call sites, but this is more
error-prone.

In the future, this method will be replaced with a different one that
allows host/target chars to have different widths. The prototype will
be the same except that StringRef is replaced with something that is
byte width agnostic. Adding CharWidth argument now reduces the future
diff.

@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 7cca421 to 14e8b41 Compare October 27, 2024 00:57
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from e5b70fc to cdb7292 Compare October 27, 2024 00:57
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 14e8b41 to 61be980 Compare October 27, 2024 01:34
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from cdb7292 to d27bc30 Compare October 27, 2024 01:35
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 61be980 to 222a3b7 Compare October 27, 2024 01:39
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from d27bc30 to deca69b Compare October 27, 2024 01:40
The method assumes that host chars and target chars have the same width.
Add a CharWidth argument so that it can bail out if the requested char
width differs from the host char width.

Alternatively, the check could be done at call sites, but this is more
error-prone.

In the future, this method will be replaced with a different one that
allows host/target chars to have different widths. The prototype will
be the same except that StringRef is replaced with something that is
byte width agnostic. Adding CharWidth argument now reduces the future
diff.
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/5-match-ptradd branch from 222a3b7 to 26dc400 Compare February 4, 2025 14:01
@s-barannikov s-barannikov force-pushed the users/s-barannikov/byte/6-string-info-char-width branch from deca69b to 57104d1 Compare February 4, 2025 14:02
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.

1 participant