ONE - On-device Neural Engine
Loading...
Searching...
No Matches
coco::Load Class Referencefinal

Load an Object. More...

#include <Ops.h>

Collaboration diagram for coco::Load:

Public Member Functions

 Load ()
 
 Load (const Load &)=delete
 
 Load (Load &&)=delete
 
uint32_t arity (void) const final
 Return the number of arguments (# of child Ops)
 
Oparg (uint32_t n) const final
 Return N-th argument.
 
std::set< Object * > uses (void) const override
 Return a set of object(s) used during execution.
 
LoadasLoad (void) override
 
const LoadasLoad (void) const override
 
Instrloc (void) override
 
void object (Object *o)
 
Objectobject (void) const
 
- Public Member Functions inherited from coco::Op
virtual ~Op ()
 
template<typename T >
accept (IVisitor< T > *v) const
 
template<typename T >
accept (IVisitor< T > &v) const
 
template<typename T >
accept (IVisitor< T > &&v) const
 
void accept (IMutator *m)
 
void accept (IMutator &m)
 
void accept (IMutator &&m)
 
Instrparent (void) const
 
Opup (void) const
 Return a pointer to the parent Op.
 
- Public Member Functions inherited from coco::Entity
virtual ~Entity ()=default
 
Modulemodule (void) const
 
- Public Member Functions inherited from coco::Object::Consumer
virtual ~Consumer ()=default
 
- Public Member Functions inherited from coco::Bag::Reader
virtual ~Reader ()=default
 
- Public Member Functions inherited from coco::Locatable
virtual ~Locatable ()=default
 

Detailed Description

Load an Object.

Definition at line 37 of file Ops.h.

Constructor & Destructor Documentation

◆ Load() [1/3]

coco::Load::Load ( )
explicit

Definition at line 24 of file Load.cpp.

24 : _obj{this}
25{
26 // DO NOTHING
27}

◆ Load() [2/3]

coco::Load::Load ( const Load )
delete

◆ Load() [3/3]

coco::Load::Load ( Load &&  )
delete

Member Function Documentation

◆ arg()

Op * coco::Load::arg ( uint32_t  n) const
finalvirtual

Return N-th argument.

Note
The behavior of arg(n) is defined only when n < artiy()

Implements coco::Op.

Definition at line 35 of file Load.cpp.

36{
37 assert(!"Load has no argument");
38 return nullptr;
39}

◆ arity()

uint32_t coco::Load::arity ( void  ) const
finalvirtual

Return the number of arguments (# of child Ops)

Implements coco::Op.

Definition at line 29 of file Load.cpp.

30{
31 // Load has no child Op
32 return 0;
33}

◆ asLoad() [1/2]

const Load * coco::Load::asLoad ( void  ) const
inlineoverride

Definition at line 54 of file Ops.h.

54{ return this; }

◆ asLoad() [2/2]

Load * coco::Load::asLoad ( void  )
inlineoverride

Definition at line 53 of file Ops.h.

53{ return this; }

◆ loc()

Instr * coco::Load::loc ( void  )
inlineoverridevirtual

Implements coco::Locatable.

Definition at line 57 of file Ops.h.

57{ return parent(); }
Instr * parent(void) const
Definition Op.cpp:31

References coco::Op::parent().

◆ object() [1/2]

void coco::Load::object ( Object o)
inline

Definition at line 60 of file Ops.h.

60{ _obj.value(o); }
Object * value(void) const
Definition Use.h:37

References coco::Use::value().

Referenced by OpBuilder::load(), and OpPrinter::visit().

◆ object() [2/2]

Object * coco::Load::object ( void  ) const
inline

Definition at line 61 of file Ops.h.

61{ return _obj.value(); }

References coco::Use::value().

◆ uses()

std::set< Object * > coco::Load::uses ( void  ) const
overridevirtual

Return a set of object(s) used during execution.

NOTE There is no 'def' method as Op is not allowed to define a new object

Implements coco::Op.

Definition at line 41 of file Load.cpp.

42{
43 std::set<Object *> res;
44
45 if (auto obj = object())
46 {
47 res.insert(obj);
48 }
49
50 return res;
51}

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