Displaying 1 result from an estimated 1 matches for "_vtablefoo".
2020 Jun 09
2
Implementing a VTable in LLVM
...ntly have code (https://github.com/mukul-rathi/bolt/blob/vtable/src/llvm-backend/llvm_ir_codegen/class_codegen.cc#L57:L77 <https://github.com/mukul-rathi/bolt/blob/vtable/src/llvm-backend/llvm_ir_codegen/class_codegen.cc#L57:L77>)
that generates the following global Vtable for a class Foo:
%_VtableFoo = type { void (%Foo*, i32)* }
%Foo = type { %_VtableFoo*, %pthread_t*, i32, i32, i32, i32 }
@_VtableFoo = common global %_VtableFoo { void (%Foo*, i32)* @_Foo__setgi }
The code for instantiating the table seems to generate the correct IR (create an object, store a pointer to its vtable) - https:/...