码迷,mamicode.com
首页 > 其他好文 > 详细

QualType in clang

时间:2014-10-19 15:33:36      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:des   blog   http   os   ar   for   sp   div   on   

  http://clang.llvm.org/docs/InternalsManual.html#the-qualtype-class

the QualType class is designed to be an efficient value class which contains a pointer to the unqualified type together with the qualifiers (const, volatile etc.). The class is implemented as a llvm::PointerIntPair

/// PointerIntPair - This class implements a pair of a pointer and small
/// integer.  It is designed to represent this in the space required by one
/// pointer by bitmangling the integer into the low part of the pointer.  This
/// can only be done for small integers: typically up to 3 bits, but it depends
/// on the number of bits available according to PointerLikeTypeTraits for the
/// type.
///
/// Note that PointerIntPair always puts the IntVal part in the highest bits
/// possible.  For example, PointerIntPair<void*, 1, bool> will put the bit for
/// the bool into bit #2, not bit #0, which allows the low two bits to be used
/// for something else.  For example, this allows:
///   PointerIntPair<PointerIntPair<void*, 1, bool>, 1, bool>
/// ... and the two bools will land in different bits.

  

QualType in clang

标签:des   blog   http   os   ar   for   sp   div   on   

原文地址:http://www.cnblogs.com/qsort/p/4034889.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!