summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding bindings for memory buffers and module providers. SwitchingGordon Henriksen2007-12-191-13/+21
| | | | | | to exceptions rather than variants for error handling in Ocaml. llvm-svn: 45226
* Bring back int_x86_sse2_movl_dq intrinsic for backward compatibility. Make sureEvan Cheng2007-12-171-1/+2
| | | | | | it's auto-upgraded to a shufflevector instruction. llvm-svn: 45131
* Modified Deserializer::ReadCStr to allow C-strings to be read into aTed Kremenek2007-12-171-3/+10
| | | | | | std::vector<char> starting from any index in the vector. llvm-svn: 45129
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-1/+1
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Implement address space attribute for LLVM pointer types. Address spaces are Christopher Lamb2007-12-111-4/+24
| | | | | | | | | | | | | | | | | regions of memory that have a target specific relationship, as described in the Embedded C Technical Report. This also implements the 2007-12-11-AddressSpaces test, which demonstrates how address space attributes can be used in LLVM IR. In addition, this patch changes the bitcode signature for stores (in a backwards compatible manner), such that the pointer type, rather than the pointee type, is encoded. This permits type information in the pointer (e.g. address space) to be preserved for stores. LangRef updates are forthcoming. llvm-svn: 44858
* Adding Ocaml bindings for the bitreader as requested by SarahGordon Henriksen2007-12-111-0/+42
| | | | | | | | | | | | | | | | | | | Thompson. Usage should be something like this: open Llvm open Llvm_bitreader match read_bitcode_file fn with | Bitreader_failure msg -> prerr_endline msg | Bitreader_success m -> ...; dispose_module m Compile with: ocamlc llvm.cma llvm_bitreader.cma ocamlopt llvm.cmxa llvm_bitreader.cmxa llvm-svn: 44824
* Adding a collector name attribute to Function in the IR. These Gordon Henriksen2007-12-101-1/+14
| | | | | | | | | | | | | | | | | | | | methods are new to Function: bool hasCollector() const; const std::string &getCollector() const; void setCollector(const std::string &); void clearCollector(); The assembly representation is as such: define void @f() gc "shadow-stack" { ... The implementation uses an on-the-side table to map Functions to collector names, such that there is no overhead. A StringPool is further used to unique collector names, which are extremely likely to be unique per process. llvm-svn: 44769
* Fixed subtle bug in Deserializer::JumpTo when jumping when the block-nestingTed Kremenek2007-11-301-9/+27
| | | | | | | information matching did not exactly match the underlying stream's scoping information. llvm-svn: 44470
* Unbreak backwards compatibility with bytecode format. RegressionChris Lattner2007-11-271-4/+5
| | | | | | | introduced by this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071126/055824.html llvm-svn: 44364
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-15/+16
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* In order for parameter attribute uniquing to makeDuncan Sands2007-11-201-6/+4
| | | | | | | | | | | | any sense it is important that ParamAttr::None gets treated the same as not supplying an attribute at all. Rather than stripping ParamAttr::None out of the list of attributes, assert if ParamAttr::None is seen. Fix up the bitcode reader which liked to insert ParamAttr::None all over the place. Patch based on one by Török Edwin. llvm-svn: 44250
* Add explicit keywords.Dan Gohman2007-11-191-1/+1
| | | | llvm-svn: 44234
* Removed debug #define that was accidentally checked in while debuggingTed Kremenek2007-11-141-3/+1
| | | | | | | | | the deserializer. Fixed assertion when "stream jumping" in the deserializer to properly function when we have reached the end of the stream. llvm-svn: 44124
* Added two new overloaded versions of BatchEmitOwnedPtrs andTed Kremenek2007-11-141-5/+13
| | | | | | BatchReadOwnedPtrs. llvm-svn: 44105
* Added versions of ReadPtr that takes an explicit SerializedPtrID. This allowsTed Kremenek2007-11-121-4/+6
| | | | | | | | | | | | 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. llvm-svn: 44021
* Updated method signature to conform with the typedef in the method prototype.Ted Kremenek2007-11-101-1/+1
| | | | llvm-svn: 43982
* Added "random access" to the Deserializer to allow a client to jump to anyTed Kremenek2007-11-101-8/+116
| | | | | | | | 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. llvm-svn: 43973
* Updated Deserializer class to provide more information about the currentTed Kremenek2007-11-091-48/+97
| | | | | | | | | 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). llvm-svn: 43916
* Added typedef "SerializedPtrID" to represent the pointer handle written to diskTed Kremenek2007-11-081-4/+25
| | | | | | | | | | | 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(). llvm-svn: 43903
* Implemented generic serialization of APFloat.Ted Kremenek2007-11-071-0/+24
| | | | llvm-svn: 43829
* Implemented serialization of signed integers.Ted Kremenek2007-11-071-0/+15
| | | | llvm-svn: 43828
* Augmented ReadPtr and ReadOwnedPtr to control whether or not a pointer is ↵Ted Kremenek2007-11-061-1/+4
| | | | | | | | allowed to be backpatched or can be registered with the deserializer to backpatch other pointers. llvm-svn: 43783
* Added support for processing abbreviations in the Deserializer.Ted Kremenek2007-11-061-2/+19
| | | | | | Added some #ifdef-controlled messages for debugging backpatching. llvm-svn: 43771
* Added support in serializer and deserializer to create arbitrary blocks.Ted Kremenek2007-11-051-1/+15
| | | | | | Added detection of end-of-stream in deserializer. llvm-svn: 43736
* Make labels work in asm blocks; allow labels asDale Johannesen2007-11-051-1/+4
| | | | | | | parameters. Rename ValueRefList to ParamList in AsmParser, since its only use is for parameters. llvm-svn: 43734
* Added default creation of root-level block by bitstream serializer.Ted Kremenek2007-11-051-3/+22
| | | | llvm-svn: 43732
* Removed ReadVal from SerializeTrait<T>, and also removed it fromTed Kremenek2007-11-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). llvm-svn: 43624
* Rewrote backpatcher. Backpatcher now stores the "has final pointer"Ted Kremenek2007-11-011-21/+19
| | | | | | | | | | | 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. llvm-svn: 43595
* constified several pointer arguments for methods in the Deserializer.Ted Kremenek2007-10-311-3/+3
| | | | llvm-svn: 43583
* Implemented deserialization of references. References are handledTed Kremenek2007-10-311-1/+13
| | | | | | | | | | | | | 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). llvm-svn: 43570
* Fixed warning concerning implicit conversion from a NULL pointerTed Kremenek2007-10-291-1/+1
| | | | | | constant to an unsigned int. We now just directly assign the literal 0. llvm-svn: 43459
* Fixed assertion in Deserializer::~Deserializer that checks forTed Kremenek2007-10-281-2/+6
| | | | | | pointers that were not backpatched (previously checked the wrong invariant). llvm-svn: 43425
* Updated backpatching logic during object deserialization to performTed Kremenek2007-10-281-24/+38
| | | | | | | | eager backpatching instead of waithing until all objects have been deserialized. This allows us to reduce the memory footprint needed for backpatching. llvm-svn: 43422
* Added serialization support for APInt.Ted Kremenek2007-10-261-0/+33
| | | | llvm-svn: 43405
* Updated backpatching during object deserialization to support "smart"Ted Kremenek2007-10-251-1/+3
| | | | | | pointers that employ unused bits in a pointer to store extra data. llvm-svn: 43373
* Disambiguated variable name to comply with VC++'s archaic variable scoping ↵Hartmut Kaiser2007-10-251-5/+5
| | | | | | rules. llvm-svn: 43369
* Added special treatment of serializing NULL pointers.Ted Kremenek2007-10-251-0/+5
| | | | llvm-svn: 43357
* Implemented prototype serialization of pointers, including supportTed Kremenek2007-10-251-2/+52
| | | | | | | | for backpatching. Added Deserialize::ReadVal. llvm-svn: 43319
* Split Serialization.h into separate headers: Serialize.h andTed Kremenek2007-10-241-17/+26
| | | | | | | Deserialize.h Serialization.h now includes trait speciailizations for unsigned long, etc. llvm-svn: 43307
* Added preliminary implementation of generic object serialization to bitcode.Ted Kremenek2007-10-231-0/+83
| | | | llvm-svn: 43261
* Next PPC long double bits. First cut at constants.Dale Johannesen2007-10-111-2/+2
| | | | | | | | | No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. llvm-svn: 42865
* Revise previous patch per review comments.Dale Johannesen2007-09-121-1/+0
| | | | | | | Next round of x87 long double stuff. Getting close now, basically works. llvm-svn: 41875
* Add APInt interfaces to APFloat (allows directlyDale Johannesen2007-09-111-5/+6
| | | | | | | | | access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). llvm-svn: 41858
* Revert previous change to IR.Dale Johannesen2007-09-071-1/+1
| | | | llvm-svn: 41769
* Next round of APFloat changes.Dale Johannesen2007-09-061-6/+9
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* Update GEP constructors to use an iterator interface to fixDavid Greene2007-09-041-1/+1
| | | | | | GLIBCXX_DEBUG issues. llvm-svn: 41697
* Update InvokeInst to work like CallInstDavid Greene2007-08-271-1/+1
| | | | llvm-svn: 41506
* Patch 10 for long double. Doing constants right needs expanding ConstantFPDale Johannesen2007-08-091-0/+4
| | | | | | | | | | | | to handle values bigger than double. If we assume host==target and host long double works correctly, this is not too bad, but we don't want to have that limitation longterm. I could implement accepting double constants as long double or something like that, which would lead to incorrect codegen with no errors; the more I think about that the worse it seems. Rather than do such a hack that would be backed out later, I'm settling for giving reasonable error messages, for now. llvm-svn: 40974
* This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth2007-08-042-0/+44
| | | | | | | | LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. llvm-svn: 40807
* Long double, part 1 of N. Support in IR.Dale Johannesen2007-08-031-0/+9
| | | | llvm-svn: 40774
OpenPOWER on IntegriCloud