diff options
author | Justin Bogner <mail@justinbogner.com> | 2017-10-10 23:34:01 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2017-10-10 23:34:01 +0000 |
commit | ec7cba53e616b63981e437d88dbf572510f45970 (patch) | |
tree | bbd800ae7049a6de91cb25c1fcd6fc6cb6c4d40e /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 64b4bcfa05df59cb687c1c5309731257b224135f (diff) | |
download | bcm5719-llvm-ec7cba53e616b63981e437d88dbf572510f45970.tar.gz bcm5719-llvm-ec7cba53e616b63981e437d88dbf572510f45970.zip |
CodeGen: Add MachineInstr::getMF(). NFC
Similarly to how Instruction has getFunction, this adds a less verbose
way to write MI->getParent()->getParent(). I'll follow up shortly with
a change that changes a bunch of the uses.
llvm-svn: 315388
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 66de99156b4..fadade26a89 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1154,6 +1154,10 @@ bool MachineInstr::isIdenticalTo(const MachineInstr &Other, return true; } +const MachineFunction *MachineInstr::getMF() const { + return getParent()->getParent(); +} + MachineInstr *MachineInstr::removeFromParent() { assert(getParent() && "Not embedded in a basic block!"); return getParent()->remove(this); |