GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

実装[]

 5712 /* Return a tree representing the offset, in bytes, of the field referenced
 5713    by EXP.  This does not include any offset in DECL_FIELD_BIT_OFFSET.  */
5714 
5715 tree
5716 component_ref_field_offset (tree exp)
5717 {
5718   tree aligned_offset = TREE_OPERAND (exp, 2);
5719   tree field = TREE_OPERAND (exp, 1);
5720 
 5721   /* If an offset was specified in the COMPONENT_REF, it's the offset measured
 5722      in units of DECL_OFFSET_ALIGN / BITS_PER_UNIT.  So multiply by that
 5723      value.  */
5724   if (aligned_offset)
5725     {
 5726       /* ??? tree_ssa_useless_type_conversion will eliminate casts to
 5727          sizetype from another type of the same width and signedness.  */
5728       if (TREE_TYPE (aligned_offset) != sizetype)
5729         aligned_offset = fold_convert (sizetype, aligned_offset);
5730       return size_binop (MULT_EXPR, aligned_offset,
5731                          size_int (DECL_OFFSET_ALIGN (field) / BITS_PER_UNIT));
5732     }
5733 
 5734   /* Otherwise, take the offset from that of the field.  Substitute
 5735      any PLACEHOLDER_EXPR that we have.  */
5736   else
5737     return SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_FIELD_OFFSET (field), exp);
5738 }


リンク元

Advertisement