LLVM  14.0.0git
Typedefs | Functions
MIParser.cpp File Reference
#include "llvm/CodeGen/MIRParser/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/GlobalISel/RegisterBank.h"
#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
#include "llvm/CodeGen/MIRFormatter.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.

Typedefs

typedef function_ref< bool(StringRef::iterator Loc, const Twine &)> ErrorCallbackType
 

Functions

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 const char * toString (MIToken::TokenKind TokenKind)
 
static const char * printImplicitRegisterFlag (const MachineOperand &MO)
 
static std::string getRegisterName (const TargetRegisterInfo *TRI, Register Reg)
 
static bool isImplicitOperandIn (const MachineOperand &ImplicitOperand, ArrayRef< ParsedMachineOperand > Operands)
 Return true if the parsed machine operands contain a given machine operand. More...
 
static bool parseIRConstant (StringRef::iterator Loc, StringRef StringValue, PerFunctionMIParsingState &PFS, const Constant *&C, ErrorCallbackType ErrCB)
 
static bool verifyScalarSize (uint64_t Size)
 
static bool verifyVectorElementCount (uint64_t NumElts)
 
static bool verifyAddrSpace (uint64_t AddrSpace)
 
static bool getHexUint (const MIToken &Token, APInt &Result)
 
static bool getUnsigned (const MIToken &Token, unsigned &Result, ErrorCallbackType ErrCB)
 
static bool parseGlobalValue (const MIToken &Token, PerFunctionMIParsingState &PFS, GlobalValue *&GV, ErrorCallbackType ErrCB)
 
static bool parseIRValue (const MIToken &Token, PerFunctionMIParsingState &PFS, const Value *&V, ErrorCallbackType ErrCB)
 
static void initSlots2BasicBlocks (const Function &F, DenseMap< unsigned, const BasicBlock * > &Slots2BasicBlocks)
 
static const BasicBlockgetIRBlockFromSlot (unsigned Slot, const DenseMap< unsigned, const BasicBlock * > &Slots2BasicBlocks)
 

Typedef Documentation

◆ ErrorCallbackType

Definition at line 611 of file MIParser.cpp.

Function Documentation

◆ getHexUint()

static bool getHexUint ( const MIToken Token,
APInt Result 
)
static

◆ getIRBlockFromSlot()

static const BasicBlock* getIRBlockFromSlot ( unsigned  Slot,
const DenseMap< unsigned, const BasicBlock * > &  Slots2BasicBlocks 
)
static

◆ getRegisterName()

static std::string getRegisterName ( const TargetRegisterInfo TRI,
Register  Reg 
)
static

◆ getUnsigned()

static bool getUnsigned ( const MIToken Token,
unsigned &  Result,
ErrorCallbackType  ErrCB 
)
static

◆ initSlots2BasicBlocks()

static void initSlots2BasicBlocks ( const Function F,
DenseMap< unsigned, const BasicBlock * > &  Slots2BasicBlocks 
)
static

◆ initSlots2Values()

static void initSlots2Values ( const Function F,
DenseMap< unsigned, const Value * > &  Slots2Values 
)
static

Creates the mapping from slot numbers to function's unnamed IR values.

Definition at line 356 of file MIParser.cpp.

References Arg, BB, F, I, llvm::ModuleSlotTracker::incorporateFunction(), and mapValueToSlot().

Referenced by llvm::PerFunctionMIParsingState::getIRValue().

◆ isImplicitOperandIn()

static bool isImplicitOperandIn ( const MachineOperand ImplicitOperand,
ArrayRef< ParsedMachineOperand >  Operands 
)
static

Return true if the parsed machine operands contain a given machine operand.

Definition at line 1335 of file MIParser.cpp.

References I, llvm::MachineOperand::isIdenticalTo(), and Operands.

◆ mapValueToSlot()

static void mapValueToSlot ( const Value V,
ModuleSlotTracker MST,
DenseMap< unsigned, const Value * > &  Slots2Values 
)
static

◆ parseGlobalValue()

static bool parseGlobalValue ( const MIToken Token,
PerFunctionMIParsingState PFS,
GlobalValue *&  GV,
ErrorCallbackType  ErrCB 
)
static

◆ parseIRConstant()

static bool parseIRConstant ( StringRef::iterator  Loc,
StringRef  StringValue,
PerFunctionMIParsingState PFS,
const Constant *&  C,
ErrorCallbackType  ErrCB 
)
static

Definition at line 1770 of file MIParser.cpp.

References llvm::Sched::Source, and llvm::StringRef::str().

Referenced by parseIRValue().

◆ parseIRValue()

static bool parseIRValue ( const MIToken Token,
PerFunctionMIParsingState PFS,
const Value *&  V,
ErrorCallbackType  ErrCB 
)
static

◆ printImplicitRegisterFlag()

static const char* printImplicitRegisterFlag ( const MachineOperand MO)
static

◆ toString()

static const char* toString ( MIToken::TokenKind  TokenKind)
static

◆ verifyAddrSpace()

static bool verifyAddrSpace ( uint64_t  AddrSpace)
static

Definition at line 1807 of file MIParser.cpp.

◆ verifyScalarSize()

static bool verifyScalarSize ( uint64_t  Size)
static

Definition at line 1799 of file MIParser.cpp.

References llvm::isUInt< 16 >(), and llvm::Check::Size.

◆ verifyVectorElementCount()

static bool verifyVectorElementCount ( uint64_t  NumElts)
static

Definition at line 1803 of file MIParser.cpp.

References llvm::isUInt< 16 >().