From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12770 invoked by alias); 15 Jun 2006 20:40:13 -0000 Received: (qmail 12761 invoked by uid 22791); 15 Jun 2006 20:40:12 -0000 X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (199.232.76.164) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 Jun 2006 20:40:08 +0000 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FqydK-0001Zv-Fh for gcc-help@gnu.org; Thu, 15 Jun 2006 16:40:06 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1Fqymn-0004GV-Kg for gcc-help@gnu.org; Thu, 15 Jun 2006 16:49:53 -0400 Received: from [64.233.166.176] (helo=py-out-1112.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fqymn-0004GR-D9 for gcc-help@gnu.org; Thu, 15 Jun 2006 16:49:53 -0400 Received: by py-out-1112.google.com with SMTP id i75so407916pye for ; Thu, 15 Jun 2006 13:40:05 -0700 (PDT) Received: by 10.35.99.14 with SMTP id b14mr3596561pym; Thu, 15 Jun 2006 13:40:05 -0700 (PDT) Received: by 10.35.93.10 with HTTP; Thu, 15 Jun 2006 13:40:05 -0700 (PDT) Message-ID: <9aff10810606151340p29fb13adm56e21c2e685f1aee@mail.gmail.com> Date: Thu, 15 Jun 2006 20:40:00 -0000 From: "Wang,Yi" Reply-To: netantz@gmail.com To: gcc-help@gnu.org Subject: order of declared filed in a struct MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg00130.txt.bz2 Hi all: In the GIMPLE tree, How do I get the order of the field declared in a struct (RECORD_TYPE) ? The GCC Internal explains that I could not make any assumptions abut the ordering of th field. ------------------------------- RECORD_TYPE Used to represent struct and class types, as well as pointers to member functions and similar constructs in other languages. TYPE_FIELDS contains the items contained in this type, each of which can be a FIELD_DECL, VAR_DECL, CONST_DECL, or TYPE_DECL. You may not make any assumptions about the ordering of the fields in the type or whether one or more of them overlap. If TYPE_PTRMEMFUNC_P holds, then this type is a pointer-to-member type. In that case, the TYPE_PTRMEMFUNC_FN_TYPE is a POINTER_TYPE pointing to a METHOD_TYPE. The METHOD_TYPE is the type of a function pointed to by the pointer-to-member function. If TYPE_PTRMEMFUNC_P does not hold, this type is a class type. For more information, see see Classes. ----------------------------- Thanks -- Yi Wang Software Engineering, ComSci@U of T