Displaying 2 results from an estimated 2 matches for "const_gep".
Did you mean:
const_get
2010 Mar 05
3
[LLVMdev] Pointer to String Constant
...and I've run into a small problem. I wrote
the following piece of code to generate a pointer to a string constant, so I
could compile C expressions of the form "const char* p = "test\n";" :
let strval = const_stringz codecontext v in
dump_value strval;
dump_value i32_zero;
const_gep strval [| i32_zero; i32_zero |]
The dump statements I put confirm that the string array and the index values
have the types I would expect:
[6 x i8] c"test\0A\00"
i32 0
However, the code still seems to break an assertion:
Constants.cpp:1487: static llvm::Constant*
llvm::ConstantExpr::...
2010 Mar 05
0
[LLVMdev] Pointer to String Constant
...lem. I wrote
> the following piece of code to generate a pointer to a string constant, so I
> could compile C expressions of the form "const char* p = "test\n";" :
>
> let strval = const_stringz codecontext v in
> dump_value strval;
> dump_value i32_zero;
> const_gep strval [| i32_zero; i32_zero |]
>
> The dump statements I put confirm that the string array and the index values
> have the types I would expect:
>
> [6 x i8] c"test\0A\00"
> i32 0
>
> However, the code still seems to break an assertion:
>
> Constants.cpp...