llvm.org GIT mirror llvm / 07cad1c
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44200 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 12 years ago
2 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
140140 SerializedPtrID ReadPtrID() { return (SerializedPtrID) ReadInt(); }
141141
142142 SerializedPtrID ReadDiffPtrID(SerializedPtrID& PrevID) {
143 unsigned x = ReadInt();
144 return (SerializedPtrID) (x ? (PrevID+x) : 0);
143 bool x = ReadBool();
144 return (SerializedPtrID) (x ? (PrevID+1) : 0);
145145 }
146146
147147
5656 SerializedPtrID ptr_id = getPtrId(ptr);
5757
5858 if (ptr_id == 0)
59 EmitInt(0);
59 EmitBool(false);
6060 else {
6161 assert (ptr_id > PrevID);
62 EmitInt(ptr_id-PrevID);
62 assert (PrevID == 0 || ptr_id - PrevID == 1);
63 EmitBool(true);
6364 }
6465
6566 return ptr_id;