diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-10 19:28:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-10 19:28:49 +0000 |
commit | 303f7fe1490d78e1f305cde78c077448723aae44 (patch) | |
tree | 515b3899a2eed7a7e1d05bd985405a6885024350 /include/llvm/Bitcode/Deserialize.h | |
parent | 5d1f2cc6449f489857d1468bc8ebc594515e718d (diff) |
Fixed hack in BatchReadOwnedPtrs to no longer use the array of pointers passed in for
deserialization as a temporary location for storing serialized pointer identifiers. The
definition of SerializedPtrID will likely change significantly in the future, and the
current implementation caused compilation errors on some 64-bit machines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bitcode/Deserialize.h')
-rw-r--r-- | include/llvm/Bitcode/Deserialize.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Bitcode/Deserialize.h b/include/llvm/Bitcode/Deserialize.h index 8a9be99199..87d0f12728 100644 --- a/include/llvm/Bitcode/Deserialize.h +++ b/include/llvm/Bitcode/Deserialize.h @@ -126,6 +126,7 @@ private: unsigned AbbrevNo; unsigned RecordCode; Location StreamStart; + std::vector<SerializedPtrID> BatchIDVec; //===----------------------------------------------------------===// // Public Interface. @@ -213,10 +214,11 @@ public: template <typename T> void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, bool AutoRegister=true) { for (unsigned i = 0; i < NumPtrs; ++i) - reinterpret_cast<SerializedPtrID&>(Ptrs[i]) = ReadPtrID(); + BatchIDVec.push_back(ReadPtrID()); for (unsigned i = 0; i < NumPtrs; ++i) { - SerializedPtrID PtrID = reinterpret_cast<SerializedPtrID>(Ptrs[i]); + SerializedPtrID& PtrID = BatchIDVec[i]; + T* p = PtrID ? SerializeTrait<T>::Materialize(*this) : NULL; if (PtrID && AutoRegister) |