mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Added versions of ReadPtr that takes an explicit SerializedPtrID. This allows
clients of the Deserializer to read the pointer ID before they are ready to deserialize the object (which can mean registering a pointer reference with the backpatcher). Changed some methods that took an argument "SerializedPtrID" to "const SerializedPtrID&" (pass-by-reference). This is to accommodate a future revision of SerializedPtrID where it may be much fatter than an unsigned integer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44021 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -324,7 +324,9 @@ void Deserializer::ReadCStr(std::vector<char>& buff, bool isNullTerm) {
|
||||
buff.push_back('\0');
|
||||
}
|
||||
|
||||
void Deserializer::RegisterPtr(SerializedPtrID PtrId, const void* Ptr) {
|
||||
void Deserializer::RegisterPtr(const SerializedPtrID& PtrId,
|
||||
const void* Ptr) {
|
||||
|
||||
MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
|
||||
|
||||
assert (!HasFinalPtr(E) && "Pointer already registered.");
|
||||
@@ -336,9 +338,9 @@ void Deserializer::RegisterPtr(SerializedPtrID PtrId, const void* Ptr) {
|
||||
SetPtr(E,Ptr);
|
||||
}
|
||||
|
||||
void Deserializer::ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch) {
|
||||
SerializedPtrID PtrId = ReadPtrID();
|
||||
|
||||
void Deserializer::ReadUIntPtr(uintptr_t& PtrRef,
|
||||
const SerializedPtrID& PtrId,
|
||||
bool AllowBackpatch) {
|
||||
if (PtrId == 0) {
|
||||
PtrRef = 0;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user