Skip to content

Conversation

@vdka
Copy link
Contributor

@vdka vdka commented Sep 19, 2017

This PR adds an initializer to create a constant string using

ArrayType.constant(string: "asdf")

It wraps LLVMConstStringInContext

Copy link
Member

@harlanhaskins harlanhaskins left a comment

Choose a reason for hiding this comment

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

LGTM mod the comment nit


/// Creates a constant array value of i8 from a swift string.
///
/// - parameter string: A string to create a null terminated array from.
Copy link
Member

Choose a reason for hiding this comment

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

Can you be explicit about this being the UTF-8 bytes of the string?

Copy link
Contributor Author

@vdka vdka Sep 19, 2017

Choose a reason for hiding this comment

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

Creates a constant, null terminated array value of utf8 bytes from string's utf8 member.

Good?

Copy link
Member

Choose a reason for hiding this comment

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

Use “UTF-8” for the first one and surround the 2nd utf8 in code voice and we’re good.

@vdka vdka merged commit 7fc4caf into llvm-swift:master Sep 19, 2017
@vdka vdka deleted the const-string branch September 19, 2017 01:18
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