TheDan64 / inkwell

It's a New Kind of Wrapper for Exposing LLVM (Safely)
https://thedan64.github.io/inkwell/
Apache License 2.0
2.38k stars 229 forks source link

`Context::const_string` returns incorrect type #390

Closed endorpersand closed 1 year ago

endorpersand commented 1 year ago

Describe the Bug Context::const_string returns a VectorValue, when it is supposed to return an ArrayValue.

To Reproduce The example in the docs clearly shows that the function does not return a VectorValue:

use inkwell::context::Context;
use inkwell::values::AnyValue;

let context = Context::create();
let string = context.const_string(b"my_string", false);

assert_eq!(string.print_to_string().to_string(), "[9 x i8] c\"my_string\"");

Expected Behavior Context::const_string should return an ArrayValue.

LLVM Version (please complete the following information):

Desktop (please complete the following information):

TheDan64 commented 1 year ago

Good catch, would you like to file a PR?