[cfe-dev] preventing bitcast in generated code
Chris Lattner
clattner at apple.com
Mon May 10 13:40:39 PDT 2010
On May 10, 2010, at 1:29 PM, Jochen Wilhelmy wrote:
> Hi!
>
> Now I have implemented my TargetInfo which derives from clang::TargetInfo
> to define type widths and alignment, but there is no ABI lowering.
> clang still generates (in unoptimized code) a llvm.memcpy.p0i8.p0i8.i32
> to copy my struct. Is this hard coded or are there other classes I have
> to override?
>
> By the way in TargetInfo.h there are lines like
> unsigned getBoolWidth(bool isWide = false) const { return 8; } // FIXME
> unsigned getBoolAlign(bool isWide = false) const { return 8; } // FIXME
>
> Later on I'd like to define bool as 1 bit, therefore would it be possible to fix this?
No. These are memory sizes. Memory is always in units of bytes.
-Chris
More information about the cfe-dev
mailing list