summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineOperand.h
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-01-12 02:01:53 +0000
committerDale Johannesen <dalej@apple.com>2010-01-12 02:01:53 +0000
commit68c3def12618f73ec237359cb07f8e9e68d50b3a (patch)
tree938faa1da244cbaed0d7fb0455a33a50ece45f52 /include/llvm/CodeGen/MachineOperand.h
parenta5a81d70720a4ce6ac7538927c2a874b0dfa8bd2 (diff)
downloadllvm-68c3def12618f73ec237359cb07f8e9e68d50b3a.tar.gz
llvm-68c3def12618f73ec237359cb07f8e9e68d50b3a.tar.bz2
llvm-68c3def12618f73ec237359cb07f8e9e68d50b3a.tar.xz
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
Diffstat (limited to 'include/llvm/CodeGen/MachineOperand.h')
-rw-r--r--include/llvm/CodeGen/MachineOperand.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h
index 8748afcba9..452c384b6a 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;
}
+
+ 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;