aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/MachineInstrBuilder.h6
-rw-r--r--include/llvm/CodeGen/MachineOperand.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h
index 6ca63f0110..8eb0add019 100644
--- a/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -22,6 +22,7 @@
namespace llvm {
class TargetInstrDesc;
+class MDNode;
namespace RegState {
enum {
@@ -123,6 +124,11 @@ public:
MI->addOperand(MO);
return *this;
}
+
+ const MachineInstrBuilder &addMetadata(MDNode *MD) const {
+ MI->addOperand(MachineOperand::CreateMetadata(MD));
+ return *this;
+ }
};
/// BuildMI - Builder interface. Specify how to create the initial instruction
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h
index 452c384b6a..907c25af7d 100644
--- a/include/llvm/CodeGen/MachineOperand.h
+++ b/include/llvm/CodeGen/MachineOperand.h
@@ -317,7 +317,7 @@ public:
return Contents.OffsetedInfo.Val.SymbolName;
}
- MDNode *getMetadata() const {
+ const MDNode *getMetadata() const {
assert(isMetadata() && "Wrong MachineOperand accessor");
return Contents.MD;
}