summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
AgeCommit message (Collapse)Author
2013-10-31Fix a use after free on invalid input.Rafael Espindola
llvm-svn: 193737
2013-10-27Revert r193251 : Use address-taken to disambiguate global variable and ↵Shuxin Yang
indirect memops. llvm-svn: 193489
2013-10-23Use address-taken to disambiguate global variable and indirect memops.Shuxin Yang
Major steps include: 1). introduces a not-addr-taken bit-field in GlobalVariable 2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable dosen't have its address taken. 3). AA use this info for disambiguation. llvm-svn: 193251
2013-09-28AutoUpgrade: upgrade from scalar TBAA format to struct-path aware TBAA format.Manman Ren
We treat TBAA tags as struct-path aware TBAA format when the first operand is a MDNode and the tag has 3 or more operands. llvm-svn: 191593
2013-09-16Implement function prefix data as an IR feature.Peter Collingbourne
Previous discussion: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html Differential Revision: http://llvm-reviews.chandlerc.com/D1191 llvm-svn: 190773
2013-09-12Patch provide by Tom Roeder!Joe Abbey
Reviewed by Joe Abbey and Tobias Grosser Here is a patch that fixes decoding of CE_SELECT in BitcodeReader, along with a simple test case. The problem in the current code is that it generates but doesn't accept bitcode that uses vectors for the first element of a select in this context. llvm-svn: 190634
2013-09-09Revert patches to add case-range support for PR1255.Bob Wilson
The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 llvm-svn: 190328
2013-08-23Add function attribute 'optnone'.Andrea Di Biagio
This function attribute indicates that the function is not optimized by any optimization or code generator passes with the exception of interprocedural optimization passes. llvm-svn: 189101
2013-07-26Make .bc en/decoding of AttrKind stableTobias Grosser
The bitcode representation attribute kinds are encoded into / decoded from should be independent of the current set of LLVM attributes and their position in the AttrKind enum. This patch explicitly encodes attributes to fixed bitcode values. With this patch applied, LLVM does not silently misread attributes written by LLVM 3.3. We also enhance the decoding slightly such that an error message is printed if an unknown AttrKind encoding was dected. Bonus: Dropping bitcode attributes from AttrKind is now easy, as old AttrKinds do not need to be kept to support the Bitcode reader. llvm-svn: 187186
2013-05-24Remove the Copied parameter from MemoryObject::readBytes.Benjamin Kramer
There was exactly one caller using this API right, the others were relying on specific behavior of the default implementation. Since it's too hard to use it right just remove it and standardize on the default behavior. Defines away PR16132. llvm-svn: 182636
2013-05-05Add ArrayRef constructor from None, and do the cleanups that this ↵Dmitri Gribenko
constructor enables Patch by Robert Wilhelm. llvm-svn: 181138
2013-02-12Have the bitcode writer and reader handle the new attribute references.Bill Wendling
The bitcode writer emits a reference to the attribute group that the object at the given index refers to. The bitcode reader is modified to read this in and map it back to the attribute group. llvm-svn: 174952
2013-02-11Use a std::map so that we record the group ID.Bill Wendling
llvm-svn: 174910
2013-02-11[tsan/msan] adding thread_safety and uninitialized_checks attributesKostya Serebryany
llvm-svn: 174864
2013-02-10Add support in the bitcode reader to read the attribute groups.Bill Wendling
This reads the attribute groups. It currently doesn't do anything with them. NOTE: In the commit to the bitcode writer, the format *may* change in the near future. Which means that this code would also change. llvm-svn: 174849
2013-02-06Code Custodian (trivial whitespace cleanup)Joe Abbey
llvm-svn: 174550
2013-02-05Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword ↵Michael Gottesman
externally_initialized. llvm-svn: 174340
2013-02-04Initial cleanups of the param-attribute code in the bitcode reader/writer.Bill Wendling
Rename the PARAMATTR_CODE_ENTRY to PARAMATTR_CODE_ENTRY_OLD. It will be replaced by another encoding. Keep around the current LLVM attribute encoder/decoder code, but move it to the bitcode directories so that no one's tempted to use them. llvm-svn: 174335
2013-01-29Use an AttrBuilder to generate the correct AttributeSet.Bill Wendling
We no longer accept an encoded integer as representing all of the attributes. Convert this via the AttrBuilder class into an AttributeSet with the correct representation (an AttributeSetImpl that holds a list of Attribute objects). llvm-svn: 173750
2013-01-27Use the AttributeSet instead of AttributeWithIndex object.Bill Wendling
llvm-svn: 173598
2013-01-25Remove some introspection functions.Bill Wendling
The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. llvm-svn: 173522
2013-01-22Make APFloat constructor require explicit semantics.Tim Northover
Previously we tried to infer it from the bit width size, with an added IsIEEE argument for the PPC/IEEE 128-bit case, which had a default value. This default value allowed bugs to creep in, where it was inappropriate. llvm-svn: 173138
2013-01-20trivial micro-optimization: lazily call the virtual method instead of ↵Chris Lattner
eagerly calling it. llvm-svn: 172953
2013-01-20convert the bitstream reader itself and the IR .bc file parser to use the ↵Chris Lattner
new advance() APIs, simplifying things and making a bunch of details more private to BitstreamCursor. llvm-svn: 172947
2013-01-19Add a new BitstreamEntry concept, and add two helper methods for walkingChris Lattner
through a BitstreamCursor that produce it: advance() and advanceSkippingSubblocks(), representing the two most common ways clients want to walk through bitcode. llvm-svn: 172919
2013-01-19BitstreamReader hasn't aged well. It's been hacked on by various people andChris Lattner
has past the point of making sense. Lets tidy things up: first step, moving a ton of big functions out of line. llvm-svn: 172904
2013-01-09Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test ↵Bill Wendling
hangings. llvm-svn: 172020
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth
into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
2012-12-30s/Raw/getBitMask/g to be more in line with current naming conventions. This ↵Bill Wendling
method won't be sticking around. llvm-svn: 171244
2012-12-19Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling
single attribute in the future. llvm-svn: 170502
2012-12-09Reorganize FastMathFlags to be a wrapper around unsigned, and streamline ↵Michael Ilseman
some interfaces. llvm-svn: 169712
2012-12-09Have the bitcode reader/writer just use FPMathOperator's fast math enum directlyMichael Ilseman
llvm-svn: 169710
2012-12-07s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling
in the near future. llvm-svn: 169651
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-11-28Add back support for reading and parsing 'deplibs'.Bill Wendling
This is for backwards compatibility for pre-3.x bc files. The code reads the code, but does nothing with it. llvm-svn: 168779
2012-11-27Remove the dependent libraries feature.Bill Wendling
The dependent libraries feature was never used and has bit-rotted. Remove it. llvm-svn: 168694
2012-11-27Code pretificationJoe Abbey
llvm-svn: 168661
2012-11-27Fast-math flags for the bitcodeMichael Ilseman
Added in bitcode enum for the serializing of fast-math flags. Added in the reading/writing of fast-math flags from the OptimizationFlags record for BinaryOps. llvm-svn: 168646
2012-11-25Code Custodian:Joe Abbey
- Widespread trailing space removal - A dash of OCD spacing to block align enums - joined a line that probably needed 80 cols a while back llvm-svn: 168566
2012-11-20Make the AttrListPtr object a part of the LLVMContext.Bill Wendling
When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. llvm-svn: 168354
2012-11-1980 colsJoe Abbey
llvm-svn: 168318
2012-11-15Remove trailing whitespaceMichael Ilseman
llvm-svn: 168103
2012-10-15Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling
own class named AttrBuilder. No functionality change. llvm-svn: 165960
2012-10-15Attributes RewriteBill Wendling
Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. llvm-svn: 165917
2012-10-11Remove unnecessary classof()'sSean Silva
isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. llvm-svn: 165767
2012-10-11Change encoding of instruction operands in bitcode binaries to be relativeJan Wen Voung
to the instruction position. The old encoding would give an absolute ID which counts up within a function, and only resets at the next function. I.e., Instead of having: ... = icmp eq i32 n-1, n-2 br i1 ..., label %bb1, label %bb2 it will now be roughly: ... = icmp eq i32 1, 2 br i1 1, label %bb1, label %bb2 This makes it so that ids remain relatively small and can be encoded in fewer bits. With this encoding, forward reference operands will be given negative-valued IDs. Use signed VBRs for the most common case of forward references, which is phi instructions. To retain backward compatibility we bump the bitcode version from 0 to 1 to distinguish between the different encodings. llvm-svn: 165739
2012-10-04Use method to query if there are attributes.Bill Wendling
llvm-svn: 165213
2012-09-25Move remaining methods inside the Attributes class. Merge the 'Attribute' ↵Bill Wendling
namespaces. llvm-svn: 164631
2012-09-21BitcodeReader: Correctly insert blockaddress constant referring to a already ↵Benjamin Kramer
parsed function. We inserted a placeholder that was never replaced because the function was already visited. Assert that all placeholders have been resolved when tearing down the bitcode reader. Fixes PR13895. llvm-svn: 164369
2012-09-15Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Craig Topper
llvm-svn: 163974