OpenASIP 2.2
Loading...
Searching...
No Matches
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}
#define assert(condition)
TerminalImmediate & value() const
Definition Immediate.cc:103
Move & move(int i) const
Immediate & immediate(int i) const
Terminal & source() const
Definition Move.cc:302

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: