diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-04-28 20:34:18 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-04-28 20:34:18 +0000 |
commit | 5d86759e0ff44e07ead4982673fe10abec50f765 (patch) | |
tree | e59bbce27b0fb338e20f83950ff5dc6a297886b9 /include/llvm/Support/MemoryBuffer.h | |
parent | 81ad03c020d7c1f73a78ce41ca713f1e425efe3d (diff) |
Add MemoryBuffer::getBufferKind() to report whether a memory buffer uses malloc'ed or mmap'ed memory. This is for performance analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index 9a2aff04c7..d912e86c8b 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -119,6 +119,21 @@ public: static error_code getFileOrSTDIN(const char *Filename, OwningPtr<MemoryBuffer> &result, int64_t FileSize = -1); + + + //===--------------------------------------------------------------------===// + // Provided for performance analysis. + //===--------------------------------------------------------------------===// + + /// The kind of memory backing used to support the MemoryBuffer. + enum BufferKind { + MemoryBuffer_Malloc, + MemoryBuffer_MMap + }; + + /// Return information on the memory mechanism used to support the + /// MemoryBuffer. + virtual BufferKind getBufferKind() const = 0; }; } // end namespace llvm |