diff options
author | Dale Johannesen <dalej@apple.com> | 2010-01-13 00:00:24 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-01-13 00:00:24 +0000 |
commit | 5f72a5ebc84a1935878b5b2d3166a505c520cdfc (patch) | |
tree | a408a1896dfac1301e5aea85056d1eeae4a226d4 /include/llvm/CodeGen | |
parent | 994a2045704601932467e5a773a589d8d3aee6f1 (diff) |
Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/MachineInstrBuilder.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineOperand.h | 2 |
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; } |