63 bool NoLLVMIR =
false;
66 bool NoMIRDocuments =
false;
121 std::vector<CalleeSavedInfo> &CSIInfo,
123 bool IsRestored,
int FrameIdx);
125 template <
typename T>
180 In(SM.getMemoryBuffer(
181 SM.AddNewSourceBuffer(
std::move(Contents),
SMLoc()))->getBuffer(),
226 if (!In.setCurrentDocument()) {
230 NoMIRDocuments =
true;
231 return llvm::make_unique<Module>(Filename, Context);
234 std::unique_ptr<Module> M;
237 if (
const auto *BSN =
238 dyn_cast_or_null<yaml::BlockScalarNode>(In.getCurrentNode())) {
241 Context, &IRSlots,
false);
247 if (!In.setCurrentDocument())
248 NoMIRDocuments =
true;
251 M = llvm::make_unique<Module>(Filename, Context);
266 }
while (In.setCurrentDocument());
284 yaml::EmptyContext Ctx;
285 yaml::yamlize(In, YamlMF,
false, Ctx);
296 return error(
Twine(
"function '") + FunctionName +
297 "' isn't defined in the provided LLVM IR");
301 return error(
Twine(
"redefinition of machine function '") + FunctionName +
326 bool HasInlineAsm =
false;
331 if (
MI.isInlineAsm())
337 MF.setHasInlineAsm(HasInlineAsm);
353 initNames2RegClasses(MF);
354 initNames2RegBanks(MF);
422 computeFunctionProperties(MF);
443 return error(VReg.ID.SourceRange.Start,
444 Twine(
"redefinition of virtual register '%") +
445 Twine(VReg.ID.Value) +
"'");
452 const auto *RC = getRegClass(MF, VReg.Class.Value);
457 const RegisterBank *RegBank = getRegBank(MF, VReg.Class.Value);
460 VReg.Class.SourceRange.Start,
461 Twine(
"use of undefined register class or register bank '") +
462 VReg.Class.Value +
"'");
468 if (!VReg.PreferredRegister.Value.empty()) {
470 return error(VReg.Class.SourceRange.Start,
471 Twine(
"preferred register can only be set for normal vregs"));
474 VReg.PreferredRegister.Value, Error))
475 return error(Error, VReg.PreferredRegister.SourceRange);
480 for (
const auto &LiveIn : YamlMF.
LiveIns) {
483 return error(Error, LiveIn.Register.SourceRange);
485 if (!LiveIn.VirtualRegister.Value.empty()) {
489 return error(Error, LiveIn.VirtualRegister.SourceRange);
502 return error(Error, RegSource.SourceRange);
521 error(
Twine(
"Cannot determine class/bank of virtual register ") +
541 populateVRegInfo(Info,
Twine(
I->first()));
546 populateVRegInfo(Info,
Twine(
P.first));
591 if (parseMBBReference(PFS, MBB, YamlMFI.
SavePoint))
602 std::vector<CalleeSavedInfo> CSIInfo;
608 Object.IsImmutable, Object.IsAliased);
616 return error(Object.ID.SourceRange.Start,
617 Twine(
"redefinition of fixed stack object '%fixed-stack.") +
618 Twine(Object.ID.Value) +
"'");
620 Object.CalleeSavedRestored, ObjectIdx))
631 if (!Name.
Value.empty()) {
632 Alloca = dyn_cast_or_null<AllocaInst>(
636 "alloca instruction named '" + Name.
Value +
637 "' isn't defined in the function '" + F.
getName() +
644 Object.Size, Object.Alignment,
651 return error(Object.ID.SourceRange.Start,
652 Twine(
"redefinition of stack object '%stack.") +
653 Twine(Object.ID.Value) +
"'");
655 Object.CalleeSavedRestored, ObjectIdx))
657 if (Object.LocalOffset)
663 if (!CSIInfo.empty())
679 std::vector<CalleeSavedInfo> &CSIInfo,
681 if (RegisterSource.
Value.empty())
689 CSIInfo.push_back(CSI);
694 template <
typename T>
703 "expected a reference to a '" + TypeString +
708 template <
typename T>
710 const T &Object,
int FrameIdx) {
713 MDNode *Var =
nullptr, *Expr =
nullptr, *Loc =
nullptr;
714 if (parseMDNode(PFS, Var, Object.DebugVar) ||
715 parseMDNode(PFS, Expr, Object.DebugExpr) ||
716 parseMDNode(PFS, Loc, Object.DebugLoc))
718 if (!Var && !Expr && !Loc)
723 if (
typecheckMDNode(DIVar, Var, Object.DebugVar,
"DILocalVariable", *
this) ||
724 typecheckMDNode(DIExpr, Expr, Object.DebugExpr,
"DIExpression", *
this) ||
733 if (Source.
Value.empty())
747 for (
const auto &YamlConstant : YamlMF.
Constants) {
748 if (YamlConstant.IsTargetSpecific)
750 return error(YamlConstant.Value.SourceRange.Start,
751 "Can't parse target-specific constant pool entries yet");
755 return error(Error, YamlConstant.Value.SourceRange);
757 YamlConstant.Alignment
758 ? YamlConstant.Alignment
759 : M.getDataLayout().getPrefTypeAlignment(Value->
getType());
761 if (!ConstantPoolSlots.
insert(std::make_pair(YamlConstant.ID.Value, Index))
763 return error(YamlConstant.ID.SourceRange.Start,
764 Twine(
"redefinition of constant pool item '%const.") +
765 Twine(YamlConstant.ID.Value) +
"'");
773 for (
const auto &Entry : YamlJTI.
Entries) {
774 std::vector<MachineBasicBlock *> Blocks;
775 for (
const auto &MBBSource : Entry.Blocks) {
777 if (parseMBBReference(PFS, MBB, MBBSource.Value))
784 return error(Entry.ID.SourceRange.Start,
785 Twine(
"redefinition of jump table entry '%jump-table.") +
786 Twine(Entry.ID.Value) +
"'");
805 *Loc.getPointer() ==
'\'';
808 Loc = Loc.getFromPointer(Loc.getPointer() + Error.
getColumnNo() +
823 unsigned Line = LineAndColumn.first + Error.
getLineNo() - 1;
832 if (L.line_number() == Line) {
848 if (!Names2RegClasses.
empty())
859 if (!Names2RegBanks.
empty())
869 std::make_pair(
StringRef(RegBank.getName()).lower(), &RegBank));
875 auto RegClassInfo = Names2RegClasses.
find(Name);
876 if (RegClassInfo == Names2RegClasses.
end())
878 return RegClassInfo->getValue();
883 auto RegBankInfo = Names2RegBanks.
find(Name);
884 if (RegBankInfo == Names2RegBanks.
end())
886 return RegBankInfo->getValue();
890 : Impl(
std::move(Impl)) {}
895 return Impl->parseIRModule();
899 return Impl->parseMachineFunctions(M, MMI);
906 if (std::error_code EC = FileOrErr.getError()) {
908 "Could not open input file: " + EC.message());
914 std::unique_ptr<MIRParser>
917 auto Filename = Contents->getBufferIdentifier();
923 "Can't read MIR with a Context that discards named Values")));
926 return llvm::make_unique<MIRParser>(
927 llvm::make_unique<MIRParserImpl>(std::move(Contents), Filename,
Context));
void setHasStackMap(bool s=true)
void setFrameAddressIsTaken(bool T)
Represents a range in source code.
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
void setSavePoint(MachineBasicBlock *NewSave)
bool parseMachineBasicBlockDefinitions(PerFunctionMIParsingState &PFS, StringRef Src, SMDiagnostic &Error)
Parse the machine basic block definitions, and skip the machine instructions.
void setRestorePoint(MachineBasicBlock *NewRestore)
DenseMap< unsigned, unsigned > JumpTableSlots
void mapLocalFrameObject(int ObjectIndex, int64_t Offset)
Map a frame index into the local object block.
void setCalleeSavedInfoValid(bool v)
DenseMap< unsigned, unsigned > ConstantPoolSlots
This class represents lattice values for constants.
MachineFunctionProperties & reset(Property P)
void setHasWinCFI(bool v)
Constant * parseConstantValue(StringRef Asm, SMDiagnostic &Err, const Module &M, const SlotMapping *Slots=nullptr)
Parse a type and a constant value in the given string.
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
static unsigned index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
A Module instance is used to store all the information related to an LLVM module. ...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
const MachineFunctionProperties & getProperties() const
Get the function properties.
std::unique_ptr< MIRParser > createMIRParser(std::unique_ptr< MemoryBuffer > Contents, LLVMContext &Context)
This function is another interface to the MIR serialization format parser.
void push_back(const T &Elt)
Optional< std::vector< FlowStringValue > > CalleeSavedRegisters
static std::unique_ptr< MemoryBuffer > getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
Open the specified memory range as a MemoryBuffer.
unsigned getNumRegBanks() const
Get the total number of register banks.
Diagnostic information for machine IR parser.
bool parseMachineFunction(Module &M, MachineModuleInfo &MMI)
Parse the machine function in the current YAML document.
iterator find(StringRef Key)
DenseMap< unsigned, int > StackObjectSlots
A forward iterator which reads text lines from a buffer.
virtual const RegisterBankInfo * getRegBankInfo() const
If the information for the register banks is available, return it.
unsigned const TargetRegisterInfo * TRI
DenseMap< unsigned, VRegInfo * > VRegInfos
bool hasOneDef(unsigned RegNo) const
Return true if there is exactly one operand defining the specified register.
ArrayRef< SMFixIt > getFixIts() const
void setRegBank(unsigned Reg, const RegisterBank &RegBank)
Set the register bank to RegBank for Reg.
bool parseMBBReference(PerFunctionMIParsingState &PFS, MachineBasicBlock *&MBB, StringRef Src, SMDiagnostic &Error)
const TargetRegisterClass * RC
std::pair< unsigned, unsigned > getLineAndColumn(SMLoc Loc, unsigned BufferID=0) const
Find the line and column number for the specified location in the specified file. ...
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
const TargetRegisterClass * getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
MachineJumpTableInfo * getOrCreateJumpTableInfo(unsigned JTEntryKind)
getOrCreateJumpTableInfo - Get the JumpTableInfo for this function, if it does already exist...
static Function * createDummyFunction(StringRef Name, Module &M)
Create an empty function with the given name.
std::unique_ptr< Module > parseIRModule()
Try to parse the optional LLVM module and the machine functions in the MIR file.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
const char * getRegClassName(const TargetRegisterClass *Class) const
Returns the name of the register class.
Holds all the information related to register banks.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void setHasPatchPoint(bool s=true)
void setLocalFrameSize(int64_t sz)
Set the size of the local object blob.
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVMContext & getContext() const
Get the global data context.
union llvm::VRegInfo::@347 D
void freezeReservedRegs(const MachineFunction &)
freezeReservedRegs - Called by the register allocator to freeze the set of reserved registers before ...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
bool parseMachineFunctions(Module &M, MachineModuleInfo &MMI)
Parses MachineFunctions in the MIR file and add them to the given MachineModuleInfo MMI...
MIRParserImpl(std::unique_ptr< MemoryBuffer > Contents, StringRef Filename, LLVMContext &Context)
unsigned getNumRegClasses() const
DenseMap< unsigned, int > FixedStackObjectSlots
const MemoryBuffer * getMemoryBuffer(unsigned i) const
Type * getType() const
All values are typed, get the type of this value.
std::vector< VirtualRegisterDefinition > VirtualRegisters
StringRef getLineContents() const
bool setupRegisterInfo(const PerFunctionMIParsingState &PFS, const yaml::MachineFunction &YamlMF)
void setHasMustTailInVarArgFunc(bool B)
bool HasMustTailInVarArgFunc
unsigned CVBytesOfCalleeSavedRegisters
unsigned AddNewSourceBuffer(std::unique_ptr< MemoryBuffer > F, SMLoc IncludeLoc)
Add a new source buffer to this source manager.
static void handleYAMLDiag(const SMDiagnostic &Diag, void *Context)
virtual void mirFileLoaded(MachineFunction &MF) const
This is called after a .mir file was loaded.
bool parseVirtualRegisterReference(PerFunctionMIParsingState &PFS, VRegInfo *&Info, StringRef Src, SMDiagnostic &Error)
void setStackProtectorIndex(int I)
void setHasOpaqueSPAdjustment(bool B)
Analysis containing CSE Info
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
std::unique_ptr< Module > parseAssembly(MemoryBufferRef F, SMDiagnostic &Err, LLVMContext &Context, SlotMapping *Slots=nullptr, bool UpgradeDebugInfo=true, StringRef DataLayoutString="")
parseAssemblyFile and parseAssemblyString are wrappers around this function.
unsigned getMainFileID() const
const char * getPointer() const
bool parseStackObjectReference(PerFunctionMIParsingState &PFS, int &FI, StringRef Src, SMDiagnostic &Error)
bool parseMachineFunctions(Module &M, MachineModuleInfo &MMI)
unsigned const MachineRegisterInfo * MRI
bool parseRegisterInfo(PerFunctionMIParsingState &PFS, const yaml::MachineFunction &YamlMF)
bool parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, const T &Object, int FrameIdx)
static bool isSSA(const MachineFunction &MF)
LLVM Basic Block Representation.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
This is an important class for using LLVM in a threaded context.
bool shouldDiscardValueNames() const
Return true if the Context runtime configuration is set to discard all value names.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
This function has undefined behavior.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
void setStackSize(uint64_t Size)
Set the size of the stack.
StringMap< VRegInfo * > VRegInfosNamed
MachineJumpTable JumpTableInfo
Constant pool.
bool initializeJumpTableInfo(PerFunctionMIParsingState &PFS, const yaml::MachineJumpTable &YamlJTI)
bool parseNamedRegisterReference(PerFunctionMIParsingState &PFS, unsigned &Reg, StringRef Src, SMDiagnostic &Error)
static Type * getVoidTy(LLVMContext &C)
void setHasVAStart(bool B)
static bool typecheckMDNode(T *&Result, MDNode *Node, const yaml::StringValue &Source, StringRef TypeString, MIRParserImpl &Parser)
Verify that given node is of a certain type. Return true on error.
unsigned MaxCallFrameSize
~0u means: not computed yet.
StringValue StackProtector
static FunctionType * get(Type *Result, ArrayRef< Type *> Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
std::vector< MachineStackObject > StackObjects
bool def_empty(unsigned RegNo) const
def_empty - Return true if there are no instructions defining the specified register (it may be live-...
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
void setCalleeSavedRegs(ArrayRef< MCPhysReg > CSRs)
Sets the updated Callee Saved Registers list.
void reportDiagnostic(const SMDiagnostic &Diag)
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
Serializable representation of MachineFrameInfo.
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
void setStackID(int ObjectIdx, uint8_t ID)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
MachineFunction & getOrCreateMachineFunction(const Function &F)
Returns the MachineFunction constructed for the IR function F.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
SMDiagnostic GetMessage(SMLoc Loc, DiagKind Kind, const Twine &Msg, ArrayRef< SMRange > Ranges=None, ArrayRef< SMFixIt > FixIts=None) const
Return an SMDiagnostic at the specified location with the specified string.
This class implements the parsing of LLVM IR that's embedded inside a MIR file.
bool parseMachineInstructions(PerFunctionMIParsingState &PFS, StringRef Src, SMDiagnostic &Error)
Parse the machine instructions.
RegisterBank & getRegBank(unsigned ID)
Get the register bank identified by ID.
MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr...
enum llvm::VRegInfo::uint8_t Kind
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
StringRef getMessage() const
MachineFrameInfo FrameInfo
int CreateFixedSpillStackObject(uint64_t Size, int64_t SPOffset, bool IsImmutable=false)
Create a spill slot at a fixed location on the stack.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
void setOffsetAdjustment(int Adj)
Set the correction for frame offsets.
ArrayRef< std::pair< unsigned, unsigned > > getRanges() const
void invalidateLiveness()
invalidateLiveness - Indicates that register liveness is no longer being tracked accurately.
void setAdjustsStack(bool V)
This class implements the register bank concept.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
ValueSymbolTable * getValueSymbolTable()
getSymbolTable() - Return the symbol table if any, otherwise nullptr.
bool HasOpaqueSPAdjustment
The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
A wrapper around std::string which contains a source range that's being set during parsing...
SourceMgr::DiagKind getKind() const
This struct contains the mappings from the slot numbers to unnamed metadata nodes, global values and types.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
bool parseMDNode(PerFunctionMIParsingState &PFS, MDNode *&Node, StringRef Src, SMDiagnostic &Error)
bool error(const Twine &Message)
Report an error with the given message at unknown location.
static SMLoc getFromPointer(const char *Ptr)
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
MachineFunctionProperties & set(Property P)
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileOrSTDIN(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true)
Open the specified file as a MemoryBuffer, or open stdin if the Filename is "-".
bool Explicit
VReg was explicitly specified in the .mir file.
Representation of each machine instruction.
void setCalleeSavedInfo(const std::vector< CalleeSavedInfo > &CSI)
Used by prolog/epilog inserter to set the function's callee saved information.
std::vector< MachineFunctionLiveIn > LiveIns
void ensureMaxAlignment(unsigned Align)
Make sure the function is at least Align bytes aligned.
bool initializeFrameInfo(PerFunctionMIParsingState &PFS, const yaml::MachineFunction &YamlMF)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool verify(Pass *p=nullptr, const char *Banner=nullptr, bool AbortOnError=true) const
Run the current MachineFunction through the machine code verifier, useful for debugger use...
std::vector< Entry > Entries
StringRef getName() const
Return a constant reference to the value's name.
VRegInfo & getVRegInfo(unsigned Num)
void push_back(MachineInstr *MI)
bool IsReturnAddressTaken
void setMaxCallFrameSize(unsigned S)
void addPhysRegsUsedFromRegMask(const uint32_t *RegMask)
addPhysRegsUsedFromRegMask - Mark any registers not in RegMask as used.
std::vector< MachineConstantPoolValue > Constants
bool tracksLiveness() const
tracksLiveness - Returns true when tracking register liveness accurately.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void setCVBytesOfCalleeSavedRegisters(unsigned S)
MIRParser(std::unique_ptr< MIRParserImpl > Impl)
void setExposesReturnsTwice(bool B)
setCallsSetJmp - Set a flag that indicates if there's a call to a "returns twice" function...
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
void setSimpleHint(unsigned VReg, unsigned PrefReg)
Specify the preferred (target independent) register allocation hint for the specified virtual registe...
Value * lookup(StringRef Name) const
This method finds the value with the given Name in the the symbol table.
std::string str() const
Return the twine contents as a std::string.
bool initializeConstantPool(PerFunctionMIParsingState &PFS, MachineConstantPool &ConstantPool, const yaml::MachineFunction &YamlMF)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::vector< FixedMachineStackObject > FixedStackObjects
void setReturnAddressIsTaken(bool s)
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
Lightweight error class with error context and mandatory checking.
std::unique_ptr< Module > parseIRModule()
Parses the optional LLVM IR module in the MIR file.
void setAlignment(unsigned A)
setAlignment - Set the alignment (log2, not bytes) of the function.
unsigned createJumpTableIndex(const std::vector< MachineBasicBlock *> &DestBBs)
createJumpTableIndex - Create a new jump table.
void setObjectOffset(int ObjectIdx, int64_t SPOffset)
Set the stack frame offset of the specified object.
void setRegClass(unsigned Reg, const TargetRegisterClass *RC)
setRegClass - Set the register class of the specified virtual register.
StringRef - Represent a constant reference to a string, i.e.
const RegisterBank * RegBank
MachineJumpTableInfo::JTEntryKind Kind
Represents a location in source code.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool parseRegisterReference(PerFunctionMIParsingState &PFS, unsigned &Reg, StringRef Src, SMDiagnostic &Error)
std::unique_ptr< MIRParser > createMIRParserFromFile(StringRef Filename, SMDiagnostic &Error, LLVMContext &Context)
This function is the main interface to the MIR serialization format parser.
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
Collect information used to emit debugging information of a variable.
int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca)
Notify the MachineFrameInfo object that a variable sized object has been created. ...
void setObjectAlignment(int ObjectIdx, unsigned Align)
setObjectAlignment - Change the alignment of the specified stack object.
bool initializeMachineFunction(const yaml::MachineFunction &YamlMF, MachineFunction &MF)
Initialize the machine function to the state that's described in the MIR file.
unsigned getConstantPoolIndex(const Constant *C, unsigned Alignment)
getConstantPoolIndex - Create a new entry in the constant pool or return an existing one...
bool parseCalleeSavedRegister(PerFunctionMIParsingState &PFS, std::vector< CalleeSavedInfo > &CSIInfo, const yaml::StringValue &RegisterSource, bool IsRestored, int FrameIdx)
Properties which a MachineFunction may have at a given point in time.
This class contains meta information specific to a module.
an instruction to allocate memory on the stack
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...