mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Add MO_Metadata as an operand kind. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -26,6 +26,7 @@ class GlobalValue;
|
|||||||
class MachineInstr;
|
class MachineInstr;
|
||||||
class TargetMachine;
|
class TargetMachine;
|
||||||
class MachineRegisterInfo;
|
class MachineRegisterInfo;
|
||||||
|
class MDNode;
|
||||||
class raw_ostream;
|
class raw_ostream;
|
||||||
|
|
||||||
/// MachineOperand class - Representation of each machine instruction operand.
|
/// MachineOperand class - Representation of each machine instruction operand.
|
||||||
@ -42,7 +43,8 @@ public:
|
|||||||
MO_JumpTableIndex, ///< Address of indexed Jump Table for switch
|
MO_JumpTableIndex, ///< Address of indexed Jump Table for switch
|
||||||
MO_ExternalSymbol, ///< Name of external global symbol
|
MO_ExternalSymbol, ///< Name of external global symbol
|
||||||
MO_GlobalAddress, ///< Address of a global value
|
MO_GlobalAddress, ///< Address of a global value
|
||||||
MO_BlockAddress ///< Address of a basic block
|
MO_BlockAddress, ///< Address of a basic block
|
||||||
|
MO_Metadata ///< Metadata reference (for debug info)
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -94,6 +96,7 @@ private:
|
|||||||
MachineBasicBlock *MBB; // For MO_MachineBasicBlock.
|
MachineBasicBlock *MBB; // For MO_MachineBasicBlock.
|
||||||
const ConstantFP *CFP; // For MO_FPImmediate.
|
const ConstantFP *CFP; // For MO_FPImmediate.
|
||||||
int64_t ImmVal; // For MO_Immediate.
|
int64_t ImmVal; // For MO_Immediate.
|
||||||
|
MDNode *MD; // For MO_Metadata.
|
||||||
|
|
||||||
struct { // For MO_Register.
|
struct { // For MO_Register.
|
||||||
unsigned RegNo;
|
unsigned RegNo;
|
||||||
@ -158,6 +161,8 @@ public:
|
|||||||
bool isSymbol() const { return OpKind == MO_ExternalSymbol; }
|
bool isSymbol() const { return OpKind == MO_ExternalSymbol; }
|
||||||
/// isBlockAddress - Tests if this is a MO_BlockAddress operand.
|
/// isBlockAddress - Tests if this is a MO_BlockAddress operand.
|
||||||
bool isBlockAddress() const { return OpKind == MO_BlockAddress; }
|
bool isBlockAddress() const { return OpKind == MO_BlockAddress; }
|
||||||
|
/// isMetadata - Tests if this is a MO_Metadata operand.
|
||||||
|
bool isMetadata() const { return OpKind == MO_Metadata; }
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Accessors for Register Operands
|
// Accessors for Register Operands
|
||||||
@ -312,6 +317,11 @@ public:
|
|||||||
return Contents.OffsetedInfo.Val.SymbolName;
|
return Contents.OffsetedInfo.Val.SymbolName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MDNode *getMetadata() const {
|
||||||
|
assert(isMetadata() && "Wrong MachineOperand accessor");
|
||||||
|
return Contents.MD;
|
||||||
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Mutators for various operand types.
|
// Mutators for various operand types.
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
@ -443,6 +453,13 @@ public:
|
|||||||
Op.setTargetFlags(TargetFlags);
|
Op.setTargetFlags(TargetFlags);
|
||||||
return Op;
|
return Op;
|
||||||
}
|
}
|
||||||
|
static MachineOperand CreateMetadata(MDNode *Meta,
|
||||||
|
unsigned char TargetFlags = 0) {
|
||||||
|
MachineOperand Op(MachineOperand::MO_Metadata);
|
||||||
|
Op.Contents.MD = Meta;
|
||||||
|
Op.setTargetFlags(TargetFlags);
|
||||||
|
return Op;
|
||||||
|
}
|
||||||
|
|
||||||
friend class MachineInstr;
|
friend class MachineInstr;
|
||||||
friend class MachineRegisterInfo;
|
friend class MachineRegisterInfo;
|
||||||
|
Reference in New Issue
Block a user