- // Determine if we actually should compress this member
- bool willCompress =
- (ShouldCompress &&
- !member.isCompressed() &&
- !member.isCompressedBytecode() &&
- !member.isLLVMSymbolTable() &&
- !member.isSVR4SymbolTable() &&
- !member.isBSD4SymbolTable());
-
- // Perform the compression. Note that if the file is uncompressed bytecode
- // then we turn the file into compressed bytecode rather than treating it as
- // compressed data. This is necessary since it allows us to determine that the
- // file contains bytecode instead of looking like a regular compressed data
- // member. A compressed bytecode file has its content compressed but has a
- // magic number of "llvc". This acounts for the +/-4 arithmetic in the code
- // below.
- int hdrSize;
- if (willCompress) {
- char* output = 0;
- if (member.isBytecode()) {
- data +=4;
- fSize -= 4;
- }
- fSize = Compressor::compressToNewBuffer(data,fSize,output,ErrMsg);
- if (fSize == 0)
- return true;
- data = output;
- if (member.isBytecode())
- hdrSize = -fSize-4;
- else
- hdrSize = -fSize;
- } else {
- hdrSize = fSize;
- }