Author: kremenek Date: Fri Nov 16 18:45:37 2007 New Revision: 44200 URL: http://llvm.org/viewvc/llvm-project?rev=44200&view=rev Log: Changed implementation of Serialize::EmitDiffPtrID and Deserialize::ReadDiffPtrID to read and emit bools instead of unsigned integers. This should result in a nice space optimization once we have "auto-abbreviation" generation in place.
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h llvm/trunk/include/llvm/Bitcode/Serialize.h Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=44200&r1=44199&r2=44200&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original) +++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Fri Nov 16 18:45:37 2007 @@ -141,8 +141,8 @@ SerializedPtrID ReadPtrID() { return (SerializedPtrID) ReadInt(); } SerializedPtrID ReadDiffPtrID(SerializedPtrID& PrevID) { - unsigned x = ReadInt(); - return (SerializedPtrID) (x ? (PrevID+x) : 0); + bool x = ReadBool(); + return (SerializedPtrID) (x ? (PrevID+1) : 0); } Modified: llvm/trunk/include/llvm/Bitcode/Serialize.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Serialize.h?rev=44200&r1=44199&r2=44200&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/Serialize.h (original) +++ llvm/trunk/include/llvm/Bitcode/Serialize.h Fri Nov 16 18:45:37 2007 @@ -57,10 +57,11 @@ SerializedPtrID ptr_id = getPtrId(ptr); if (ptr_id == 0) - EmitInt(0); + EmitBool(false); else { assert (ptr_id > PrevID); - EmitInt(ptr_id-PrevID); + assert (PrevID == 0 || ptr_id - PrevID == 1); + EmitBool(true); } return ptr_id; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits