2015-06-23 01:02:30 +08:00
|
|
|
//===- MIParser.h - Machine Instructions Parser ---------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the function that parses the machine instructions.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_CODEGEN_MIRPARSER_MIPARSER_H
|
|
|
|
#define LLVM_LIB_CODEGEN_MIRPARSER_MIPARSER_H
|
|
|
|
|
2015-06-27 00:46:11 +08:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2015-06-23 01:02:30 +08:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2015-07-28 06:42:41 +08:00
|
|
|
class BasicBlock;
|
2015-06-27 00:46:11 +08:00
|
|
|
class MachineBasicBlock;
|
2015-06-23 01:02:30 +08:00
|
|
|
class MachineInstr;
|
|
|
|
class MachineFunction;
|
2015-06-27 06:56:48 +08:00
|
|
|
struct SlotMapping;
|
2015-06-23 01:02:30 +08:00
|
|
|
class SMDiagnostic;
|
|
|
|
class SourceMgr;
|
|
|
|
|
2015-07-08 01:46:43 +08:00
|
|
|
struct PerFunctionMIParsingState {
|
|
|
|
DenseMap<unsigned, MachineBasicBlock *> MBBSlots;
|
2015-07-11 06:51:20 +08:00
|
|
|
DenseMap<unsigned, unsigned> VirtualRegisterSlots;
|
2015-07-17 07:37:45 +08:00
|
|
|
DenseMap<unsigned, int> FixedStackObjectSlots;
|
|
|
|
DenseMap<unsigned, int> StackObjectSlots;
|
2015-07-21 04:51:18 +08:00
|
|
|
DenseMap<unsigned, unsigned> ConstantPoolSlots;
|
2015-07-16 07:38:35 +08:00
|
|
|
DenseMap<unsigned, unsigned> JumpTableSlots;
|
2015-07-08 01:46:43 +08:00
|
|
|
};
|
|
|
|
|
2015-07-01 01:47:50 +08:00
|
|
|
bool parseMachineInstr(MachineInstr *&MI, SourceMgr &SM, MachineFunction &MF,
|
2015-07-08 01:46:43 +08:00
|
|
|
StringRef Src, const PerFunctionMIParsingState &PFS,
|
2015-07-01 01:47:50 +08:00
|
|
|
const SlotMapping &IRSlots, SMDiagnostic &Error);
|
2015-06-23 01:02:30 +08:00
|
|
|
|
2015-07-01 02:16:42 +08:00
|
|
|
bool parseMBBReference(MachineBasicBlock *&MBB, SourceMgr &SM,
|
|
|
|
MachineFunction &MF, StringRef Src,
|
2015-07-08 01:46:43 +08:00
|
|
|
const PerFunctionMIParsingState &PFS,
|
2015-07-01 02:16:42 +08:00
|
|
|
const SlotMapping &IRSlots, SMDiagnostic &Error);
|
|
|
|
|
2015-07-15 05:24:41 +08:00
|
|
|
bool parseNamedRegisterReference(unsigned &Reg, SourceMgr &SM,
|
|
|
|
MachineFunction &MF, StringRef Src,
|
|
|
|
const PerFunctionMIParsingState &PFS,
|
|
|
|
const SlotMapping &IRSlots,
|
|
|
|
SMDiagnostic &Error);
|
|
|
|
|
2015-07-28 01:42:45 +08:00
|
|
|
bool parseVirtualRegisterReference(unsigned &Reg, SourceMgr &SM,
|
|
|
|
MachineFunction &MF, StringRef Src,
|
|
|
|
const PerFunctionMIParsingState &PFS,
|
|
|
|
const SlotMapping &IRSlots,
|
|
|
|
SMDiagnostic &Error);
|
|
|
|
|
2015-07-28 06:42:41 +08:00
|
|
|
bool parseIRBlockReference(const BasicBlock *&BB, SourceMgr &SM,
|
|
|
|
MachineFunction &MF, StringRef Src,
|
|
|
|
const PerFunctionMIParsingState &PFS,
|
|
|
|
const SlotMapping &IRSlots, SMDiagnostic &Error);
|
|
|
|
|
2015-06-23 01:02:30 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|