search for: func_data

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

2013 Jul 18
3
[LLVMdev] Proposal: function prefix data
...s handled in C++. I don't know LLVM IR, so I'll use C to explain. Instead of this: void func(void){} int main(){ func(); return 0; } You could do this: void func(void){} /* You have to initialize this at compile time. */ struct { char* data; int len; void (*ptr)(void) = func; } func_data; int main(){ func_data.ptr(); return 0; } On Jul 18, 2013 12:47 PM, "Jevin Sweval" <jevinsweval at gmail.com> wrote: > On Wed, Jul 17, 2013 at 9:06 PM, Peter Collingbourne <peter at pcc.me.uk> > wrote: > > > > To maintain the semantics of ordinary fu...
2013 Jul 18
0
[LLVMdev] Proposal: function prefix data
On Wed, Jul 17, 2013 at 9:06 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > > To maintain the semantics of ordinary function calls, the prefix data > must have a particular format. Specifically, it must begin with a > sequence of bytes which decode to a sequence of machine instructions, > valid for the module's target, which transfer control to the point >
2013 Jul 18
6
[LLVMdev] Proposal: function prefix data
Hi, I would like to propose that we introduce a mechanism in IR to allow arbitrary data to be stashed before a function body. The purpose of this would be to allow additional data about a function to be looked up via a function pointer. Two use cases come to mind: 1) We'd like to be able to use UBSan to check that the type of the function pointer of an indirect function call matches the