[LLVMdev] IR sizeof?

David Nadlinger code at klickverbot.at
Sun Nov 11 04:25:53 PST 2012


On Sun, Nov 11, 2012 at 11:52 AM, edA-qa mort-ora-y <eda-qa at disemia.com> wrote:
> Is there a way to get the size of a type in the IR assembly code? I know
> the size must be known since alloca and getelementptr both implicitly
> use it, but I don't see any way to get access to the size directly.

You might want to look at the output of
llvm::ConstantExpr::getSizeOf(Type*) (e.g. using dump()):
http://llvm.org/docs/doxygen/html/classllvm_1_1ConstantExpr.html#a778163e6ec80716a12ab3282cb97f0d9

David



More information about the llvm-dev mailing list