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:
Ted Kremenek 2007-10-31 22:42:03 +00:00
parent 2cda9399de
commit a7963a59b3
2 changed files with 8 additions and 5 deletions

View File

@ -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();

View File

@ -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.