From mboxrd@z Thu Jan 1 00:00:00 1970 From: mrs@wrs.com (Mike Stump) To: allen@eecs.tulane.edu Cc: egcs@cygnus.com Subject: Re: Multiple inheritance Date: Wed, 10 Dec 1997 16:00:00 -0000 Message-id: <199712110000.QAA26574@kankakee.wrs.com> X-SW-Source: 1997-12/msg00623.html > From: "Joshua S. Allen" > To: mrs@wrs.com (Mike Stump) > Date: Wed, 10 Dec 1997 09:21:57 -0600 (CST) > I've been trying to look at the data in BINFO_BASETYPES using TREE_VALUE Please refer to the code and the .h files: /* A vector of additional binfos [...] #define BINFO_BASETYPES(NODE) This: /* In a TREE_LIST node. */ #define TREE_VALUE(NODE) ((NODE)->list.value) means that this works for a TREE_LIST (only). A vector isn't a TREE_LIST. > but it just gives me an integer, which I assume it an offset maybe. Now, it means nothing because it isn't valid. > Is there a way to get a string value of the class name? TYPE_NAME_STRING(TYPE), it's meant to be readable. From a sample use: cp_error ("`%D' is already defined in class %s", fndecl, TYPE_NAME_STRING (DECL_CONTEXT (fndecl))); We can see that it should give us a %s type name of a type. The trick then it to get the type from the binfo. Guess what: TYPE_BINFO (BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (binfo_h), i))) kinda sums up how to do that. You can find these snippets in the code. In fact, looking further, we see: /* Accessor macro to get to the Nth basetype of this basetype. */ #define TYPE_BINFO_BASETYPE(NODE,N) BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (NODE)), (N))) which even matches closer to what you wanted.