diff --git a/llvm/include/llvm/Support/FileUtilities.h b/llvm/include/llvm/Support/FileUtilities.h --- a/llvm/include/llvm/Support/FileUtilities.h +++ b/llvm/include/llvm/Support/FileUtilities.h @@ -14,6 +14,7 @@ #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" @@ -107,9 +108,9 @@ llvm::Error writeFileAtomically(StringRef TempPathModel, StringRef FinalPath, StringRef Buffer); - llvm::Error - writeFileAtomically(StringRef TempPathModel, StringRef FinalPath, - std::function Writer); + llvm::Error writeFileAtomically( + StringRef TempPathModel, StringRef FinalPath, + llvm::function_ref Writer); } // End llvm namespace #endif diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp --- a/llvm/lib/Support/FileUtilities.cpp +++ b/llvm/lib/Support/FileUtilities.cpp @@ -296,7 +296,7 @@ llvm::Error llvm::writeFileAtomically( StringRef TempPathModel, StringRef FinalPath, - std::function Writer) { + llvm::function_ref Writer) { SmallString<128> GeneratedUniqPath; int TempFD; if (sys::fs::createUniqueFile(TempPathModel.str(), TempFD,