Displaying 1 result from an estimated 1 matches for "llvmconstnamedstruct".
2013 Apr 09
1
[LLVMdev] How to get a pointer to a constant struct?
...elementptr inbounds %A* %a, i32 0, i32 0 ; [type=%VTable**]
%2 = somehow make a pointer to: { void(%A*)* null, void (%A*)* @main }
store %VTable* %2, %VTable** %1
ret void
}
How would I do the "somehow make a pointer to" part? I currently make
the constant named struct by using LLVMConstNamedStruct(passing in
%VTable, [null, @main]) and have tried using LLVMConstGEP with [0] as
the indices on this but both times I get an assertion error saying:
"Assertion failed: getOperand(0)->getType() ==
cast<PointerType>(getOperand(1)->getType())->getElementType() && "...