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 [thread overview]
Message-ID: <199712110000.QAA26574@kankakee.wrs.com> (raw)
> From: "Joshua S. Allen" <allen@eecs.tulane.edu>
> 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.
next reply other threads:[~1997-12-10 16:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-12-10 16:00 Mike Stump [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-12-02 22:54 Mike Stump
1997-12-10 7:31 ` Joshua S. Allen
[not found] <199712011505.JAA11781.cygnus.egcs@duvieux.eecs.tulane.edu>
1997-12-01 18:46 ` Jason Merrill
1997-12-01 7:05 Joshua S. Allen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199712110000.QAA26574@kankakee.wrs.com \
--to=mrs@wrs.com \
--cc=allen@eecs.tulane.edu \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).