59 instructionBoundaries_(toCopy.instructionBoundaries_),
60 instructionAddresses_(toCopy.instructionAddresses_) {
63 for (ReferenceMap::const_iterator iter = toCopy.
references_.begin();
68 for (IndexBoundSet::const_iterator iter =
indexBounds->begin();
72 newSet->insert(newTable);
78 std::pair<const Instruction*, IndexBoundSet*>(
79 instruction, newSet));
103 for (ReferenceMap::const_iterator iter = bits.
references_.begin();
111 std::pair<const Instruction*, IndexBoundSet*>(
112 instruction, newSet));
123 for (ReferenceMap::const_iterator iter = bits.
references_.begin();
128 for (IndexBoundSet::const_iterator setIter =
129 indexBoundSet->begin();
130 setIter != indexBoundSet->end(); setIter++) {
140 insert(end(), bitsCopy.begin(), bitsCopy.end());
166 setForInstruction.insert(newTable);
202 std::pair<const Instruction*, unsigned int>(&instruction, address));
207 for (IndexBoundSet::const_iterator iter = setForInstruction.begin();
208 iter != setForInstruction.end(); iter++) {
233 if (*iter > position) {
236 }
else if (*iter == position) {
271 const string procName =
"InstructionBitVector::instructionBoundary";
272 throw OutOfRange(__FILE__, __LINE__, procName);
289 std::pair<const Instruction*, IndexBoundSet*> newPair(
290 &instruction, newSet);
312 for (IndexBoundSet::const_iterator iter = from.begin();
313 iter != from.end(); iter++) {
318 for (IndexBoundTable::iterator iter = newTable->begin();
319 iter != newTable->end(); iter++) {
320 (*iter).incrStartIndex(size());
321 (*iter).incrEndIndex(size());
343 string errorMsg =
"Unable to fix instruction reference with the "
344 "correct instruction address due to insuffient space reserved "
345 "for the immediate.";
350 int stopBit = requiredSize;
352 for (IndexBoundTable::const_reverse_iterator iter = indexes.rbegin();
353 iter != indexes.rend(); iter++) {
360 if ((*iter).isLimmEncoded()) {
368 for (
unsigned int index = endIndex; index >= startIndex; index--) {
370 if (currentBit <= stopBit) {
373 operator[](index) =
false;
389 unsigned int size(0);
390 for (IndexBoundTable::const_iterator iter = indexes.begin();
391 iter != indexes.end(); iter++) {
392 size += (*iter).slotEndIndex() - (*iter).slotStartIndex() + 1;
#define assert(condition)
void pushBack(long long unsigned int integer, int size)
unsigned int slotEndIndex() const
unsigned int slotStartIndex() const
int limmRightIndex() const
int limmLeftIndex() const
void markInstructionStartingPoint(unsigned int position)
void addIndexBoundTables(const IndexBoundSet &from, IndexBoundSet &to)
static unsigned int availableSize(const IndexBoundTable &indexes)
InstructionAddressTable instructionAddresses_
Addresses of the instructions.
void startSettingInstructionReference(const TTAProgram::Instruction &instruction)
unsigned int instructionCount() const
void fixBits(const IndexBoundTable &indexes, unsigned int value)
IndexBoundSet & indexBounds(const TTAProgram::Instruction &instruction)
unsigned int instructionStartingPoint(unsigned int index) const
IndexBoundTable * currentTable_
IndexBoundTable being under construction.
void pushBack(const InstructionBitVector &bits)
BoundaryTable instructionBoundaries_
Stores the instruction boundaries.
void fixInstructionAddress(const TTAProgram::Instruction &instruction, unsigned int address)
virtual ~InstructionBitVector()
std::set< IndexBoundTable * > IndexBoundSet
A set type that stores IndexBoundTables.
void addIndexBoundsForReference(IndexBound bounds)
ReferenceMap references_
Contains information of the parts of the bit vector that refer to an instruction address.
std::vector< IndexBound > IndexBoundTable
A vector type that stores index bounds.