search for: test_derived

Displaying 2 results from an estimated 2 matches for "test_derived".

2005 Aug 26
0
[LLVMdev] Mapping of class derivated and interfaces
...u really want to try to invent it for yourself, which is well worth trying to get a better understanding of OOP implementation and LLVM) is to try some simple C++ snippets with LLVM and look at the resulting assembly. For example: struct base { int i; }; struct derived: base { int j; }; int test_derived(int (*func)(base*), derived* d) { return func(d); } Looks like this: %struct.base = type { int } %struct.derived = type { %struct.base, int } int %test_derived(int (*)(base*), derived*)(int (%struct.base*)* %func, %struct.derived* %d) { entry: %tmp.3 = getelementptr %struct.deri...
2005 Aug 25
5
[LLVMdev] Mapping of class derivated and interfaces
Hi! i'm tring to figure out how classes and dependencies can be mapped to llvm. I've read on docs that nesting can be used: class base { int Y; }; class derived : base { short Z; }; becomes: %base = type { int } %derived = type { %base, short } That's ok, but now the question is: how do i encode a function that takes "base" type so that it also takes "derived"