Fix a wrong and confusing comment in CharUnits.h. Neither C nor C++ allows

bytes and character units to be different sizes.

llvm-svn: 181730
This commit is contained in:
Richard Smith 2013-05-13 20:28:15 +00:00
parent f5f48d8ff7
commit dd782d77ef
1 changed files with 10 additions and 11 deletions

View File

@ -19,21 +19,20 @@
#include "llvm/Support/MathExtras.h"
namespace clang {
/// CharUnits - This is an opaque type for sizes expressed in character units.
/// Instances of this type represent a quantity as a multiple of the size
/// Instances of this type represent a quantity as a multiple of the size
/// of the standard C type, char, on the target architecture. As an opaque
/// type, CharUnits protects you from accidentally combining operations on
/// quantities in bit units and character units.
/// quantities in bit units and character units.
///
/// It should be noted that characters and bytes are distinct concepts. Bytes
/// refer to addressable units of data storage on the target machine, and
/// characters are members of a set of elements used for the organization,
/// control, or representation of data. According to C99, bytes are allowed
/// to exceed characters in size, although currently, clang only supports
/// architectures where the two are the same size.
///
/// For portability, never assume that a target character is 8 bits wide. Use
/// In both C and C++, an object of type 'char', 'signed char', or 'unsigned
/// char' occupies exactly one byte, so 'character unit' and 'byte' refer to
/// the same quantity of storage. However, we use the term 'character unit'
/// rather than 'byte' to avoid an implication that a character unit is
/// exactly 8 bits.
///
/// For portability, never assume that a target character is 8 bits wide. Use
/// CharUnit values wherever you calculate sizes, offsets, or alignments
/// in character units.
class CharUnits {