search for: expr_codegen

Displaying 1 result from an estimated 1 matches for "expr_codegen".

2020 Jun 09
2
Implementing a VTable in LLVM
...2, 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://github.com/mukul-rathi/bolt/blob/vtable/src/llvm-backend/llvm_ir_codegen/expr_codegen.cc#L66:L89 <https://github.com/mukul-rathi/bolt/blob/vtable/src/llvm-backend/llvm_ir_codegen/expr_codegen.cc#L66:L89> entry: %_var_y0 = alloca %Foo* %0 = call i8* @malloc(i64 ptrtoint (%Foo* getelementptr (%Foo, %Foo* null, i64 1) to i64)) %1 = bitcast i8* %0 to %Foo* %2 = getelement...