[llvm] r310860 - [GISel]: Add some helper constructors to MIRBuilder
Aditya Nandakumar via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 14 10:25:11 PDT 2017
Author: aditya_nandakumar
Date: Mon Aug 14 10:25:11 2017
New Revision: 310860
URL: http://llvm.org/viewvc/llvm-project?rev=310860&view=rev
Log:
[GISel]: Add some helper constructors to MIRBuilder
https://reviews.llvm.org/D36636
Modified:
llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
Modified: llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h?rev=310860&r1=310859&r2=310860&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h Mon Aug 14 10:25:11 2017
@@ -85,6 +85,14 @@ class MachineIRBuilder {
addUsesFromArgs(MIB, std::forward<UseArgsTy>(Args)...);
}
public:
+ /// Some constructors for easy use.
+ MachineIRBuilder() = default;
+ MachineIRBuilder(MachineFunction &MF) { setMF(MF); }
+ MachineIRBuilder(MachineInstr &MI)
+ : MachineIRBuilder(*MI.getParent()->getParent()) {
+ setInstr(MI);
+ }
+
/// Getter for the function we currently build.
MachineFunction &getMF() {
assert(MF && "MachineFunction is not set");
More information about the llvm-commits
mailing list