Displaying 2 results from an estimated 2 matches for "create_test".
2019 Apr 12
3
Generating C headers from LLVM
...y way to generate proper C header files for functions that
are defined in LLVM-IR. My current attempts fail when clang does some
fancy transformations (to adhere to some ABIs ??), e.g., for returning
a struct.
For example the declaration
typedef struct {int64_t a; int64_t b;int64_t c;} test;
test create_test(void);yields the LLVM code
%struct.test = type { i64, i64, i64 }
declare void @create_test(%struct.test* sret) #1
However, the function is defined in LLVM-IR as
{i64,i64,i64} @create_test()
Questions:
1) Is there any way to convince clang to generate the "correct" output,
that fits the...
2019 Apr 12
2
Generating C headers from LLVM
...ed in LLVM-IR. My current attempts fail when clang does some
> > fancy transformations (to adhere to some ABIs ??), e.g., for returning
> > a struct.
> >
> > For example the declaration
> >
> > typedef struct {int64_t a; int64_t b;int64_t c;} test;
> > test create_test(void);yields the LLVM code
> >
> > %struct.test = type { i64, i64, i64 }
> > declare void @create_test(%struct.test* sret) #1
> >
> > However, the function is defined in LLVM-IR as
> > {i64,i64,i64} @create_test()
> >
>
> Where are you getting this d...