[cfe-commits] [Review] CharUnits for ASTContext::getTypeSizeInBytes()

Ken Dyck Ken.Dyck at onsemi.com
Mon Dec 14 12:55:49 PST 2009


As discussed earlier [1] (apologies for the delay), the attached patch
introduces CharUnits, an opaque value class for quantities with
character units.

It uses an int64_t to represent the quantity, has a named constructor, a
single explicit conversion to a int64_t, and basic arithmetic,
comparison, and relational operators. It is intended as a return type
for ASTContext::getTypeSizeInBytes() and other methods that return
sizes, offsets and alignments in character units.

Comments welcome.

-Ken


[1]
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/0243
36.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CharUnits.r91240.patch
Type: application/octet-stream
Size: 4724 bytes
Desc: CharUnits.r91240.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20091214/f3af15bd/attachment.obj>


More information about the cfe-commits mailing list