Otawa  0.10
otawa::File Class Reference

This class represents a file involved in the building of a process. More...

#include <otawa/prog/File.h>

Inheritance diagram for otawa::File:
otawa::PropList

Classes

class  SegIter
 
class  SymIter
 

Public Member Functions

 File (String name)
 Build a file with the given name. More...
 
CString name (void)
 Get the name of the file. More...
 
InstfindInstAt (address_t address)
 Inst *File::findByAddress(address_t address); Find an instruction by its address. More...
 
ProgItemfindItemAt (address_t address)
 Find a program item by its address. More...
 
void addSegment (Segment *seg)
 Add the given segment to the file. More...
 
SegmentfindSegmentAt (Address addr)
 Find the segment at the given address. More...
 
void addSymbol (Symbol *sym)
 Add the given symbol to the file. More...
 
void removeSymbol (Symbol *sym)
 
address_t findLabel (const String &label)
 Find the address of the given label. More...
 
SymbolfindSymbol (String name)
 Find a symbol by its name. More...
 
InstfindByAddress (address_t address)
 
PropertygetProp (const AbstractIdentifier *id) const
 Find a property by its identifier. More...
 
void setProp (Property *prop)
 Set the property in the property list removing any double. More...
 
void setProp (const AbstractIdentifier *id)
 
void removeProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier. More...
 
void removeProp (const AbstractIdentifier &id)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertyextractProp (const AbstractIdentifier &id)
 Remove a property matching the given identifier and return it. More...
 
void addProp (Property *prop)
 Add property to the list without checking of duplication. More...
 
void removeAllProp (const AbstractIdentifier *id)
 Remove all the properties matching the given identifier. More...
 
bool hasProp (const AbstractIdentifier &id) const
 Test if the property list contains a property matching the given identifier. More...
 
void clearProps (void)
 Remove all properties from the list. More...
 
void addProps (const PropList &props)
 Add all properties from the given property list, in a reverse order. More...
 
void print (elm::io::Output &out) const
 Display the current property list. More...
 

Static Public Attributes

static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Protected Member Functions

 ~File (void)
 

Private Types

typedef HashTable< String,
Symbol * > 
syms_t
 

Private Attributes

String _name
 
Vector< Segment * > segs
 
syms_t syms
 

Friends

class Process
 

Detailed Description

This class represents a file involved in the building of a process.

A file usually matches a program file on the system file system.

Member Typedef Documentation

Constructor & Destructor Documentation

otawa::File::File ( String  name)
inline

Build a file with the given name.

Parameters
nameName of the file.
otawa::File::~File ( void  )
protected

Member Function Documentation

void otawa::File::addSegment ( Segment seg)
inline

Add the given segment to the file.

Parameters
segAdded segment.
void otawa::File::addSymbol ( Symbol sym)
inline

Add the given symbol to the file.

Parameters
symAdded symbol.

References otawa::Symbol::name().

void otawa::PropList::clearProps ( void  )
inherited
Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::script::Script::makeConfig().

Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inlineinherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::PropList::extractProp().

Referenced by otawa::PropList::extractProp().

Inst* otawa::File::findByAddress ( address_t  address)
inline

Referenced by otawa::Symbol::findInst().

Inst * otawa::File::findInstAt ( address_t  address)

Inst *File::findByAddress(address_t address); Find an instruction by its address.

Parameters
addressInstruction address.
Returns
Found instruction or null.
Deprecated:
Use findInstAt() instead.

Find an instruction by its address.

Parameters
addressInstruction address.
Returns
Found instruction or null.

Referenced by otawa::Symbol::setNoReturn().

ProgItem * otawa::File::findItemAt ( address_t  address)

Find a program item by its address.

Parameters
addressProgram item address.
Returns
Found program item or null.
address_t otawa::File::findLabel ( const String label)

Find the address of the given label.

Parameters
labelLabel to find.
Returns
Address of the label or null if label is not found.

References otawa::Symbol::address(), elm::genstruct::HashTable< K, T, H >::get(), otawa::Address::null, and syms.

Referenced by otawa::ast::ASTLoader::findLabel(), and yyparse().

Segment * otawa::File::findSegmentAt ( Address  addr)

Find the segment at the given address.

Parameters
addrLooked address.
Returns
Found segment or null.

Referenced by otawa::CFGBuilder::addFile(), and otawa::CFGBuilder::processWorkSpace().

Symbol * otawa::File::findSymbol ( String  name)

Find a symbol by its name.

Parameters
nameSymbol name.
Returns
Found symbol or null.

References elm::genstruct::HashTable< K, T, H >::get(), and syms.

bool otawa::PropList::hasProp ( const AbstractIdentifier id) const
inlineinherited

Test if the property list contains a property matching the given identifier.

Parameters
idProperty identifier to look for.
Returns
True if the list contains the matching property, false else.

References otawa::PropList::getProp().

Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().

void otawa::PropList::print ( elm::io::Output out) const
inherited

Display the current property list.

Parameters
outOutput to use.

Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().

void otawa::PropList::removeAllProp ( const AbstractIdentifier id)
inherited

Remove all the properties matching the given identifier.

Parameters
idIdentifier of properties to remove.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::LoopUnroller::unroll().

void otawa::PropList::removeProp ( const AbstractIdentifier id)
inherited
void otawa::PropList::removeProp ( const AbstractIdentifier id)
inlineinherited
void otawa::File::removeSymbol ( Symbol sym)
inline

References otawa::Symbol::name().

void otawa::PropList::setProp ( Property prop)
inherited

Set the property in the property list removing any double.

Parameters
propProperty to set.

References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().

void otawa::PropList::setProp ( const AbstractIdentifier id)
inlineinherited

Friends And Related Function Documentation

friend class Process
friend

Member Data Documentation

String otawa::File::_name
private
const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.

Vector<Segment *> otawa::File::segs
private
syms_t otawa::File::syms
private

Referenced by findLabel(), and findSymbol().


The documentation for this class was generated from the following files: