diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -5790,22 +5790,24 @@ Scalar type descriptors are represented as an ``MDNode`` s with two operands. The first operand is an ``MDString`` denoting the name of the -struct type. LLVM does not assign meaning to the value of this operand, it -only cares about it being an ``MDString``. The second operand is an -``MDNode`` which points to the parent for said scalar type descriptor, -which is either another scalar type descriptor or the TBAA root. Scalar -type descriptors can have an optional third argument, but that must be the -constant integer zero. +scalar type. The second operand is an ``MDNode`` which points to the parent +for said scalar type descriptor, which is either another scalar type +descriptor or the TBAA root. Scalar type descriptors can have an optional +third argument, but that must be the constant integer zero. Struct type descriptors are represented as ``MDNode`` s with an odd number of operands greater than 1. The first operand is an ``MDString`` denoting -the name of the struct type. Like in scalar type descriptors the actual -value of this name operand is irrelevant to LLVM. After the name operand, -the struct type descriptors have a sequence of alternating ``MDNode`` and -``ConstantInt`` operands. With N starting from 1, the 2N - 1 th operand, -an ``MDNode``, denotes a contained field, and the 2N th operand, a -``ConstantInt``, is the offset of the said contained field. The offsets -must be in non-decreasing order. +the name of the struct type. After the name operand, the struct type +descriptors have a sequence of alternating ``MDNode`` and ``ConstantInt`` +operands. With N starting from 1, the 2N - 1 th operand, an ``MDNode``, +denotes a contained field, and the 2N th operand, a ``ConstantInt``, is the +offset of the said contained field. The offsets must be in non-decreasing +order. + +LLVM does not assign meaning to the name of the type that is the value of the +first operand of scalar type descriptors or struct type descriptors. But, +``"any pointer"`` and ``"vtable pointer"`` are exceptions and they might be +used to drive optimization passes/code generation. Access tags are represented as ``MDNode`` s with either 3 or 4 operands. The first operand is an ``MDNode`` pointing to the node representing the