Skip to content

Commit 377aaa2

Browse files
committed
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. llvm-svn: 372202
1 parent edd5dfc commit 377aaa2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/include/llvm/Support/FileUtilities.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef LLVM_SUPPORT_FILEUTILITIES_H
1515
#define LLVM_SUPPORT_FILEUTILITIES_H
1616

17-
#include "llvm/ADT/STLExtras.h"
1817
#include "llvm/ADT/StringRef.h"
1918
#include "llvm/Support/Errc.h"
2019
#include "llvm/Support/ErrorHandling.h"
@@ -108,9 +107,9 @@ namespace llvm {
108107
llvm::Error writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
109108
StringRef Buffer);
110109

111-
llvm::Error writeFileAtomically(
112-
StringRef TempPathModel, StringRef FinalPath,
113-
llvm::function_ref<llvm::Error(llvm::raw_ostream &)> Writer);
110+
llvm::Error
111+
writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
112+
std::function<llvm::Error(llvm::raw_ostream &)> Writer);
114113
} // End llvm namespace
115114

116115
#endif

llvm/lib/Support/FileUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ llvm::Error llvm::writeFileAtomically(StringRef TempPathModel,
296296

297297
llvm::Error llvm::writeFileAtomically(
298298
StringRef TempPathModel, StringRef FinalPath,
299-
llvm::function_ref<llvm::Error(llvm::raw_ostream &)> Writer) {
299+
std::function<llvm::Error(llvm::raw_ostream &)> Writer) {
300300
SmallString<128> GeneratedUniqPath;
301301
int TempFD;
302302
if (sys::fs::createUniqueFile(TempPathModel.str(), TempFD,

0 commit comments

Comments
 (0)