[LLVMdev] does llvm have some way to get the size of data type

Criswell, John T criswell at ad.uiuc.edu
Sat May 8 06:13:28 PDT 2010


Look at the getABITypeSize() method (or some method with a name like that) of the TargetData class.

Note that TargetData is an LLVM analysis pass; you have to declare it as a prerequisite pass in your pass's getAnalysisUsage() method.

-- John T.

________________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] On Behalf Of Gang.Yao [ttoole9 at gmail.com]
Sent: Friday, May 07, 2010 10:26 PM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] does llvm have some way to get the size of data type

Hi:

just like the c function sizeof(). I would avoid the usage of the c
function call, and expect something like llvm
intrinsic or some class providing this functionality.

Does someone have experience in this?
Thanks





More information about the llvm-dev mailing list