OTAWA  2.0
Framework to perform machine analysis and compute WCET.
otawa::File Class Reference

#include <otawa/prog/File.h>

+ Inheritance diagram for otawa::File:

Classes

class  SegIter
 
class  SymIter
 

Public Member Functions

void addSegment (Segment *seg)
 
void addSymbol (Symbol *sym)
 
 File (String name)
 
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...
 
address_t findLabel (const String &label)
 Find the address of the given label. More...
 
SegmentfindSegmentAt (Address addr)
 Find the segment at the given address. More...
 
SymbolfindSymbol (String name)
 Find a symbol by its name. More...
 
CString name (void)
 
void removeSymbol (Symbol *sym)
 
const Vector< Segment * > & segments (void) const
 
const syms_tsymbols (void) const
 
- Public Member Functions inherited from otawa::PropList
void addProp (Property *prop)
 Add property to the list without checking of duplication. More...
 
void addProps (const PropList &props)
 Add all properties from the given property list, in a reverse order. More...
 
GetterRange all (const AbstractIdentifier &id) const
 
void clearProps (void)
 Remove all properties from the list. More...
 
PropertyextractProp (const AbstractIdentifier &id)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertygetProp (const AbstractIdentifier *id) const
 Find a property by its identifier. More...
 
bool hasProp (const AbstractIdentifier &id) const
 
PropListoperator= (const PropList &props)
 
void print (elm::io::Output &out) const
 Display the current property list. More...
 
PropRange properties (void) const
 
 PropList (const PropList &props)
 Initialize a property list from a sequence of (identifier, value) pairs passed as variable arguments. More...
 
 PropList (void)
 
void removeAllProp (const AbstractIdentifier *id)
 Remove all the properties matching the given identifier. More...
 
void removeProp (const AbstractIdentifier &id)
 
void removeProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier. More...
 
void setProp (const AbstractIdentifier *id)
 
void setProp (Property *prop)
 Set the property in the property list removing any double. More...
 
void takeProps (PropList &props)
 Take properties from props to the current property list. More...
 
 ~PropList (void)
 

Static Public Attributes

static rtti::Type__type = file_class
 
- Static Public Attributes inherited from otawa::PropList
static rtti::Type__type = prop_list_class
 
static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Protected Member Functions

 ~File (void)
 

Private Types

typedef HashMap< 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

◆ syms_t

Constructor & Destructor Documentation

◆ File()

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

Build a file with the given name.

Parameters
nameName of the file.

◆ ~File()

otawa::File::~File ( void  )
protected

Member Function Documentation

◆ addSegment()

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

Add the given segment to the file.

Parameters
segAdded segment.

References segs.

◆ addSymbol()

void otawa::File::addSymbol ( Symbol sym)
inline

Add the given symbol to the file.

Parameters
symAdded symbol.

References otawa::Symbol::name(), elm::HashMap< class, class, class, class, class >::put(), and syms.

◆ findInstAt()

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::findInst(), and otawa::Symbol::setNoReturn().

◆ findItemAt()

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

Find a program item by its address.

Parameters
addressProgram item address.
Returns
Found program item or null.

◆ findLabel()

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::HashMap< class, class, class, class, class >::get(), otawa::Address::null, and syms.

Referenced by otawa::CFGCollector::setup().

◆ findSegmentAt()

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

Find the segment at the given address.

Parameters
addrLooked address.
Returns
Found segment or null.

◆ findSymbol()

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

Find a symbol by its name.

Parameters
nameSymbol name.
Returns
Found symbol or null.

References elm::HashMap< class, class, class, class, class >::get(), name(), and syms.

◆ name()

CString otawa::File::name ( void  )
inline

◆ removeSymbol()

void otawa::File::removeSymbol ( Symbol sym)
inline

◆ segments()

const Vector<Segment *>& otawa::File::segments ( void  ) const
inline

References segs.

◆ symbols()

const syms_t& otawa::File::symbols ( void  ) const
inline

References syms.

Friends And Related Function Documentation

◆ Process

friend class Process
friend

Member Data Documentation

◆ __type

rtti::Type & otawa::File::__type = file_class
static

◆ _name

String otawa::File::_name
private

Referenced by name().

◆ segs

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

Referenced by addSegment(), and segments().

◆ syms

syms_t otawa::File::syms
private

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