-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Revert "Rename F_no_mmap to F_mmap"
#134924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-llvm-support @llvm/pr-subscribers-lld-elf Author: Douglas (dgg5503) ChangesReverts llvm/llvm-project#134787 Causes the LIT test Full diff: https://github.com/llvm/llvm-project/pull/134924.diff 5 Files Affected:
diff --git a/lld/ELF/Arch/ARM.cpp b/lld/ELF/Arch/ARM.cpp
index e45dd4d354afb..e667fdc0633c5 100644
--- a/lld/ELF/Arch/ARM.cpp
+++ b/lld/ELF/Arch/ARM.cpp
@@ -1489,7 +1489,7 @@ template <typename ELFT> void elf::writeARMCmseImportLib(Ctx &ctx) {
const uint64_t fileSize =
sectionHeaderOff + shnum * sizeof(typename ELFT::Shdr);
const unsigned flags =
- ctx.arg.mmapOutputFile ? (unsigned)FileOutputBuffer::F_mmap : 0;
+ ctx.arg.mmapOutputFile ? 0 : (unsigned)FileOutputBuffer::F_no_mmap;
unlinkAsync(ctx.arg.cmseOutputLib);
Expected<std::unique_ptr<FileOutputBuffer>> bufferOrErr =
FileOutputBuffer::create(ctx.arg.cmseOutputLib, fileSize, flags);
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index cc1538cc76c3c..28b24f90716b8 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -2908,8 +2908,8 @@ template <class ELFT> void Writer<ELFT>::openFile() {
unsigned flags = 0;
if (!ctx.arg.relocatable)
flags |= FileOutputBuffer::F_executable;
- if (ctx.arg.mmapOutputFile)
- flags |= FileOutputBuffer::F_mmap;
+ if (!ctx.arg.mmapOutputFile)
+ flags |= FileOutputBuffer::F_no_mmap;
Expected<std::unique_ptr<FileOutputBuffer>> bufferOrErr =
FileOutputBuffer::create(ctx.arg.outputFile, fileSize, flags);
diff --git a/llvm/include/llvm/Support/FileOutputBuffer.h b/llvm/include/llvm/Support/FileOutputBuffer.h
index f98e7a5470b55..d4b73522115db 100644
--- a/llvm/include/llvm/Support/FileOutputBuffer.h
+++ b/llvm/include/llvm/Support/FileOutputBuffer.h
@@ -31,8 +31,9 @@ class FileOutputBuffer {
/// Set the 'x' bit on the resulting file.
F_executable = 1,
- /// Use mmap for in-memory file buffer.
- F_mmap = 2,
+ /// Don't use mmap and instead write an in-memory buffer to a file when this
+ /// buffer is closed.
+ F_no_mmap = 2,
};
/// Factory method to create an OutputBuffer object which manages a read/write
diff --git a/llvm/lib/Support/FileOutputBuffer.cpp b/llvm/lib/Support/FileOutputBuffer.cpp
index a2396d7629488..58a06a34e8cf3 100644
--- a/llvm/lib/Support/FileOutputBuffer.cpp
+++ b/llvm/lib/Support/FileOutputBuffer.cpp
@@ -186,7 +186,7 @@ FileOutputBuffer::create(StringRef Path, size_t Size, unsigned Flags) {
case fs::file_type::regular_file:
case fs::file_type::file_not_found:
case fs::file_type::status_error:
- if (Flags & F_mmap)
+ if (Flags & F_no_mmap)
return createInMemoryBuffer(Path, Size, Mode);
else
return createOnDiskBuffer(Path, Size, Mode);
diff --git a/llvm/unittests/Support/FileOutputBufferTest.cpp b/llvm/unittests/Support/FileOutputBufferTest.cpp
index 423a6e12240c0..f7bb0833e5a0e 100644
--- a/llvm/unittests/Support/FileOutputBufferTest.cpp
+++ b/llvm/unittests/Support/FileOutputBufferTest.cpp
@@ -123,7 +123,7 @@ TEST(FileOutputBuffer, Test) {
File5.append("/file5");
{
Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
- FileOutputBuffer::create(File5, 8000, FileOutputBuffer::F_mmap);
+ FileOutputBuffer::create(File5, 8000, FileOutputBuffer::F_no_mmap);
ASSERT_NO_ERROR(errorToErrorCode(BufferOrErr.takeError()));
std::unique_ptr<FileOutputBuffer> &Buffer = *BufferOrErr;
// Start buffer with special header.
|
|
@llvm/pr-subscribers-lld Author: Douglas (dgg5503) ChangesReverts llvm/llvm-project#134787 Causes the LIT test Full diff: https://github.com/llvm/llvm-project/pull/134924.diff 5 Files Affected:
diff --git a/lld/ELF/Arch/ARM.cpp b/lld/ELF/Arch/ARM.cpp
index e45dd4d354afb..e667fdc0633c5 100644
--- a/lld/ELF/Arch/ARM.cpp
+++ b/lld/ELF/Arch/ARM.cpp
@@ -1489,7 +1489,7 @@ template <typename ELFT> void elf::writeARMCmseImportLib(Ctx &ctx) {
const uint64_t fileSize =
sectionHeaderOff + shnum * sizeof(typename ELFT::Shdr);
const unsigned flags =
- ctx.arg.mmapOutputFile ? (unsigned)FileOutputBuffer::F_mmap : 0;
+ ctx.arg.mmapOutputFile ? 0 : (unsigned)FileOutputBuffer::F_no_mmap;
unlinkAsync(ctx.arg.cmseOutputLib);
Expected<std::unique_ptr<FileOutputBuffer>> bufferOrErr =
FileOutputBuffer::create(ctx.arg.cmseOutputLib, fileSize, flags);
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index cc1538cc76c3c..28b24f90716b8 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -2908,8 +2908,8 @@ template <class ELFT> void Writer<ELFT>::openFile() {
unsigned flags = 0;
if (!ctx.arg.relocatable)
flags |= FileOutputBuffer::F_executable;
- if (ctx.arg.mmapOutputFile)
- flags |= FileOutputBuffer::F_mmap;
+ if (!ctx.arg.mmapOutputFile)
+ flags |= FileOutputBuffer::F_no_mmap;
Expected<std::unique_ptr<FileOutputBuffer>> bufferOrErr =
FileOutputBuffer::create(ctx.arg.outputFile, fileSize, flags);
diff --git a/llvm/include/llvm/Support/FileOutputBuffer.h b/llvm/include/llvm/Support/FileOutputBuffer.h
index f98e7a5470b55..d4b73522115db 100644
--- a/llvm/include/llvm/Support/FileOutputBuffer.h
+++ b/llvm/include/llvm/Support/FileOutputBuffer.h
@@ -31,8 +31,9 @@ class FileOutputBuffer {
/// Set the 'x' bit on the resulting file.
F_executable = 1,
- /// Use mmap for in-memory file buffer.
- F_mmap = 2,
+ /// Don't use mmap and instead write an in-memory buffer to a file when this
+ /// buffer is closed.
+ F_no_mmap = 2,
};
/// Factory method to create an OutputBuffer object which manages a read/write
diff --git a/llvm/lib/Support/FileOutputBuffer.cpp b/llvm/lib/Support/FileOutputBuffer.cpp
index a2396d7629488..58a06a34e8cf3 100644
--- a/llvm/lib/Support/FileOutputBuffer.cpp
+++ b/llvm/lib/Support/FileOutputBuffer.cpp
@@ -186,7 +186,7 @@ FileOutputBuffer::create(StringRef Path, size_t Size, unsigned Flags) {
case fs::file_type::regular_file:
case fs::file_type::file_not_found:
case fs::file_type::status_error:
- if (Flags & F_mmap)
+ if (Flags & F_no_mmap)
return createInMemoryBuffer(Path, Size, Mode);
else
return createOnDiskBuffer(Path, Size, Mode);
diff --git a/llvm/unittests/Support/FileOutputBufferTest.cpp b/llvm/unittests/Support/FileOutputBufferTest.cpp
index 423a6e12240c0..f7bb0833e5a0e 100644
--- a/llvm/unittests/Support/FileOutputBufferTest.cpp
+++ b/llvm/unittests/Support/FileOutputBufferTest.cpp
@@ -123,7 +123,7 @@ TEST(FileOutputBuffer, Test) {
File5.append("/file5");
{
Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
- FileOutputBuffer::create(File5, 8000, FileOutputBuffer::F_mmap);
+ FileOutputBuffer::create(File5, 8000, FileOutputBuffer::F_no_mmap);
ASSERT_NO_ERROR(errorToErrorCode(BufferOrErr.takeError()));
std::unique_ptr<FileOutputBuffer> &Buffer = *BufferOrErr;
// Start buffer with special header.
|
Reverts #134787
Causes the LIT test
lld\test\ELF\link-open-file.testto fail on thellvm-clang-x86_64-sie-winBuild Bot. First instance of the failure observed in: https://lab.llvm.org/buildbot/#/builders/46/builds/14847