diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-01-15 15:37:28 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-01-15 15:37:28 +0000 |
| commit | 829000e035f46f2a227a5466e4e427a2f3cc00a9 (patch) | |
| tree | be5a687969f682edded4aa6f13594ffd9aa9030e /include/llvm/CodeGen/MachineOperand.h | |
| parent | 1e7804dbd25b8dbf534c850355d70ad215206f4b (diff) | |
Notes
Diffstat (limited to 'include/llvm/CodeGen/MachineOperand.h')
| -rw-r--r-- | include/llvm/CodeGen/MachineOperand.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h index 8748afcba92e..907c25af7d47 100644 --- a/include/llvm/CodeGen/MachineOperand.h +++ b/include/llvm/CodeGen/MachineOperand.h @@ -26,6 +26,7 @@ class GlobalValue; class MachineInstr; class TargetMachine; class MachineRegisterInfo; +class MDNode; class raw_ostream; /// MachineOperand class - Representation of each machine instruction operand. @@ -42,7 +43,8 @@ public: MO_JumpTableIndex, ///< Address of indexed Jump Table for switch MO_ExternalSymbol, ///< Name of external global symbol 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: @@ -94,6 +96,7 @@ private: MachineBasicBlock *MBB; // For MO_MachineBasicBlock. const ConstantFP *CFP; // For MO_FPImmediate. int64_t ImmVal; // For MO_Immediate. + MDNode *MD; // For MO_Metadata. struct { // For MO_Register. unsigned RegNo; @@ -158,6 +161,8 @@ public: bool isSymbol() const { return OpKind == MO_ExternalSymbol; } /// isBlockAddress - Tests if this is a MO_BlockAddress operand. 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 @@ -311,6 +316,11 @@ public: assert(isSymbol() && "Wrong MachineOperand accessor"); return Contents.OffsetedInfo.Val.SymbolName; } + + const MDNode *getMetadata() const { + assert(isMetadata() && "Wrong MachineOperand accessor"); + return Contents.MD; + } //===--------------------------------------------------------------------===// // Mutators for various operand types. @@ -443,6 +453,13 @@ public: Op.setTargetFlags(TargetFlags); 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 MachineRegisterInfo; |
