mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -18,15 +18,14 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "bzip2/bzlib.h"
|
#include "bzip2/bzlib.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace {
|
|
||||||
|
|
||||||
enum CompressionTypes {
|
enum CompressionTypes {
|
||||||
COMP_TYPE_NONE = '0',
|
COMP_TYPE_NONE = '0',
|
||||||
COMP_TYPE_BZIP2 = '2',
|
COMP_TYPE_BZIP2 = '2',
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int getdata(char*& buffer, unsigned& size,
|
static int getdata(char*& buffer, unsigned& size,
|
||||||
llvm::Compressor::OutputDataCallback* cb, void* context) {
|
llvm::Compressor::OutputDataCallback* cb, void* context) {
|
||||||
buffer = 0;
|
buffer = 0;
|
||||||
size = 0;
|
size = 0;
|
||||||
@ -54,11 +53,11 @@ struct NULLCOMP_stream {
|
|||||||
uint64_t output_count; // Total count of output bytes
|
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;
|
s->output_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NULLCOMP_compress(NULLCOMP_stream* s) {
|
static bool NULLCOMP_compress(NULLCOMP_stream* s) {
|
||||||
assert(s && "Invalid NULLCOMP_stream");
|
assert(s && "Invalid NULLCOMP_stream");
|
||||||
assert(s->next_in != 0);
|
assert(s->next_in != 0);
|
||||||
assert(s->next_out != 0);
|
assert(s->next_out != 0);
|
||||||
@ -82,7 +81,7 @@ bool NULLCOMP_compress(NULLCOMP_stream* s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NULLCOMP_decompress(NULLCOMP_stream* s) {
|
static bool NULLCOMP_decompress(NULLCOMP_stream* s) {
|
||||||
assert(s && "Invalid NULLCOMP_stream");
|
assert(s && "Invalid NULLCOMP_stream");
|
||||||
assert(s->next_in != 0);
|
assert(s->next_in != 0);
|
||||||
assert(s->next_out != 0);
|
assert(s->next_out != 0);
|
||||||
@ -106,9 +105,11 @@ bool NULLCOMP_decompress(NULLCOMP_stream* s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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.
|
/// This structure is only used when a bytecode file is compressed.
|
||||||
/// As bytecode is being decompressed, the memory buffer might need
|
/// As bytecode is being decompressed, the memory buffer might need
|
||||||
/// to be reallocated. The buffer allocation is handled in a callback
|
/// to be reallocated. The buffer allocation is handled in a callback
|
||||||
@ -170,6 +171,11 @@ struct BufferContext {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
// This structure retains the context when compressing the bytecode file. The
|
// This structure retains the context when compressing the bytecode file. The
|
||||||
// WriteCompressedData function below uses it to keep track of the previously
|
// WriteCompressedData function below uses it to keep track of the previously
|
||||||
// filled chunk of memory (which it writes) and how many bytes have been
|
// filled chunk of memory (which it writes) and how many bytes have been
|
||||||
@ -233,9 +239,7 @@ struct WriterContext {
|
|||||||
std::ostream* Out; // The stream we write the data to.
|
std::ostream* Out; // The stream we write the data to.
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // end anonymous namespace
|
||||||
|
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
// Compress in one of three ways
|
// Compress in one of three ways
|
||||||
uint64_t Compressor::compress(const char* in, unsigned size,
|
uint64_t Compressor::compress(const char* in, unsigned size,
|
||||||
@ -460,6 +464,4 @@ Compressor::decompressToStream(const char*in, unsigned size, std::ostream& out){
|
|||||||
return zipSize;
|
return zipSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// vim: sw=2 ai
|
// vim: sw=2 ai
|
||||||
|
Reference in New Issue
Block a user