mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-15 16:07:49 +00:00
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. llvm-svn: 44200
This commit is contained in:
parent
20b4c84cfa
commit
e22cf73dfc
@ -141,8 +141,8 @@ public:
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,10 +57,11 @@ public:
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user