Program Class Referencea class for Fortran programs.
More...
#include <Program.h>
Inheritance diagram for Program:
[legend]List of all members.
|
Public Member Functions |
| | Program () |
| | Program (ProgramUnit *pgm) |
| | Program (const Program &p) |
| Program & | operator= (const Program &pgm) |
| virtual Program * | clone () const |
| | Return (and give control of) a new Program which has been copied from this one.
|
| virtual | ~Program () |
| void | read (const char *fname) |
| | Scan and read the Fortran source code.
|
| void | absorb (ProgramUnit *pgm) |
| | Absorb the ProgramUnit unit into the program.
|
| void | absorb (Program *p) |
| | Absorb the Program unit into the program.
|
| EntryPoints * | entry_points () const |
| | Return a collection of the ENTRY/ProgramUnit pairs in the Program.
|
| void | compute_call_lists () |
| | Fill in the "calls" and "called_by" lists for each ProgramUnit.
|
| virtual int | structures_OK () const |
| | Check the structure of the data for errors or inconsistency Return 0 and print error message if problems found, otherwise return 1 without message.
|
| void | clean () |
| | Search through the Program and find all symbol uses.
|
| void | write (ostream &o) const |
| | Display the program unit in FORTRAN format.
|
| void | print (ostream &o) const |
| | Print the program unit in FORTRAN format.
|
Detailed Description
a class for Fortran programs.
Base General utility routines - See also:
- Program.h
Program.cc
Program.h
This class represents a Fortran program and contains all of compilation units (ProgramUnit's) comprising that program.
Definition at line 33 of file Program.h.
Constructor & Destructor Documentation
| Program::Program |
( |
const Program & |
p |
) |
|
|
Member Function Documentation
| Program * Program::clone |
( |
|
) |
const [virtual] |
|
| void Program::read |
( |
const char * |
fname |
) |
|
|
|
|
Scan and read the Fortran source code.
... ... previous 2 statement is replaced by following due to complainment from ... gcc 2.96 as:
... new char[100];
... new char[100];
... Allocate vname and wname using malloc(), these are temporary files ... File vname is for the VDL coming from the scanner. ... File wname is for any warnings coming from the scanner
... p_assert( vname, "can not allocate temporary file name" ); ... -->
cmd += " -d"; cmd += dec( x );
cmd += " -c"; cmd += dec( x );
... If the warnings file is empty, just delete it
... Copy the warnings to cerr and delete the file
... Should be using the wait() call here to return the status of the ... system call.
... silvius: do not unlink if it was given as input.
... Deallocate vname using free().
Definition at line 201 of file Program.cc.
References StmtList::_set_block_structure(), absorb(), change_default_type_size(), COMPLEX_TYPE, StmtList::create_assertions(), DOUBLE_PRECISION_TYPE, List< T >::entries(), List< T >::first_ref(), INTEGER_TYPE, BinRep::is_set(), is_vdl(), List< T >::last_ref(), LOGICAL_TYPE, mark_loops_with_location(), pfree(), BinRep::read(), REAL_TYPE, remove_all_statement_functions(), set_subst_field_print(), ProgramUnit::stmts(), and switch_value().
Referenced by main(), process(), and read_pu(). |
| void Program::absorb |
( |
Program * |
p |
) |
|
|
|
|
Absorb the Program unit into the program.
Definition at line 91 of file Program.cc.
References absorb(). |
| void Program::compute_call_lists |
( |
|
) |
|
|
|
|
Fill in the "calls" and "called_by" lists for each ProgramUnit.
... silvius: clear up old calls and called_by lists.
... silvius: find the ones that are actually called. ... The old method was giving wrong results after deadcode ... elimination (of routine calls).
... Find the called routines by finding all EXTERNAL symbols mentioned
Definition at line 372 of file Program.cc.
References ProgramUnit::add_call(), ProgramUnit::add_called_by(), ASSIGNMENT_STMT, CALL_STMT, ProgramUnit::called_by(), ProgramUnit::calls(), RefSet< T >::clear(), Iterator< T >::current(), Symbol::external(), ProtoRefDatabase< S, T >::find_ref(), Expression::function(), FUNCTION_CALL_OP, FUNCTION_CLASS, RefDatabase< S, T >::ins(), Symtab::iterator(), StmtList::iterator(), Symbol::name_ref(), Expression::op(), Statement::rhs(), Statement::routine_guarded(), ProgramUnit::routine_name_ref(), Statement::stmt_class(), ProgramUnit::stmts(), SUBROUTINE_CLASS, Symbol::sym_class(), Expression::symbol(), ProgramUnit::symtab(), Definition::tag_ref(), and Iterator< T >::valid(). |
| int Program::structures_OK |
( |
|
) |
const [virtual] |
|
|
|
Check the structure of the data for errors or inconsistency Return 0 and print error message if problems found, otherwise return 1 without message.
Reimplemented from BaseMapRoot.
Definition at line 129 of file Program.cc. |
| void Program::write |
( |
ostream & |
o |
) |
const |
|
| void Program::print |
( |
ostream & |
o |
) |
const [virtual] |
|
The documentation for this class was generated from the following files:
|