mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 20:34:38 +00:00
constified several pointer arguments for methods in the Deserializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2cda9399de
commit
a7963a59b3
@ -57,7 +57,7 @@ class Deserializer {
|
||||
BPatchEntry(void* P) : Ptr(reinterpret_cast<uintptr_t>(P)) {}
|
||||
|
||||
bool hasFinalPtr() const { return Ptr & 0x1 ? false : true; }
|
||||
void setFinalPtr(BPNode*& FreeList, void* P);
|
||||
void setFinalPtr(BPNode*& FreeList, const void* P);
|
||||
|
||||
BPNode* getBPNode() const {
|
||||
assert (!hasFinalPtr());
|
||||
@ -152,8 +152,11 @@ public:
|
||||
return *p;
|
||||
}
|
||||
|
||||
void RegisterPtr(unsigned PtrId, const void* Ptr);
|
||||
|
||||
void RegisterPtr(unsigned PtrId, void* Ptr);
|
||||
void RegisterPtr(const void* Ptr) {
|
||||
RegisterPtr(ReadInt(),Ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadRecord();
|
||||
|
@ -98,9 +98,9 @@ void Deserializer::ReadCStr(std::vector<char>& buff, bool isNullTerm) {
|
||||
buff.push_back('\0');
|
||||
}
|
||||
|
||||
void Deserializer::RegisterPtr(unsigned PtrId,void* Ptr) {
|
||||
void Deserializer::RegisterPtr(unsigned PtrId, const void* Ptr) {
|
||||
BPatchEntry& E = BPatchMap[PtrId];
|
||||
assert (E.hasFinalPtr() && "Pointer already registered.");
|
||||
assert (!E.hasFinalPtr() && "Pointer already registered.");
|
||||
E.setFinalPtr(FreeList,Ptr);
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ uintptr_t Deserializer::ReadInternalRefPtr() {
|
||||
return E.getFinalPtr();
|
||||
}
|
||||
|
||||
void Deserializer::BPatchEntry::setFinalPtr(BPNode*& FreeList, void* P) {
|
||||
void Deserializer::BPatchEntry::setFinalPtr(BPNode*& FreeList, const void* P) {
|
||||
assert (!hasFinalPtr());
|
||||
|
||||
// Perform backpatching.
|
||||
|
Loading…
x
Reference in New Issue
Block a user