IRBuilder: Use move semantics for the IRBuilderInserter parameter
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 12 Aug 2015 23:18:49 +0000 (23:18 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 12 Aug 2015 23:18:49 +0000 (23:18 +0000)
Just drive by cleanup while fixing -Wdeprecated warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244832 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/IRBuilder.h

index b9f8019..8d365a0 100644 (file)
@@ -517,10 +517,9 @@ template<bool preserveNames = true, typename T = ConstantFolder,
 class IRBuilder : public IRBuilderBase, public Inserter {
   T Folder;
 public:
-  IRBuilder(LLVMContext &C, const T &F, const Inserter &I = Inserter(),
+  IRBuilder(LLVMContext &C, const T &F, Inserter I = Inserter(),
             MDNode *FPMathTag = nullptr)
-    : IRBuilderBase(C, FPMathTag), Inserter(I), Folder(F) {
-  }
+      : IRBuilderBase(C, FPMathTag), Inserter(std::move(I)), Folder(F) {}
 
   explicit IRBuilder(LLVMContext &C, MDNode *FPMathTag = nullptr)
     : IRBuilderBase(C, FPMathTag), Folder() {