aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Compressor.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-29 17:16:07 +0000
committerChris Lattner <sabre@nondot.org>2005-01-29 17:16:07 +0000
commit74a77cd985bfd484b3820c2fe7f0a11fb28d29e7 (patch)
treebd498990f41047361c0595589caf096d5bdbcdbf /include/llvm/Support/Compressor.h
parent8c2cb42f08fbb3872a7d0a31236a890c14c9b024 (diff)
downloadexternal_llvm-74a77cd985bfd484b3820c2fe7f0a11fb28d29e7.zip
external_llvm-74a77cd985bfd484b3820c2fe7f0a11fb28d29e7.tar.gz
external_llvm-74a77cd985bfd484b3820c2fe7f0a11fb28d29e7.tar.bz2
There is no reason to include ostream here, include iosfwd instead.
This file was schizophrenic when it came to representing sizes. In some cases it represented them as 'unsigneds', which are not enough for 64-bit hosts. In other cases, it represented them as uint64_t's, which are inefficient for 32-bit hosts. This patch unifies all of the sizes to use size_t instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compressor.h')
-rw-r--r--include/llvm/Support/Compressor.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/llvm/Support/Compressor.h b/include/llvm/Support/Compressor.h
index 670235b..4545628 100644
--- a/include/llvm/Support/Compressor.h
+++ b/include/llvm/Support/Compressor.h
@@ -15,7 +15,7 @@
#define LLVM_SUPPORT_COMPRESSOR_H
#include "llvm/Support/DataTypes.h"
-#include <ostream>
+#include <iosfwd>
namespace llvm {
@@ -46,9 +46,9 @@ namespace llvm {
/// @throws std::string explaining error if a compression error occurs
/// @returns The size of the output buffer \p out.
/// @brief Compress memory to a new memory buffer.
- static uint64_t compressToNewBuffer(
+ static size_t compressToNewBuffer(
const char* in, ///< The buffer to be compressed
- unsigned size, ///< The size of the buffer to be compressed
+ size_t size, ///< The size of the buffer to be compressed
char*&out ///< The returned output buffer
);
@@ -59,9 +59,9 @@ namespace llvm {
/// compression the caller would *prefer*.
/// @returns The amount of data written to \p out.
/// @brief Compress memory to a file.
- static uint64_t compressToStream(
+ static size_t compressToStream(
const char*in, ///< The buffer to be compressed
- unsigned size, ///< The size of the buffer to be compressed
+ size_t size, ///< The size of the buffer to be compressed
std::ostream& out ///< The output stream to write data on
);
@@ -70,9 +70,9 @@ namespace llvm {
/// by malloc. It is the caller's responsibility to free \p out.
/// @returns The size of the output buffer \p out.
/// @brief Decompress memory to a new memory buffer.
- static uint64_t decompressToNewBuffer(
+ static size_t decompressToNewBuffer(
const char *in, ///< The buffer to be decompressed
- unsigned size, ///< Size of the buffer to be decompressed
+ size_t size, ///< Size of the buffer to be decompressed
char*&out ///< The returned output buffer
);
@@ -82,9 +82,9 @@ namespace llvm {
/// this method.
/// @returns The amount of data written to \p out.
/// @brief Decompress memory to a stream.
- static uint64_t decompressToStream(
+ static size_t decompressToStream(
const char *in, ///< The buffer to be decompressed
- unsigned size, ///< Size of the buffer to be decompressed
+ size_t size, ///< Size of the buffer to be decompressed
std::ostream& out ///< The stream to write write data on
);
@@ -105,7 +105,7 @@ namespace llvm {
/// @returns 0 for success, 1 for failure
/// @throws nothing
/// @brief Output callback function type
- typedef unsigned (OutputDataCallback)(char*& buffer, unsigned& size,
+ typedef size_t (OutputDataCallback)(char*& buffer, size_t& size,
void* context);
/// This function does the compression work. The block of memory starting
@@ -123,9 +123,9 @@ namespace llvm {
/// @throws std::string if an error occurs
/// @returns the total size of the compressed data
/// @brief Compress a block of memory.
- static uint64_t compress(
+ static size_t compress(
const char* in, ///< The buffer to be compressed
- unsigned size, ///< The size of the buffer to be compressed
+ size_t size, ///< The size of the buffer to be compressed
OutputDataCallback* cb, ///< Call back for memory allocation
void* context = 0 ///< Context for callback
);
@@ -143,9 +143,9 @@ namespace llvm {
/// @throws std::string if an error occurs
/// @returns the total size of the decompressed data
/// @brief Decompress a block of memory.
- static uint64_t decompress(
+ static size_t decompress(
const char *in, ///< The buffer to be decompressed
- unsigned size, ///< Size of the buffer to be decompressed
+ size_t size, ///< Size of the buffer to be decompressed
OutputDataCallback* cb, ///< Call back for memory allocation
void* context = 0 ///< Context for callback
);