aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add code for emitting the attribute groups.Bill Wendling2013-02-101-0/+53
| | | | | | | | | | | | | | | | | | | | This is some initial code for emitting the attribute groups into the bitcode. NOTE: This format *may* change! Do not rely upon the attribute groups' bitcode not changing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174845 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add support for attribute groups in the value enumerator.Bill Wendling2013-02-102-0/+24
| | | | | | | | | | | | | | | | Attribute groups are essentially all AttributeSets which are used by the program. Enumerate them here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174844 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix the underlying problem that was causing read(0) to be called: sometimes theChris Lattner2013-02-091-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitcode writer would generate abbrev records saying that the abbrev should be filled with fixed zero-bit bitfields (this happens in the .bc writer when the number of types used in a module is exactly one, since log2(1) == 0). In this case, just handle it as a literal zero. We can't "just fix" the writer without breaking compatibility with existing bc files, so have the abbrev reader do the substitution. Strengthen the assert in read to reject reads of zero bits so we catch such crimes in the future, and remove the special case designed to handle this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174801 91177308-0d34-0410-b5e6-96231b3b80d8
| * Code Custodian (trivial whitespace cleanup)Joe Abbey2013-02-062-67/+66
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174550 91177308-0d34-0410-b5e6-96231b3b80d8
| * Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword ↵Michael Gottesman2013-02-052-2/+7
| | | | | | | | | | | | externally_initialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174340 91177308-0d34-0410-b5e6-96231b3b80d8
| * Initial cleanups of the param-attribute code in the bitcode reader/writer.Bill Wendling2013-02-042-7/+49
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174335 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use an AttrBuilder to generate the correct AttributeSet.Bill Wendling2013-01-291-9/+4
| | | | | | | | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173750 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use the AttributeSet instead of AttributeWithIndex object.Bill Wendling2013-01-271-3/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173598 91177308-0d34-0410-b5e6-96231b3b80d8
| * Remove some introspection functions.Bill Wendling2013-01-252-4/+6
| | | | | | | | | | | | | | | | | | The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173522 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use the new 'getSlotIndex' method to retrieve the attribute's slot index.Bill Wendling2013-01-251-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173499 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make APFloat constructor require explicit semantics.Tim Northover2013-01-221-6/+12
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173138 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix a heinous inefficiency introduced in r149918, wherein reading each byte of aChris Lattner2013-01-211-9/+8
| | | | | | | | | | | | | | | | | | BLOB (i.e., large, performance intensive data) in a bitcode file was switched to invoking one virtual method call per byte read. Now we do one virtual call per BLOB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173065 91177308-0d34-0410-b5e6-96231b3b80d8
| * wean Blob handling logic off of banging on NextChar directly. Instead, makeChris Lattner2013-01-211-10/+13
| | | | | | | | | | | | | | | | it reason about the current bit position, which is always independent of the underlying cursors word size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173063 91177308-0d34-0410-b5e6-96231b3b80d8
| * rename "SkipToWord" to "SkipToFourByteBoundary" since a word is not always 4 ↵Chris Lattner2013-01-211-3/+3
| | | | | | | | | | | | bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173062 91177308-0d34-0410-b5e6-96231b3b80d8
| * trivial micro-optimization: lazily call the virtual method instead of ↵Chris Lattner2013-01-201-1/+1
| | | | | | | | | | | | eagerly calling it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172953 91177308-0d34-0410-b5e6-96231b3b80d8
| * convert the bitstream reader itself and the IR .bc file parser to use the ↵Chris Lattner2013-01-202-248/+214
| | | | | | | | | | | | | | | | | | new advance() APIs, simplifying things and making a bunch of details more private to BitstreamCursor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172947 91177308-0d34-0410-b5e6-96231b3b80d8
| * stringref'ize readRecord and properly capitalize it. Add a compatibility ↵Chris Lattner2013-01-201-6/+7
| | | | | | | | | | | | | | | | | | method to easy the transition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172940 91177308-0d34-0410-b5e6-96231b3b80d8
| * move some private methods out of line, add a skipRecord() method.Chris Lattner2013-01-201-3/+111
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172931 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add a new BitstreamEntry concept, and add two helper methods for walkingChris Lattner2013-01-192-2/+2
| | | | | | | | | | | | | | | | | | through a BitstreamCursor that produce it: advance() and advanceSkippingSubblocks(), representing the two most common ways clients want to walk through bitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172919 91177308-0d34-0410-b5e6-96231b3b80d8
| * BitstreamReader hasn't aged well. It's been hacked on by various people andChris Lattner2013-01-193-4/+254
| | | | | | | | | | | | | | | | has past the point of making sense. Lets tidy things up: first step, moving a ton of big functions out of line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172904 91177308-0d34-0410-b5e6-96231b3b80d8
| * Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test ↵Bill Wendling2013-01-091-1/+1
| | | | | | | | | | | | hangings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172020 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge remote-tracking branch 'upstream/master' into merge-llvmStephen Hines2013-01-218-315/+454
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp lib/MC/MCAssembler.cpp lib/Support/Atomic.cpp lib/Support/Memory.cpp lib/Target/ARM/ARMJITInfo.cpp Change-Id: Ib339baf88df5b04870c8df1bedcfe1f877ccab8d
| * Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-026-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
| * s/Raw/getBitMask/g to be more in line with current naming conventions. This ↵Bill Wendling2012-12-301-1/+1
| | | | | | | | | | | | method won't be sticking around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171244 91177308-0d34-0410-b5e6-96231b3b80d8
| * Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-194-8/+8
| | | | | | | | | | | | single attribute in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
| * Reorganize FastMathFlags to be a wrapper around unsigned, and streamline ↵Michael Ilseman2012-12-092-15/+15
| | | | | | | | | | | | some interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169712 91177308-0d34-0410-b5e6-96231b3b80d8
| * Have the bitcode reader/writer just use FPMathOperator's fast math enum directlyMichael Ilseman2012-12-092-10/+10
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169710 91177308-0d34-0410-b5e6-96231b3b80d8
| * s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-075-15/+15
| | | | | | | | | | | | in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169651 91177308-0d34-0410-b5e6-96231b3b80d8
| * Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8
| * Minor tweaking to SmallVector static size.Michael Ilseman2012-12-031-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169176 91177308-0d34-0410-b5e6-96231b3b80d8
| * Since this SmallVector immediately grows on the next line, don't waste stack ↵Michael Ilseman2012-12-031-1/+1
| | | | | | | | | | | | space. SmallVector is still needed due to existing APIs growing their arguments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169157 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-034-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add back support for reading and parsing 'deplibs'.Bill Wendling2012-11-281-0/+8
| | | | | | | | | | | | | | | | This is for backwards compatibility for pre-3.x bc files. The code reads the code, but does nothing with it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168779 91177308-0d34-0410-b5e6-96231b3b80d8
| * Remove the dependent libraries feature.Bill Wendling2012-11-272-11/+0
| | | | | | | | | | | | | | The dependent libraries feature was never used and has bit-rotted. Remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168694 91177308-0d34-0410-b5e6-96231b3b80d8
| * Code pretificationJoe Abbey2012-11-271-8/+8
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168661 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fast-math flags for the bitcodeMichael Ilseman2012-11-272-0/+27
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168646 91177308-0d34-0410-b5e6-96231b3b80d8
| * Code Custodian:Joe Abbey2012-11-258-68/+67
| | | | | | | | | | | | | | | | | | | | - Widespread trailing space removal - A dash of OCD spacing to block align enums - joined a line that probably needed 80 cols a while back git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168566 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make the AttrListPtr object a part of the LLVMContext.Bill Wendling2012-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168354 91177308-0d34-0410-b5e6-96231b3b80d8
| * 80 colsJoe Abbey2012-11-191-6/+9
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168318 91177308-0d34-0410-b5e6-96231b3b80d8
| * Remove trailing whitespaceMichael Ilseman2012-11-152-75/+75
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168103 91177308-0d34-0410-b5e6-96231b3b80d8
| * Relax the restrictions on vector of pointer types, and vector getelementptr.Duncan Sands2012-11-131-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously in a vector of pointers, the pointer couldn't be any pointer type, it had to be a pointer to an integer or floating point type. This is a hassle for dragonegg because the GCC vectorizer happily produces vectors of pointers where the pointer is a pointer to a struct or whatever. Vector getelementptr was restricted to just one index, but now that vectors of pointers can have any pointer type it is more natural to allow arbitrary vector getelementptrs. There is however the issue of struct GEPs, where if each lane chose different struct fields then from that point on each lane will be working down into unrelated types. This seems like too much pain for too little gain, so when you have a vector struct index all the elements are required to be the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167828 91177308-0d34-0410-b5e6-96231b3b80d8
| * Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-151-1/+1
| | | | | | | | | | | | own class named AttrBuilder. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960 91177308-0d34-0410-b5e6-96231b3b80d8
| * Attributes RewriteBill Wendling2012-10-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917 91177308-0d34-0410-b5e6-96231b3b80d8
| * Remove unnecessary classof()'sSean Silva2012-10-111-1/+0
| | | | | | | | | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix some typos 165739, spotted by Duncan.Jan Wen Voung2012-10-112-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165753 91177308-0d34-0410-b5e6-96231b3b80d8
| * Change encoding of instruction operands in bitcode binaries to be relativeJan Wen Voung2012-10-113-90/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165739 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use method to query if there are attributes.Bill Wendling2012-10-041-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165213 91177308-0d34-0410-b5e6-96231b3b80d8
| * Move remaining methods inside the Attributes class. Merge the 'Attribute' ↵Bill Wendling2012-09-252-2/+2
| | | | | | | | | | | | namespaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164631 91177308-0d34-0410-b5e6-96231b3b80d8
| * BitcodeReader: Correctly insert blockaddress constant referring to a already ↵Benjamin Kramer2012-09-211-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164369 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Craig Topper2012-09-152-4/+4
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163974 91177308-0d34-0410-b5e6-96231b3b80d8