From edd5dfcd890dad921bb0c0edb1551597bd6124d7 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 18 Sep 2019 08:31:28 +0000 Subject: [Support] Replace function with function_ref in writeFileAtomically. NFC Summary: The latter is slightly more efficient and communicates the intent of the API: writeFileAtomically does not own or copy the callback, it merely calls it at some point. Reviewers: jkorous Reviewed By: jkorous Subscribers: hiraditya, dexonsmith, jfb, llvm-commits, cfe-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67584 llvm-svn: 372201 --- llvm/lib/Support/FileUtilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support/FileUtilities.cpp') diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp index d11fbb54dc0..3d862f5f09e 100644 --- a/llvm/lib/Support/FileUtilities.cpp +++ b/llvm/lib/Support/FileUtilities.cpp @@ -296,7 +296,7 @@ llvm::Error llvm::writeFileAtomically(StringRef TempPathModel, 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, -- cgit v1.2.3