[llvm] r372202 - Revert "r372201: [Support] Replace function with function_ref in writeFileAtomically. NFC"

Ilya Biryukov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 01:47:09 PDT 2019


Author: ibiryukov
Date: Wed Sep 18 01:47:09 2019
New Revision: 372202

URL: http://llvm.org/viewvc/llvm-project?rev=372202&view=rev
Log:
Revert "r372201: [Support] Replace function with function_ref in writeFileAtomically. NFC"

function_ref causes calls to the function to be ambiguous, breaking
compilation.

Reverting for now.

Modified:
    llvm/trunk/include/llvm/Support/FileUtilities.h
    llvm/trunk/lib/Support/FileUtilities.cpp

Modified: llvm/trunk/include/llvm/Support/FileUtilities.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileUtilities.h?rev=372202&r1=372201&r2=372202&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileUtilities.h (original)
+++ llvm/trunk/include/llvm/Support/FileUtilities.h Wed Sep 18 01:47:09 2019
@@ -14,7 +14,6 @@
 #ifndef LLVM_SUPPORT_FILEUTILITIES_H
 #define LLVM_SUPPORT_FILEUTILITIES_H
 
-#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/ErrorHandling.h"
@@ -108,9 +107,9 @@ namespace llvm {
   llvm::Error writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
                                   StringRef Buffer);
 
-  llvm::Error writeFileAtomically(
-      StringRef TempPathModel, StringRef FinalPath,
-      llvm::function_ref<llvm::Error(llvm::raw_ostream &)> Writer);
+  llvm::Error
+  writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
+                      std::function<llvm::Error(llvm::raw_ostream &)> Writer);
 } // End llvm namespace
 
 #endif

Modified: llvm/trunk/lib/Support/FileUtilities.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=372202&r1=372201&r2=372202&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FileUtilities.cpp (original)
+++ llvm/trunk/lib/Support/FileUtilities.cpp Wed Sep 18 01:47:09 2019
@@ -296,7 +296,7 @@ llvm::Error llvm::writeFileAtomically(St
 
 llvm::Error llvm::writeFileAtomically(
     StringRef TempPathModel, StringRef FinalPath,
-    llvm::function_ref<llvm::Error(llvm::raw_ostream &)> Writer) {
+    std::function<llvm::Error(llvm::raw_ostream &)> Writer) {
   SmallString<128> GeneratedUniqPath;
   int TempFD;
   if (sys::fs::createUniqueFile(TempPathModel.str(), TempFD,




More information about the llvm-commits mailing list