aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2020-09-24 12:36:06 -0700
committerVolodymyr Sapsai <vsapsai@apple.com>2020-09-24 12:36:06 -0700
commit9eba6b20a0579d3441e1b0f3cb3942f86d32679f (patch)
treed2321c7a1b81db6efd43e1ea25da26ffd0196c70 /llvm/lib/Support/MemoryBuffer.cpp
parent0a349d5827f6864ee89a5d0867d609339c07115d (diff)
downloadllvm-9eba6b20a0579d3441e1b0f3cb3942f86d32679f.zip
llvm-9eba6b20a0579d3441e1b0f3cb3942f86d32679f.tar.gz
llvm-9eba6b20a0579d3441e1b0f3cb3942f86d32679f.tar.bz2
Revert "[Modules] Add stats to measure performance of building and loading modules."
This reverts commit c4bacc3c9b333bb7032fb96f41d6f5b851623132. Test "LLVM :: ThinLTO/X86/funcimport-stats.ll" is failing. Reverting now and will recommit after making the test not fail with the added stats.
Diffstat (limited to 'llvm/lib/Support/MemoryBuffer.cpp')
-rw-r--r--llvm/lib/Support/MemoryBuffer.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index 4b851a2..248fb72 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/lib/Support/MemoryBuffer.cpp
@@ -12,7 +12,6 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/Statistic.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Errno.h"
@@ -35,12 +34,6 @@
#endif
using namespace llvm;
-#define DEBUG_TYPE "memory-buffer"
-
-ALWAYS_ENABLED_STATISTIC(NumMmapFile, "Number of mmap-ed files.");
-ALWAYS_ENABLED_STATISTIC(NumAllocFile,
- "Number of files read into allocated memory buffer.");
-
//===----------------------------------------------------------------------===//
// MemoryBuffer implementation itself.
//===----------------------------------------------------------------------===//
@@ -456,10 +449,8 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
// buffer by copying off the stream.
sys::fs::file_type Type = Status.type();
if (Type != sys::fs::file_type::regular_file &&
- Type != sys::fs::file_type::block_file) {
- ++NumAllocFile;
+ Type != sys::fs::file_type::block_file)
return getMemoryBufferForStream(FD, Filename);
- }
FileSize = Status.getSize();
}
@@ -472,10 +463,8 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
std::unique_ptr<MB> Result(
new (NamedBufferAlloc(Filename)) MemoryBufferMMapFile<MB>(
RequiresNullTerminator, FD, MapSize, Offset, EC));
- if (!EC) {
- ++NumMmapFile;
+ if (!EC)
return std::move(Result);
- }
}
auto Buf = WritableMemoryBuffer::getNewUninitMemBuffer(MapSize, Filename);
@@ -486,7 +475,6 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
}
// Read until EOF, zero-initialize the rest.
- ++NumAllocFile;
MutableArrayRef<char> ToRead = Buf->getBuffer();
while (!ToRead.empty()) {
Expected<size_t> ReadBytes =