search for: fptr

Displaying 20 results from an estimated 137 matches for "fptr".

2009 Nov 12
1
[ win32utils-Bugs-27425 ] win32-open3 doesn't build with 1.9.1
...9; win32/open3.c(267) : error C2143: syntax error : missing ''{'' before ''*'' win32/open3.c(267) : error C2059: syntax error : ''type'' win32/open3.c(267) : error C2059: syntax error : '')'' win32/open3.c(309) : error C2065: ''fptr'' : undeclared identifier win32/open3.c(309) : error C2296: ''*'' : illegal, left operand has type ''HFILE (__stdcall *)(LPCSTR,LPOFSTRUCT,UINT)'' win32/open3.c(310) : error C2143: syntax error : missing '';'' before ''type'' w...
2017 Jan 10
2
[cfe-dev] Modernizing LLVM Coding Style Guide and enforcing Clang-tidy
...don't think C programmer will not understand using. The "=" makes it >> much >> >> simpler to read, even if it is the first time you see it, which is not >> the >> >> case of typedef. >> >> >> >> typedef MyType::NestedType (*fptr)(const MyOhterType&); >> >> or >> >> using fptr = MyType::NestedType (*)(const MyOhterType&); >> > >> >> I would prefer to please keep using typedefs at least for function >> pointers. I find either of >> >> typedef MyType::Nes...
2017 Jan 09
3
[cfe-dev] Modernizing LLVM Coding Style Guide and enforcing Clang-tidy
...rs.com> wrote: >> +1 Exactly this. >> I don't think C programmer will not understand using. The "=" makes it much >> simpler to read, even if it is the first time you see it, which is not the >> case of typedef. >> >> typedef MyType::NestedType (*fptr)(const MyOhterType&); >> or >> using fptr = MyType::NestedType (*)(const MyOhterType&); > I would prefer to please keep using typedefs at least for function pointers. I find either of typedef MyType::NestedType (*fptr)(const MyOhterType&); or typedef int fptr(const i...
2013 Feb 19
0
[LLVMdev] [RFC] NoBuiltin Attribute
...fp("xyz\n"); > } > > With -fno-builtin-printf, we can't optimize the call to printf, even though it only becomes apparent after (trivial) devirtualization. Ha. Good example. What would you expect to happen in this case? --- a.cpp --- (with -fno-builtin-printf) pointer fptr; void foo(bool x) { bar(x); } void set(bool x) { if (x) fptr = printf; else fptr = vprintf; } ------------- --- b.cpp --- (no restrictions) extern pointer fptr; void bar(bool x) { set(x); va_list ap = ... (*fptr)("haha", ap); } ------------- Also, with the options r...
2013 Feb 19
2
[LLVMdev] [RFC] NoBuiltin Attribute
On Feb 19, 2013, at 7:46 AM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote: > On 2/19/2013 12:31 AM, Bill Wendling wrote: >> >> Yeah, that was in the one that I committed. I basically want something like this: >> >> define void @foo() "no-builtin" { >> call void @printf() >> } >> >> And then the `call' to
2014 Oct 21
2
IPv6 UFO for VMs
...ion for them: drivers/net/macvtap.c: gso_type = SKB_GSO_UDP; drivers/net/tun.c: skb_shinfo(skb)->gso_type = SKB_GSO_UDP; drivers/net/virtio_net.c: skb_shinfo(skb)->gso_type = SKB_GSO_UDP; Our implementation of UFO for IPv6 does: fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen); fptr->nexthdr = nexthdr; fptr->reserved = 0; fptr->identification = skb_shinfo(skb)->ip6_frag_id; which assumes ip6_frag_id has been set. That's only true if the local stack constructed the skb; otherwise it ap...
2014 Oct 21
2
IPv6 UFO for VMs
...ion for them: drivers/net/macvtap.c: gso_type = SKB_GSO_UDP; drivers/net/tun.c: skb_shinfo(skb)->gso_type = SKB_GSO_UDP; drivers/net/virtio_net.c: skb_shinfo(skb)->gso_type = SKB_GSO_UDP; Our implementation of UFO for IPv6 does: fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen); fptr->nexthdr = nexthdr; fptr->reserved = 0; fptr->identification = skb_shinfo(skb)->ip6_frag_id; which assumes ip6_frag_id has been set. That's only true if the local stack constructed the skb; otherwise it ap...
2006 Oct 21
1
Rsync 2.6.9pre2 tries to read ACLs of nonexistent files
Dear rsync people, Today I tried to back up my computer using rsnapshot with the RPM version of rsync-acl 2.6.9pre1 that I built. I tried twice, and both times, rsync encountered some kind of assertion failure. I was trying to reproduce the crash with rsync-acl 2.6.9pre2 and noticed a different bug (described below); when I have a chance, I will go back and investigate the crash further. Rsync
2018 Apr 09
2
ThinLTO + CFI
...int to jump table entries. It appears that I’m hitting a limitation in ThinLTO on how much information it can propagate across modules, particularly information about constants. In the example below, the fact that “i” is effectively a constant, is lost under ThinLTO, and the inlined copy of b.c:get_fptr() in a.c does not eliminate the conditional, which, for CFI purposes requires to generate a type check/jump table. I was wondering if there was a way to mitigate this limitation. a.c ============================= typedef int (*fptr_t) (void); fptr_t get_fptr(); int main(int argc, char *argv[]) {...
2012 Aug 06
2
[LLVMdev] Question about llvm JIT
I have a function in llvm ir as follows: def [2 x [3 x double]] @fun() { return [ ... ]; // a [2 x [3 x double]] constant } I would like to JIT this function in C. I first get the void pointer using: void *FPtr = TheExecutionEngine->getPointerToFunction( func ); Then I need to conver this void pointer to the corresponding C function pointer type, and then call the function pointer. double a[2][3]; CType *FP = (CType*) FPtr; a = FP(); My question is that: 1. Is this JIT work flow supported b...
2017 Jan 09
2
[cfe-dev] Modernizing LLVM Coding Style Guide and enforcing Clang-tidy
...hese, but that can be a matter of taste). > > — > Mehdi > +1 Exactly this. I don't think C programmer will not understand using. The "=" makes it much simpler to read, even if it is the first time you see it, which is not the case of typedef. typedef MyType::NestedType (*fptr)(const MyOhterType&); or using fptr = MyType::NestedType (*)(const MyOhterType&); Typedefs with function pointers are used in couple of places in LLVM and I find it terible to read. So it is not about new-ness. Trust me, I would never use typedef if using was first :) -------------- next...
2018 Apr 17
0
ThinLTO + CFI
...int to jump table entries. It appears that I’m hitting a limitation in ThinLTO on how much information it can propagate across modules, particularly information about constants. In the example below, the fact that “i” is effectively a constant, is lost under ThinLTO, and the inlined copy of b.c:get_fptr() in a.c does not eliminate the conditional, which, for CFI purposes requires to generate a type check/jump table. > > I was wondering if there was a way to mitigate this limitation. > > a.c > ============================= > typedef int (*fptr_t) (void); > fptr_t get_fptr();...
2018 Apr 17
3
ThinLTO + CFI
...erson to answer. But on the issue of global variables being optimized, that hasn't happened yet. That would be great if you wanted to pick that up! In your original email example, it seems like the file static i=53 could be constant propagated since there are no other defs, and the code in get_fptr simplified during the compile step, but I assume this is part of a more complex example where it is not possible to do this? Also note that with r327254 we started importing global variables. Do you know why we don't import in your case? I wonder if it has to do with it being CFI inserted code?...
2018 Apr 26
0
ThinLTO + CFI
...from indirect. While this can be fixed by replacing direct calls to jump tables with direct calls to real targets, I found other cases where ThinLTO+CFI has issues. In ThinLTO backend, type test lowering happens very early in the pipeline, before inlining. When the type check after the call to get_fptr() is lowered (in my original example, below), the compiler cannot see that both targets belong to the same type and that the type check will always return ‘true’ and can be eliminated. Moving the type check lowering pass further down the pipeline (after inlining) still does not solve the problem be...
2012 Aug 06
0
[LLVMdev] Question about llvm JIT
...gmail.com> wrote: > I have a function in llvm ir as follows: > > def [2 x [3 x double]] @fun() > { > return [ ... ]; // a [2 x [3 x double]] constant > } > > I would like to JIT this function in C. > > I first get the void pointer using: > > void *FPtr = TheExecutionEngine->getPointerToFunction( func ); > > Then I need to conver this void pointer to the corresponding C function > pointer > type, and then call the function pointer. > > double a[2][3]; > > CType *FP = (CType*) FPtr; > > a = FP(); > > My...
2018 Apr 20
2
ThinLTO + CFI
...being >> optimized, that hasn't happened yet. That would be great if you wanted to >> pick that up! >> >> In your original email example, it seems like the file static i=53 could >> be constant propagated since there are no other defs, and the code in >> get_fptr simplified during the compile step, but I assume this is part of a >> more complex example where it is not possible to do this? Also note that >> with r327254 we started importing global variables. Do you know why we >> don't import in your case? I wonder if it has to do with...
2004 Apr 21
1
rsync-2.6.1pre-1 hang
...(f=1, s=0x0, buf=0x0, len=0) at match.c:202 #9 0x08054726 in match_sums (f=30, s=0x806d638, buf=0x0, len=128983684031) at match.c:319 #10 0x0804d1e4 in recv_files (f_in=30, flist=0x80712b1, local_name=0x6d <Address 0x6d out of bounds>) at receiver.c:349 #11 0x080593ef in receive_file_entry (fptr=0x0, flags=0, flist=0x0, f=0) at flist.c:593 #12 0x0805a2f5 in send_file_name (f=3, flist=0x0, fname=0x0, recursive=0, base_flags=0) at flist.c:920 #13 0x0805a3bc in send_file_name (f=3, flist=0x41, fname=0x0, recursive=65, base_flags=0) at flist.c:932 #14 0x0805a845 in send_file_list (f=1, argc=15...
2013 Jan 09
2
[LLVMdev] mips16 hard float puzzle
...otler at mips.com> wrote: >> For example: >> >> /home/rkotler/llvm/install/bin/llc -mcpu=mips16 hf16_2.ll -march=mipsel >> -relocation-model=pic -o hf16_2.s -O3 -mips16-hard-float -soft-float > Try something like the following: > > float f; > double test(void* fptr) { > f = ((float(*)(float,float))fptr)(1.0, 1.0); > } > > -Eli It seems that in SelectionDAGBuilder::visitCall, that I.getCalledFunction() has the correct protoype, even for this case you give. (This case you give is not constructable as you pointed out simply using the DAG in Mips...
2018 Apr 27
3
ThinLTO + CFI
...s can be fixed by replacing direct > calls to jump tables with direct calls to real targets, I found other cases > where ThinLTO+CFI has issues. > > In ThinLTO backend, type test lowering happens very early in the pipeline, > before inlining. When the type check after the call to get_fptr() is > lowered (in my original example, below), the compiler cannot see that both > targets belong to the same type and that the type check will always return > ‘true’ and can be eliminated. Moving the type check lowering pass further > down the pipeline (after inlining) still does not...
2008 May 27
1
[LLVMdev] JIT question: Inner workings of getPointerToFunction()
...form of low level IR (which presumably is JIT's data) into native code which is actually made executable at runtime). Specifically, in the following code snippet (from the tutorial), how does getPointerToFunction() actually generate native code for function LF and the call to FP succeed as if FPtr was a pointer to statically compiled code ? // JIT the function, returning a function pointer. void *FPtr = TheExecutionEngine->getPointerToFunction(LF); // Cast it to the right type (takes no arguments, returns a double) so we // can call it as a native function. double (*FP)() = (double (*...