[Prev][Next][Index]

pC++/Sage++ 1.7 released



pC++/Sage++ Version 1.7 is here!  You can get a copy from:

  Anonymous FTP:   cica.cica.indiana.edu:/pub/sage (129.79.20.27)
  WWW/Mosaic:      http://www.cica.indiana.edu/sage

Here's a look at what's new in Version 1.7....

**********************************************************************
********************** What's New with Sage++ ************************
**********************************************************************

*** Attributes are here!

In response to many requests from Sage users, we have added attributes 
to Sage++ library. Attributes provide a convenient and flexible way for
attaching user-specific information to Sage nodes. We have found them 
very useful in many contexts and we hope that you too will find them 
handy. Read the sagexx_attr.ps document in sage/doc directory to find out 
how to use the attributes. 

*** Bug fixes and new code from Andrew Mauer

Andrew has found and fixed a number of bugs. He also added new methods, 
such as, for example, SgType::getTrueType(). His code is documented 
directly in libSage++.h and libSage++.C files (look for initials: ajm)

One change that can affect existing code:
SgDeclarationStatement::deleteVar(int i) has been changed to
start the index i from zero, not one.

*** Friend, extern, static, and inline decl-specifications are
handled differently.

 Until now they were modifiers of type nodes. Now, they are modifiers of 
statement (bif) nodes. The side effect of this change is that the internal
format of .dep files have changed. You need to regenerate .dep files
in order to be able to use them with the new release of Sage.

The good news is that this change has fixed several parser/unparser bugs.

New methods have been added to SgStatement class to deal with those 
decl-specifications:

  inline void addDeclSpec(int type);   //type should be one of BIT_EXTERN,
                                      //BIT_INLINE, BIT_FRIEND, BIT_STATIC
  inline void clearDeclSpec();   //resets the decl_specs field to zero
  inline int isFriend();         //returns non-zero if friend modifier set
                                //returns zero otherwise
  inline int isInline();
  inline int isExtern();
  inline int isStatic();

Example:

 #include <sage++user.h>
 main(){
 	SgProject project("demo.proj");
 	for (int i = 0; i < project.numberOfFiles(); i++){
 	    printf (" current file is %s\n", project.fileName(i));
 	    SgFile *f;
 	    f = &(project.file(i));
 	    SgStatement *s; 
 	    for ( s = f->firstStatement(); s; s = s->lexNext()){
                if(s->isFriend())
                     printf("friend found in stmt with id %i-B\n", s->id());
                if(s->isInline()) 
                     printf("inline found in stmt with id %i-B\n", s->id());
                if(s->isStatic()) 
                     printf("static found in stmt with id %i-B\n", s->id());
                if(s->isExtern()) 
                     printf("extern found in stmt with id %i-B\n", s->id());
   		s->clearDeclSpec();	  
                }
           f->unparsestdout();
 	   }
 }

*** Copy Constructors 

Until now, no copy constructors for Sage++ classes were explicitly defined. 
and default (compiler generated) copy constructors had been used. In this 
release, explicit copy constructors have been added. They print a warning:

Sg_Class_Name: copy constructor not allowed
(where Sg_Class_Name is one of: SgProject, SgFile, SgStatement, 
SgExpression, SgSymbol, SgType, or SgLabel)
but otherwise should behave the same way as the default copy constructors.

The reason for the warning can be illustrated by the following example:  

Suppose we want to create an instance of a "pointer to a pointer to an 
int" type. We could try writing the following code:

SgPointerType * pt = new SgPointerType(*SgTypeInt());
SgPointerType * ppt = new SgPointerType(*pt);

However, this will not produce the desired type since in the second line a 
copy constructor will be used. In previous versions of Sage, this happened 
silently. In this version, it will produce the warning: 

Warning : SgType: no copy constructor allowed

(note that the Sg_Class_Name is the name of the base class, not of the 
particular class for which copy constructor was used)

If you notice such warnings please check your code and make sure that you 
really want the copy constructor to be used. To copy Sage objects, you 
should be almost always using the copy() methods provided in Sage++, 
rather than the copy constructors. Copy constructors generate objects 
with the same unique id as the original. On the other hand, Sage code 
assumes that an id correspond to a single object. Copy constructors make 
that assumption invalid and this can lead to unexpected errors.

Returning to the example, one way to create a "pointer to a pointer" type 
is by declaring pt to be of type "pointer to SgType:

SgType * pt = new SgPointerType(*SgTypeInt());
SgPointerType * ppt = new SgPointerType(*pt);
 
*** many bugs in (p)C++ parser have been fixed

also, some error and warning messages have been changed.
The current parser can handle all C++ standard include files that we 
have tried.


*** c2dep has been removed.  A frontend parser for ANSI C programs that
do not use C++ keywords is called 'sagecc'. 

 
*** copy() method for SgStatement

Its behavior has changed, but it should not break any working code. 
Before, a statement had to be extracted using SgStatement::extractStmt() 
method before it could be copied using SgStatement::copy() method. Now, 
no extraction is necessary (although it should not hurt). 

Also, we have added SgStatement::copyBlock() and 
SgStatement::copyBlockPtr() methods that copy all the remaining 
statements in the current block (i.e., with the same control parent 
as the given statement) including the given statement. All the children 
statements are copied as well. Warning: things like block-copying of a 
statement that is itself a block-copy of something else will not work 
because a statement returned by copyBlock() does not have a control 
parent. 

*** More Sage++ Demos  

Many Sage users have asked about how they can create a new empty .dep
file in a project.  Others have had a very hard time with C++ types
and creating declarations and prototypes.  A new Sage++ demo code
illustrates these features.  Look at sage/Sage++/demos/new_file
for an example that creates a blank .dep file in a project and then
adds lots of interesting declarations and types.  This example
is explained in the sagexx_demos.ps file in sage/doc subdirectory.

*** Better Support for Templates in Sage++ and the Parser

The first version did a very bad job on C++ templates.  A large number
of bugs have been fixed in the parser; however, we are certain that many
bugs remain!  Also, Sage++ did not have ways to build and manipulate
C++ templates.  A new demo program in sage/Sage++/demos/template_demo
illustrates how you can build templates in Sage++.

*** FORTRAN M Support in the parser and unparser.

*** Some test codes for Fortran 77 and Fortran M are in 
sage/f2dep/TestSuite.

**********************************************************************
********************** What's New with pC++ **************************
**********************************************************************

* The event tracing and timer routines were re-written from scratch.
  They now can be used as a stand-alone package. See the manual pages
  in ../sage/man/pcxx_{events,timers}.3 for more details.

* se_merge and se_convert were renamed pcxx_merge and pcxx_convert.

* Tracing and profiling support is now implemented on all supported
  machines of pC++. (CM-5, SP-1, PVM, and SGI ports added).

* Run-time port of pC++ to the SGI Challenge, Meiko CS2.  We are still
working on MPI and T3D versions.

* Updated PVM runtime to version 3.3.2

* Examples linking pC++ to Fortran are in ./TestSuite/Fortran.  The Fortran
interface supports linkage to CM Fortran, Fortran90 and Fortran77.  The  
interface is ported to CM-5, SP-1, PVM, SGI, KSR, and Paragon.  Look at the 
README.  The linking of pC++ and Fortran libraries provide the advantages of 
both languages, the Object Oriented nature of pC++ with the fast Fortran 
subroutines.  Fortran data type classes are defined in FArray.h and 
Fortran pC++ collection is defined in Fortra.h.  See the paper 
./doc/shpcc94.ps.gz for more details.

* Remote procedure calls are implemented on distributed memory machines
(CM-5, Paragon, SP-1, and PVM).  This preliminary version will be refined
to allow remote procedure calls on all pC++ supported machines.

**********************************************************************
********************** What's New with TAU ***************************
**********************************************************************

* keyboard traversal for the menubar now works

* cagey has now second layout algorithm for the callgraph, in which
  each function appears exactly once in the graph (called compact view).
  The "old" layout is named "expanded view".

* All TAU tools work now over the network. Just specify a hostname followed
  by a colon (:) before the depfile or directory (like for rcp). TAU uses
  then rsh (remote shell) to connect to the specified host, and runs the
  necessary commands there.

* A first prototyoe of new tool *cosy*: a graphical interface for compiling
  and executing pC++ programs. See Help for more details.

* A very first pre-pre-prototype of *breezy*, the barrier breakpoint
  debugger. Use with care.
  

  - The Sage