summaryrefslogtreecommitdiff
path: root/lib/Bitcode/Reader/Deserialize.cpp
Commit message (Collapse)AuthorAge
* fix warning when assertion disabled.Chris Lattner2008-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52588 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed buffer overflow reported by Argiris Kirtzidis.Ted Kremenek2008-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47517 91177308-0d34-0410-b5e6-96231b3b80d8
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Modified Deserializer::ReadCStr to allow C-strings to be read into aTed Kremenek2007-12-17
| | | | | | | std::vector<char> starting from any index in the vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45129 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed subtle bug in Deserializer::JumpTo when jumping when the block-nestingTed Kremenek2007-11-30
| | | | | | | | information matching did not exactly match the underlying stream's scoping information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44470 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed debug #define that was accidentally checked in while debuggingTed Kremenek2007-11-14
| | | | | | | | | | the deserializer. Fixed assertion when "stream jumping" in the deserializer to properly function when we have reached the end of the stream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44124 91177308-0d34-0410-b5e6-96231b3b80d8
* Added two new overloaded versions of BatchEmitOwnedPtrs andTed Kremenek2007-11-14
| | | | | | | BatchReadOwnedPtrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44105 91177308-0d34-0410-b5e6-96231b3b80d8
* Added versions of ReadPtr that takes an explicit SerializedPtrID. This allowsTed Kremenek2007-11-12
| | | | | | | | | | | | | 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
* Updated method signature to conform with the typedef in the method prototype.Ted Kremenek2007-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43982 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "random access" to the Deserializer to allow a client to jump to anyTed Kremenek2007-11-10
| | | | | | | | | serialized block in the bitstream, including a block in an entirely different nesting than the current block. This is useful for deserializing objects from a bitstream in an order different from the order that they were serialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43973 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated Deserializer class to provide more information about the currentTed Kremenek2007-11-09
| | | | | | | | | | block that is being visited in the bitstream. The client can also now skip blocks before reading them, and query the current abbreviation number as seen from the perspective of the Deserializer. This allows the client to be more interactive in the deserialization process (if they so choose). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43916 91177308-0d34-0410-b5e6-96231b3b80d8
* Added typedef "SerializedPtrID" to represent the pointer handle written to diskTed Kremenek2007-11-08
| | | | | | | | | | | | instead of just using "unsigned". This gives us more flexibility in changing the definition of the handle later, and is more self-documenting. Added tracking of block stack in the Deserializer. Now clients can query if they are still within a block using the methods GetCurrentBlockLocation() and FinishedBlock(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43903 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented serialization of signed integers.Ted Kremenek2007-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43828 91177308-0d34-0410-b5e6-96231b3b80d8
* Augmented ReadPtr and ReadOwnedPtr to control whether or not a pointer is ↵Ted Kremenek2007-11-06
| | | | | | | | | allowed to be backpatched or can be registered with the deserializer to backpatch other pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43783 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for processing abbreviations in the Deserializer.Ted Kremenek2007-11-06
| | | | | | | Added some #ifdef-controlled messages for debugging backpatching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43771 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support in serializer and deserializer to create arbitrary blocks.Ted Kremenek2007-11-05
| | | | | | | Added detection of end-of-stream in deserializer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43736 91177308-0d34-0410-b5e6-96231b3b80d8
* Added default creation of root-level block by bitstream serializer.Ted Kremenek2007-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43732 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed ReadVal from SerializeTrait<T>, and also removed it fromTed Kremenek2007-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deserializer. There were issues with Visual C++ barfing when instantiating SerializeTrait<T> when "T" was an abstract class AND SerializeTrait<T>::ReadVal was *never* called: template <typename T> struct SerializeTrait { <SNIP> static inline T ReadVal(Deserializer& D) { T::ReadVal(D); } <SNIP> }; Visual C++ would complain about "T" being an abstract class, even though ReadVal was never instantiated (although one of the other member functions were). Removing this from the trait is not a big deal. It was used hardly ever, and users who want "read-by-value" deserialization can simply call the appropriate methods directly instead of relying on trait-based-dispatch. The trait dispatch for serialization/deserialization is simply sugar in many cases (like this one). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43624 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrote backpatcher. Backpatcher now stores the "has final pointer"Ted Kremenek2007-11-01
| | | | | | | | | | | | flag in the **key** of the backpatch map, as opposed to the mapped value which contains either the final pointer, or a pointer to a chain of pointers that need to be backpatched. The bit flag was moved to the key because we were erroneously assuming that the backpatched pointers would be at an alignment of >= 2 bytes, which obviously doesn't work for character strings. Now we just steal the bit from the key. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43595 91177308-0d34-0410-b5e6-96231b3b80d8
* constified several pointer arguments for methods in the Deserializer.Ted Kremenek2007-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43583 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented deserialization of references. References are handledTed Kremenek2007-10-31
| | | | | | | | | | | | | | just like pointers, except that they cannot be backpatched. This means that references are essentially non-owning pointers where the referred object must be deserialized prior to the reference being deserialized. Because of the nature of references, this ordering of objects is always possible. Fixed a bug in backpatching code (returning the backpatched pointer would accidentally include a bit flag). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43570 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed warning concerning implicit conversion from a NULL pointerTed Kremenek2007-10-29
| | | | | | | constant to an unsigned int. We now just directly assign the literal 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43459 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed assertion in Deserializer::~Deserializer that checks forTed Kremenek2007-10-28
| | | | | | | pointers that were not backpatched (previously checked the wrong invariant). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43425 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated backpatching logic during object deserialization to performTed Kremenek2007-10-28
| | | | | | | | | eager backpatching instead of waithing until all objects have been deserialized. This allows us to reduce the memory footprint needed for backpatching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43422 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated backpatching during object deserialization to support "smart"Ted Kremenek2007-10-25
| | | | | | | pointers that employ unused bits in a pointer to store extra data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43373 91177308-0d34-0410-b5e6-96231b3b80d8
* Disambiguated variable name to comply with VC++'s archaic variable scoping ↵Hartmut Kaiser2007-10-25
| | | | | | rules. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43369 91177308-0d34-0410-b5e6-96231b3b80d8
* Added special treatment of serializing NULL pointers.Ted Kremenek2007-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented prototype serialization of pointers, including supportTed Kremenek2007-10-25
| | | | | | | | | for backpatching. Added Deserialize::ReadVal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43319 91177308-0d34-0410-b5e6-96231b3b80d8
* Split Serialization.h into separate headers: Serialize.h andTed Kremenek2007-10-24
| | | | | | | | Deserialize.h Serialization.h now includes trait speciailizations for unsigned long, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43307 91177308-0d34-0410-b5e6-96231b3b80d8
* Added preliminary implementation of generic object serialization to bitcode.Ted Kremenek2007-10-23
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43261 91177308-0d34-0410-b5e6-96231b3b80d8