LLVM
8.0.1
|
#include "MIParser.h"
#include "MILexer.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/AsmParser/SlotMapping.h"
#include "llvm/CodeGen/MIRPrinter.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/MC/LaneBitmask.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LowLevelTypeImpl.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetIntrinsicInfo.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <string>
#include <utility>
Go to the source code of this file.
Functions | |
static const char * | toString (MIToken::TokenKind TokenKind) |
static const char * | printImplicitRegisterFlag (const MachineOperand &MO) |
static std::string | getRegisterName (const TargetRegisterInfo *TRI, unsigned Reg) |
static bool | isImplicitOperandIn (const MachineOperand &ImplicitOperand, ArrayRef< ParsedMachineOperand > Operands) |
Return true if the parsed machine operands contain a given machine operand. More... | |
static void | initSlots2BasicBlocks (const Function &F, DenseMap< unsigned, const BasicBlock *> &Slots2BasicBlocks) |
static const BasicBlock * | getIRBlockFromSlot (unsigned Slot, const DenseMap< unsigned, const BasicBlock *> &Slots2BasicBlocks) |
static void | mapValueToSlot (const Value *V, ModuleSlotTracker &MST, DenseMap< unsigned, const Value *> &Slots2Values) |
static void | initSlots2Values (const Function &F, DenseMap< unsigned, const Value *> &Slots2Values) |
Creates the mapping from slot numbers to function's unnamed IR values. More... | |
|
static |
Definition at line 2810 of file MIParser.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::MachineFunction::getFunction(), initSlots2BasicBlocks(), and llvm::PerFunctionMIParsingState::MF.
|
static |
Definition at line 921 of file MIParser.cpp.
References assert(), llvm::MCRegisterInfo::getName(), and llvm::TargetRegisterInfo::isPhysicalRegister().
Referenced by EmitHiLo(), isImplicitOperandIn(), llvm::MipsInstPrinter::MipsInstPrinter(), llvm::R600InstPrinter::printOperand(), llvm::SparcInstPrinter::printRegName(), and llvm::AMDGPUInstPrinter::printRegOperand().
|
static |
Definition at line 2795 of file MIParser.cpp.
References llvm::GlobalValue::getParent(), llvm::Value::hasName(), llvm::ModuleSlotTracker::incorporateFunction(), and llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert().
Referenced by getIRBlockFromSlot().
|
static |
Creates the mapping from slot numbers to function's unnamed IR values.
Definition at line 2842 of file MIParser.cpp.
References Arg, llvm::Function::args(), assert(), error, llvm::MachineFunction::getContext(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MCContext::getOrCreateSymbol(), llvm::GlobalValue::getParent(), llvm::HexagonInstrInfo::getSerializableBitmaskMachineOperandTargetFlags(), llvm::HexagonInstrInfo::getSerializableDirectMachineOperandTargetFlags(), llvm::MachineFunction::getSubtarget(), I, llvm::ModuleSlotTracker::incorporateFunction(), mapValueToSlot(), llvm::PerFunctionMIParsingState::MF, llvm::MIToken::StringConstant, and TII.
|
static |
Return true if the parsed machine operands contain a given machine operand.
Definition at line 928 of file MIParser.cpp.
References assert(), llvm::ArrayRef< T >::back(), C, llvm::MIToken::colon, llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), llvm::VRegInfo::D, llvm::RegState::Dead, llvm::RegState::Debug, llvm::RegState::Define, llvm::MIToken::dot, E, llvm::RegState::EarlyClobber, llvm::ArrayRef< T >::empty(), llvm::StringMap< ValueTy, AllocatorTy >::end(), error, llvm::VRegInfo::Explicit, llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::MachineInstr::FmAfn, llvm::MachineInstr::FmArcp, llvm::MachineInstr::FmContract, llvm::MachineInstr::FmNoInfs, llvm::MachineInstr::FmNoNans, llvm::MachineInstr::FmNsz, llvm::MachineInstr::FmReassoc, llvm::MachineInstr::FrameDestroy, llvm::MachineInstr::FrameSetup, llvm::VRegInfo::GENERIC, llvm::MCInstrDesc::getImplicitDefs(), llvm::MCInstrDesc::getImplicitUses(), llvm::TargetRegisterInfo::getRegClassName(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), getRegisterName(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getType(), llvm::PerFunctionMIParsingState::getVRegInfo(), llvm::PerFunctionMIParsingState::getVRegInfoNamed(), I, llvm::MIToken::Identifier, llvm::RegState::Implicit, llvm::RegState::ImplicitDefine, llvm::MCInstrDesc::ImplicitDefs, llvm::MCInstrDesc::ImplicitUses, llvm::MIToken::IntegerLiteral, llvm::RegState::InternalRead, llvm::MCInstrDesc::isCall(), llvm::MachineInstr::IsExact, llvm::MachineOperand::isIdenticalTo(), llvm::LLT::isValid(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::RegState::Kill, llvm::VRegInfo::Kind, llvm::MIToken::kw_afn, llvm::MIToken::kw_arcp, llvm::MIToken::kw_contract, llvm::MIToken::kw_dead, llvm::MIToken::kw_debug_use, llvm::MIToken::kw_def, llvm::MIToken::kw_early_clobber, llvm::MIToken::kw_exact, llvm::MIToken::kw_frame_destroy, llvm::MIToken::kw_frame_setup, llvm::MIToken::kw_implicit, llvm::MIToken::kw_implicit_define, llvm::MIToken::kw_internal, llvm::MIToken::kw_killed, llvm::MIToken::kw_ninf, llvm::MIToken::kw_nnan, llvm::MIToken::kw_nsw, llvm::MIToken::kw_nsz, llvm::MIToken::kw_nuw, llvm::MIToken::kw_reassoc, llvm::MIToken::kw_renamable, llvm::MIToken::kw_tied_def, llvm::MIToken::kw_undef, llvm_unreachable, llvm::MIToken::lparen, llvm::PerFunctionMIParsingState::MF, MRI, Name, llvm::MIToken::NamedRegister, llvm::MIToken::NamedVirtualRegister, llvm::PerFunctionMIParsingState::Names2RegBanks, llvm::PerFunctionMIParsingState::Names2RegClasses, llvm::VRegInfo::NORMAL, llvm::MachineInstr::NoSWrap, llvm::MachineInstr::NoUWrap, printImplicitRegisterFlag(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::VRegInfo::RC, Reg, llvm::VRegInfo::REGBANK, llvm::VRegInfo::RegBank, llvm::RegState::Renamable, llvm::MIToken::rparen, llvm::MachineRegisterInfo::setType(), llvm::ArrayRef< T >::size(), llvm::StringRef::str(), SubReg, llvm::MachineInstr::tieOperands(), TRI, llvm::RegState::Undef, llvm::MIToken::underscore, llvm::VRegInfo::UNKNOWN, llvm::MIToken::VirtualRegister, and llvm::VRegInfo::VReg.
|
static |
Definition at line 2833 of file MIParser.cpp.
References llvm::ModuleSlotTracker::getLocalSlot(), and llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert().
Referenced by initSlots2Values().
|
static |
Definition at line 916 of file MIParser.cpp.
References assert(), llvm::MachineOperand::isDef(), and llvm::MachineOperand::isImplicit().
Referenced by isImplicitOperandIn().
|
static |
Definition at line 394 of file MIParser.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineBasicBlock::addSuccessor(), assert(), llvm::MachineInstr::BundledPred, llvm::MachineInstr::BundledSucc, llvm::MIToken::colon, llvm::MIToken::coloncolon, llvm::MIToken::comma, llvm::MachineOperand::CreateImm(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::SmallVectorBase::empty(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MIToken::Eof, llvm::MIToken::equal, error, llvm::LaneBitmask::getAll(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getName(), llvm::BranchProbability::getRaw(), llvm::Function::getValueSymbolTable(), llvm::guessSuccessors(), llvm::MIToken::HexLiteral, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineBasicBlock::insert(), llvm::MachineFunction::insert(), llvm::MIToken::IntegerLiteral, llvm::MIToken::IRBlock, llvm::MachineOperand::isReg(), llvm::MIToken::kw_address_taken, llvm::MIToken::kw_align, llvm::MIToken::kw_debug_location, llvm::MIToken::kw_landing_pad, llvm::MIToken::kw_liveins, llvm::MIToken::kw_post_instr_symbol, llvm::MIToken::kw_pre_instr_symbol, llvm::MIToken::kw_successors, llvm::MIToken::lbrace, llvm::ValueSymbolTable::lookup(), llvm::MIToken::lparen, llvm::MIToken::MachineBasicBlock, llvm::MIToken::MachineBasicBlockLabel, llvm::BitmaskEnumDetail::Mask(), llvm::PerFunctionMIParsingState::MBBSlots, llvm::PerFunctionMIParsingState::MF, MI, Name, llvm::MIToken::NamedRegister, llvm::MIToken::Newline, llvm::MachineBasicBlock::normalizeSuccProbs(), llvm::json::parse(), llvm::parseMBBReference(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MIToken::rbrace, Reg, llvm::MIToken::rparen, llvm::MachineInstr::setFlag(), llvm::MachineOperand::setIsDebug(), and llvm::toString().