llvm::module::setDataLayout and llvm::module::setHostTriple
I've seen these functions used on many llvm projects, like this one, howeve开发者_JAVA百科r the documentation on these functions is hardly a line. I would like to understand what are these for and in what scenarios do i have to use them
cheers
Data layout describes various things about the stuff on your platform like storage sizes of the types, their alignment, endianness, etc. Check http://llvm.org/docs/LangRef.html#datalayout for the syntax of this string.
setHostTriple() sets the triple of the module, basically the platform the IR was generated for. Usually it's enough to specify triple alone, because for most platforms data layout is specified by the Platform ABI.
精彩评论