This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
current_class
- To: java at gcc dot gnu dot org
- Subject: current_class
- From: Dachuan Yu <dachuan dot yu at yale dot edu>
- Date: Thu, 11 Oct 2001 15:01:01 -0400
- Organization: Yale University
I was wondering how I can get access to the current
class that is being compiled.
For example, suppose we are compiling the method
invocation of "b.g()" in the following example.
Class A {
void f() {
B b;
b.g();
}
}
Say, in method "patch_invoke" or
"build_invokevirtual", can I use "current_class" to
get hold of the "class_type_node" counterpart of
class A?
Note: I'm not looking for the class of object b. I'm
looking for the enclosing class of the current code
being compiled. I want to do sometime like the
following:
otable = build1(INDIRECT_REF, class_type_node,
current_class);
otable = build (COMPONENT_REF, otable_prt_type,
otable,
lookup_field (&class_type_node,
otable_ident));
(where "otable_ident" is the identifier node of the
name of a field in class_type_node.)
regards,
Dachuan