Extending SUIF2.1 IR using hoof

Sam Type samr@cogs.susx.ac.uk
Fri, 26 May 2000 16:10:34 +0000


Help please!

I am trying to extend SUIF2.1 and OSUIF using Hoof.  Unfortunately, I
have come across a problem/bug(?):  In the documentation, it says "The
parameters for the create routine consist of a parameter for each field
in the class, ..., followed by the list of parameters for creating of
the parent class, if any." [page 23, The Basic SUIF Programming Guide
(November 22, 1999)].   This is not happening and therefore the code
cannot function correctly because the set-up code for the parent class
is not getting called.

Example:

Here is a stripped down version of what I am trying to do -

module mine {
  include "basicnodes/basic.h";
  include "common/lstring.h"; 
  include "iokernel/cast.h";

concrete ExtFileSetBlock : FileSetBlock {
  int an_int;
};
}

Now, I want the create_file_set_block function to be called as a part of
the create_ext_file_set_block function (which is necessary during
execution of the code using the ExtFileSetBlock type, so that the
external
symbol table is created and attached etc).  For some reason, the
parameters necessary for the call to the parent class's create function
are not being included in the generated code, neither is the call to the
parent's create routine.  The code that is produced is:

ExtFileSetBlock* MineObjectFactory::create_ext_file_set_block(int
an_int) {
  ExtFileSetBlock* obj=
(ExtFileSetBlock*)_object_factory->create_empty_object_by_name(ExtFileSetBlock::get_class_name());
  
  obj->set_an_int(an_int);
  
  return obj;
  }

ExtFileSetBlock* create_ext_file_set_block(SuifEnv *suif_env,int
an_int)   {
  MineObjectFactory * current = (MineObjectFactory *)
(suif_env->get_object_factory(MineObjectFactory::get_class_name()));
  suif_assert_message(current != NULL, ("Mine Object Factory not
registered\n"));
  return current->create_ext_file_set_block(an_int);
}

So, the parameters necessary for the call to the parent's create_
function, and the call itself do not appear.  Is this a bug?  Have I
missed something?  I need to extend the file-set-block (as well as
several other classes defined by SUIF and OSUIF) and I can't see any
obvious way of placing the call to the parent's create_ function within
the generated code without doing so manually.  Obviously, this is not a
satisfactory solution.

Any help, particularly from the SUIF writers, would be hugely
appreciated - thanks.

Sam.