[llvm-commits] [llvm] r43983 - /llvm/trunk/include/llvm/Bitcode/Deserialize.h
Ted Kremenek
kremenek at apple.com
Sat Nov 10 11:28:49 PST 2007
Author: kremenek
Date: Sat Nov 10 13:28:49 2007
New Revision: 43983
URL: http://llvm.org/viewvc/llvm-project?rev=43983&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/Bitcode/Deserialize.h
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=43983&r1=43982&r2=43983&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Sat Nov 10 13:28:49 2007
@@ -126,6 +126,7 @@
unsigned AbbrevNo;
unsigned RecordCode;
Location StreamStart;
+ std::vector<SerializedPtrID> BatchIDVec;
//===----------------------------------------------------------===//
// Public Interface.
@@ -213,10 +214,11 @@
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)
More information about the llvm-commits
mailing list