[PATCH] D36636: [GISel][NFC]: Add some constructors for easy creation of MIRBuilders
Aditya Nandakumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 14 09:27:36 PDT 2017
aditya_nandakumar updated this revision to Diff 111002.
aditya_nandakumar marked an inline comment as done.
aditya_nandakumar added a comment.
Updated based on Quentin's feedback.
https://reviews.llvm.org/D36636
Files:
include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
Index: include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
===================================================================
--- include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+++ include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
@@ -85,6 +85,14 @@
addUsesFromArgs(MIB, std::forward<UseArgsTy>(Args)...);
}
public:
+ /// Some constructors for easy use.
+ MachineIRBuilder() = default;
+ MachineIRBuilder(MachineFunction &MF) { setMF(MF); }
+ MachineIRBuilder(MachineInstr &MI) {
+ setMF(*MI.getParent()->getParent());
+ setInstr(MI);
+ }
+
/// Getter for the function we currently build.
MachineFunction &getMF() {
assert(MF && "MachineFunction is not set");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36636.111002.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170814/d214a110/attachment.bin>
More information about the llvm-commits
mailing list