OpenASIP
2.0
src
base
program
Immediate.hh
Go to the documentation of this file.
1
/*
2
Copyright (c) 2002-2009 Tampere University.
3
4
This file is part of TTA-Based Codesign Environment (TCE).
5
6
Permission is hereby granted, free of charge, to any person obtaining a
7
copy of this software and associated documentation files (the "Software"),
8
to deal in the Software without restriction, including without limitation
9
the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
and/or sell copies of the Software, and to permit persons to whom the
11
Software is furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
DEALINGS IN THE SOFTWARE.
23
*/
24
/**
25
* @file Immediate.hh
26
*
27
* Declaration of Immediate class.
28
*
29
* @author Ari Metsähalme 2005 (ari.metsahalme-no.spam-tut.fi)
30
* @note rating: red
31
*/
32
33
#ifndef TTA_IMMEDIATE_HH
34
#define TTA_IMMEDIATE_HH
35
36
#include <memory>
37
38
#include "
Exception.hh
"
39
#include <memory>
40
41
namespace
TTAMachine
{
42
class
InstructionTemplate;
43
}
44
45
namespace
TTAProgram
{
46
47
class
Terminal;
48
class
TerminalImmediate;
49
class
Instruction;
50
/**
51
* Represents the long immediate value and its transport into a
52
* dedicated register
53
*/
54
class
Immediate
{
55
public
:
56
Immediate
(
TerminalImmediate
*
value
,
Terminal
* dst);
57
58
virtual
~Immediate
();
59
60
const
Terminal
&
destination
()
const
;
61
62
TerminalImmediate
&
value
()
const
;
63
void
setValue
(
TerminalImmediate
*
value
);
64
65
std::shared_ptr<Immediate>
copy
()
const
;
66
67
Instruction
*
parent
()
const
{
return
parent_
; }
68
void
setParent
(
Instruction
* ins) {
parent_
= ins; }
69
private
:
70
/// Copying not allowed.
71
Immediate
(
const
Immediate
&);
72
/// Assignment not allowed.
73
Immediate
&
operator=
(
const
Immediate
&);
74
75
/// Value of the immediate.
76
TerminalImmediate
*
value_
;
77
78
/// The destination register.
79
Terminal
*
dst_
;
80
81
/// Instruction which contains this immediate.
82
Instruction
*
parent_
;
83
};
84
85
}
86
87
#endif
TTAProgram
Definition:
Estimator.hh:65
TTAProgram::Immediate::value
TerminalImmediate & value() const
Definition:
Immediate.cc:103
Exception.hh
TTAProgram::Immediate::setParent
void setParent(Instruction *ins)
Definition:
Immediate.hh:68
TTAProgram::Instruction
Definition:
Instruction.hh:57
TTAProgram::Immediate::parent_
Instruction * parent_
Instruction which contains this immediate.
Definition:
Immediate.hh:82
TTAProgram::Immediate::copy
std::shared_ptr< Immediate > copy() const
Definition:
Immediate.cc:131
TTAProgram::Immediate::destination
const Terminal & destination() const
Definition:
Immediate.cc:92
TTAProgram::Immediate
Definition:
Immediate.hh:54
TTAProgram::Immediate::operator=
Immediate & operator=(const Immediate &)
Assignment not allowed.
TTAProgram::Immediate::dst_
Terminal * dst_
The destination register.
Definition:
Immediate.hh:79
TTAProgram::Immediate::parent
Instruction * parent() const
Definition:
Immediate.hh:67
TTAProgram::Immediate::value_
TerminalImmediate * value_
Value of the immediate.
Definition:
Immediate.hh:76
TTAProgram::Immediate::setValue
void setValue(TerminalImmediate *value)
Definition:
Immediate.cc:114
TTAProgram::TerminalImmediate
Definition:
TerminalImmediate.hh:44
TTAProgram::Terminal
Definition:
Terminal.hh:60
TTAMachine
Definition:
Assembler.hh:48
TTAProgram::Immediate::~Immediate
virtual ~Immediate()
Definition:
Immediate.cc:74
TTAProgram::Immediate::Immediate
Immediate(TerminalImmediate *value, Terminal *dst)
Definition:
Immediate.cc:68
Generated by
1.8.17