[llvm-commits] CVS: llvm/lib/Support/Compressor.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Jan 29 08:53:17 PST 2005
Changes in directory llvm/lib/Support:
Compressor.cpp updated: 1.10 -> 1.11
---
Log message:
Finegrainify namespacification
---
Diffs of the changes: (+14 -12)
Compressor.cpp | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
Index: llvm/lib/Support/Compressor.cpp
diff -u llvm/lib/Support/Compressor.cpp:1.10 llvm/lib/Support/Compressor.cpp:1.11
--- llvm/lib/Support/Compressor.cpp:1.10 Sat Jan 8 13:32:59 2005
+++ llvm/lib/Support/Compressor.cpp Sat Jan 29 10:53:02 2005
@@ -18,15 +18,14 @@
#include <cassert>
#include <string>
#include "bzip2/bzlib.h"
-
-namespace {
+using namespace llvm;
enum CompressionTypes {
COMP_TYPE_NONE = '0',
COMP_TYPE_BZIP2 = '2',
};
-inline int getdata(char*& buffer, unsigned& size,
+static int getdata(char*& buffer, unsigned& size,
llvm::Compressor::OutputDataCallback* cb, void* context) {
buffer = 0;
size = 0;
@@ -54,11 +53,11 @@
uint64_t output_count; // Total count of output bytes
};
-void NULLCOMP_init(NULLCOMP_stream* s) {
+static void NULLCOMP_init(NULLCOMP_stream* s) {
s->output_count = 0;
}
-bool NULLCOMP_compress(NULLCOMP_stream* s) {
+static bool NULLCOMP_compress(NULLCOMP_stream* s) {
assert(s && "Invalid NULLCOMP_stream");
assert(s->next_in != 0);
assert(s->next_out != 0);
@@ -82,7 +81,7 @@
}
}
-bool NULLCOMP_decompress(NULLCOMP_stream* s) {
+static bool NULLCOMP_decompress(NULLCOMP_stream* s) {
assert(s && "Invalid NULLCOMP_stream");
assert(s->next_in != 0);
assert(s->next_out != 0);
@@ -106,9 +105,11 @@
}
}
-void NULLCOMP_end(NULLCOMP_stream* strm) {
+static void NULLCOMP_end(NULLCOMP_stream* strm) {
}
+namespace {
+
/// This structure is only used when a bytecode file is compressed.
/// As bytecode is being decompressed, the memory buffer might need
/// to be reallocated. The buffer allocation is handled in a callback
@@ -170,6 +171,11 @@
}
};
+} // end anonymous namespace
+
+
+namespace {
+
// This structure retains the context when compressing the bytecode file. The
// WriteCompressedData function below uses it to keep track of the previously
// filled chunk of memory (which it writes) and how many bytes have been
@@ -233,9 +239,7 @@
std::ostream* Out; // The stream we write the data to.
};
-}
-
-namespace llvm {
+} // end anonymous namespace
// Compress in one of three ways
uint64_t Compressor::compress(const char* in, unsigned size,
@@ -460,6 +464,4 @@
return zipSize;
}
-}
-
// vim: sw=2 ai
More information about the llvm-commits
mailing list