OpenASIP  2.0
Functions
InlineAsmParser.cc File Reference
#include "InlineAsmParser.hh"
#include <memory>
#include <regex>
#include <algorithm>
#include "AssemblerParser.hh"
#include "Machine.hh"
#include "Binary.hh"
#include "BasicBlock.hh"
#include "Program.hh"
#include "InstructionReferenceManager.hh"
#include "InstructionReference.hh"
#include "Procedure.hh"
#include "Instruction.hh"
#include "Move.hh"
#include "Terminal.hh"
#include "TerminalImmediate.hh"
#include "TerminalInstructionReference.hh"
#include "Immediate.hh"
#include "TPEFProgramFactory.hh"
#include "LiveRangeData.hh"
#include "TCETargetMachine.hh"
#include "LLVMUtilities.hh"
#include <llvm/CodeGen/MachineOperand.h>
#include <llvm/CodeGen/MachineInstr.h>
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Mangler.h"
#include <llvm/ADT/SmallString.h>
Include dependency graph for InlineAsmParser.cc:

Go to the source code of this file.

Functions

std::vector< TTAProgram::TerminalInstructionReference * > getInstructionReferenceTerminals (TTAProgram::Instruction &instr)
 

Detailed Description

Implementation of inline assembly parser.

Author
Henry Linjamäki (henry.linjamaki-no.spam-tut.fi)
Note
rating: red

Definition in file InlineAsmParser.cc.

Function Documentation

◆ getInstructionReferenceTerminals()

std::vector<TTAProgram::TerminalInstructionReference*> getInstructionReferenceTerminals ( TTAProgram::Instruction instr)

Definition at line 473 of file InlineAsmParser.cc.

473  {
474 
476 
477  std::vector<TTAProgram::TerminalInstructionReference*> result;
478 
479  for (int i = 0; i < instr.moveCount(); i++) {
480  auto& move = instr.move(i);
481  auto& srcTerml = move.source();
482  if (srcTerml.isInstructionAddress()) {
483  assert(dynamic_cast<TerminalInstructionReference*>(&srcTerml));
484  result.push_back(static_cast<TerminalInstructionReference*>(
485  &srcTerml));
486  }
487  }
488 
489  for (int i = 0; i < instr.immediateCount(); i++) {
490  auto& valTerml = instr.immediate(i).value();
491  if (valTerml.isInstructionAddress()) {
492  assert(dynamic_cast<TerminalInstructionReference*>(&valTerml));
493  result.push_back(static_cast<TerminalInstructionReference*>(
494  &valTerml));
495  }
496  }
497 
498  return result;
499 }

References assert, TTAProgram::Instruction::immediate(), TTAProgram::Instruction::immediateCount(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), TTAProgram::Move::source(), and TTAProgram::Immediate::value().

Referenced by InlineAsmParser::copyInstructions().

Here is the call graph for this function:
TTAProgram::Immediate::value
TerminalImmediate & value() const
Definition: Immediate.cc:103
TTAProgram::Instruction::move
Move & move(int i) const
Definition: Instruction.cc:193
assert
#define assert(condition)
Definition: Application.hh:86
TTAProgram::TerminalInstructionReference
Definition: TerminalInstructionReference.hh:48
TTAProgram::Instruction::immediate
Immediate & immediate(int i) const
Definition: Instruction.cc:285
TTAProgram::Instruction::immediateCount
int immediateCount() const
Definition: Instruction.cc:267
TTAProgram::Move::source
Terminal & source() const
Definition: Move.cc:302
TTAProgram::Instruction::moveCount
int moveCount() const
Definition: Instruction.cc:176