search for: some_struct

Displaying 3 results from an estimated 3 matches for "some_struct".

2020 May 07
2
Cast between struct
Dear All, In my development, a function returns a struct {i8*, i64}, and on the call site I need to assign the return value to a struct of type {some_struct*, i64}. One way to do it is to call the mutateType() method of llvm::Value on the return value of the function call; however, I’m concerned that this mutateType() method might be too disruptive (it’s discouraged to use it by the documentation). Since LLVM does not support cast between structs. Is t...
2020 May 07
2
Cast between struct
> On May 6, 2020, at 21:53, Krzysztof Parzyszek <kparzysz at quicinc.com> wrote: > > You can > 1. extract individual elements of {i8*, i64}, > 2. bitcast the first to some_struct*, > 3. insert them into a new struct of type {some_struct*, i64}. Thanks for the help. I’m thinking the same way. Now I’m stuck with how to create a struct; I know how to create a llvm::StructType but I’m not clear of how to create a Value whose type is struct). It seems that llvm disallowed di...
2018 Apr 22
2
Difference between "byval" and actually passing by value?
There appears to be a difference between passing by value:     call void @foo(%some_struct %v) And using the `byval` attribute on a pointer:     call void @foo(%some_struct* byval %v) They are not compatible with each other yet logically do the same thing.  The second form is the one that appears to work with the ABI on linux, and the first one not. What is the reason for the differe...