Working with Constant Expressions #565
Unanswered
iamrecursion
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I've come across this occasionally, you can use use llvm_sys::core as llvm:
...
// `ty` is `AnyTypeEnum<..>` or some other type that implements `AsTypeRef`
// `value` is `AnyValueEnum<..>` or some other type that implements `AsValueRef`
let my_cast_value = unsafe {
AnyValueEnum::new(llvm::LLVMConstIntToPtr(value.as_value_ref(), ty.as_type_ref()))
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to process externally generated LLVM IR with Inkwell, and I am running into LLVM constant expressions. As far as I can tell, Inkwell does not provide a way to access details about these constant expressions, which is making it quite difficult for me to act upon them.
Does anybody know a route (either in pure inkwell or unsafe usage of llvm-sys) that would let me discover that a given constant integer is, for example, a
ptrtoint
constant expression?Beta Was this translation helpful? Give feedback.
All reactions