summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach llvm-bcanalyzer to skip over the header we use on LLVM IR files.Chris Lattner2009-04-061-45/+2
| | | | llvm-svn: 68458
* Add support for embedded metadata to LLVM. This introduces two new types ofNick Lewycky2009-04-041-2/+27
| | | | | | | | Constant, MDString and MDNode which can only be used by globals with a name that starts with "llvm." or as arguments to a function with the same naming restriction. llvm-svn: 68420
* fix a serious regression I introduced in my previous patch.Chris Lattner2009-04-011-1/+2
| | | | llvm-svn: 68173
* reimplement BitcodeReaderValueList in terms of WeakVH instead of makingChris Lattner2009-03-311-35/+38
| | | | | | it be an LLVM IR User object. llvm-svn: 68156
* Fix internal representation of fp80 to be theDale Johannesen2009-03-231-3/+7
| | | | | | | | | | same as a normal i80 {low64, high16} rather than its own {high64, low16}. A depressing number of places know about this; I think I got them all. Bitcode readers and writers convert back to the old form to avoid breaking compatibility. llvm-svn: 67562
* It makes no sense to have a ODR version of commonDuncan Sands2009-03-111-2/+1
| | | | | | linkage, so remove it. llvm-svn: 66690
* Remove the one-definition-rule version of extern_weakDuncan Sands2009-03-111-2/+1
| | | | | | | linkage: this linkage type only applies to declarations, but ODR is only relevant to globals with definitions. llvm-svn: 66650
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-4/+8
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* Add suppport for ConstantExprs of shufflevectors whose result type is not ↵Nate Begeman2009-02-121-1/+13
| | | | | | | | equal to the type of the vectors being shuffled. llvm-svn: 64401
* fix a bitcode reader bug where it can't handle extractelement correctly:Chris Lattner2009-02-031-2/+1
| | | | | | the index of the value being extracted is always an i32. This fixes PR3465 llvm-svn: 63597
* Add the private linkage.Rafael Espindola2009-01-151-0/+1
| | | | llvm-svn: 62279
* Commit missed files from nocapture change.Nick Lewycky2008-12-191-0/+14
| | | | llvm-svn: 61240
* Temporarily revert r61019, r61030, and r61040. These were breaking LLVM ReleaseBill Wendling2008-12-161-14/+0
| | | | | | builds. llvm-svn: 61094
* Introducing nocapture, a parameter attribute for pointers to indicate that theNick Lewycky2008-12-151-0/+14
| | | | | | | | | | | | | | | | | | | | | | | callee will not introduce any new aliases of that pointer. The attributes had all bits allocated already, so I decided to collapse alignment. Alignment was previously stored as a 16-bit integer from bits 16 to 32 of the attribute, but it was required to be a power of 2. Now it's stored in log2 encoded form in five bits from 16 to 21. That gives us 11 more bits of space. You may have already noticed that you only need four bits to encode a 16-bit power of two, so why five bits? Because the AsmParser accepted 32-bit alignments, even though we couldn't store them (they were silently discarded). Now we can store them in memory, but not in the bitcode. The bitcode format was already storing these as 64-bit VBR integers. So, the bitcode format stays the same, keeping the alignment values stored as 16 bit raw values. There's some hideous code in the reader and writer that deals with this, waiting to be ripped out the moment we run out of bits again and have to replace the parameter attributes table encoding. llvm-svn: 61019
* Added support for the following definition of shufflevector Mon P Wang2008-11-101-6/+2
| | | | | | <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> llvm-svn: 58964
* make the autoupgrade code for ret attributes dramatically simpler Chris Lattner2008-10-051-30/+22
| | | | | | and actually work. We can now read the llvm 2.3 bc file from PR2849 llvm-svn: 57122
* Now Attributes are divided in three groupsDevang Patel2008-09-261-4/+45
| | | | | | | | | | | | | - return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. This patch requires corresponding changes in llvm-gcc and clang. llvm-svn: 56704
* Large mechanical patch.Devang Patel2008-09-251-13/+13
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* s/ParamAttrsWithIndex/FnAttributeWithIndex/gDevang Patel2008-09-241-2/+2
| | | | llvm-svn: 56535
* Use parameter attribute store (soon to be renamed) forDevang Patel2008-09-231-4/+0
| | | | | | Function Notes also. Function notes are stored at index ~0. llvm-svn: 56511
* Re-enables the new vector select in the bitcode reader, by modifying theDan Gohman2008-09-161-5/+23
| | | | | | | | | | | | | | | | | | | | | | bitcode reader/writer as follows: - add and use new bitcode FUNC_CODE_INST_VSELECT to handle the llvm select opcode using either i1 or [N x i1] as the selector. - retain old BITCODE FUNC_CODE_INST_SELECT in the bitcode reader to handle select on i1 for backwards compatibility with existing bitcode files. - re-enable the vector-select.ll test program. Also, rename the recently added bitcode opcode FUNC_CODE_INST_VCMP to FUNC_CODE_INST_CMP2 and make the bitcode writer use it to handle fcmp/icmp on scalars or vectors. In the bitcode writer, use FUNC_CODE_INST_CMP for vfcmp/vicmp only. In the bitcode reader, have FUNC_CODE_INST_CMP handle icmp/fcmp returning bool, for backwards compatibility with existing bitcode files. Patch by Preston Gurd! llvm-svn: 56233
* Temporarily disable vector select in the bitcode reader. TheDan Gohman2008-09-091-1/+1
| | | | | | | | way it handles the type of the condition is breaking plain scalar select in the case that the value is a forward-reference. llvm-svn: 55976
* Extend the vcmp/fcmp LLVM IR instructions to take vectors as argumentsDan Gohman2008-09-091-1/+28
| | | | | | | | | | | | | | and, if so, to return a vector of boolean as a result; Extend the select LLVM IR instruction to allow you to specify a result type which is a vector of boolean, in which case the result will be an element-wise selection instead of choosing one vector or the other; and Update LangRef.html to describe these changes. This patch was contributed by Preston Gurd! llvm-svn: 55969
* Read and write function notes.Devang Patel2008-09-021-0/+3
| | | | llvm-svn: 55657
* Switch from an O(n) method to an O(1) method for changing non-constantChris Lattner2008-08-211-4/+5
| | | | | | operands. llvm-svn: 55127
* recommit bcreader, handling packed structs correctly. ApparentlyChris Lattner2008-08-211-8/+102
| | | | | | people want fast *and* correct. Sheesh. llvm-svn: 55102
* Revert 55090, regressions in:Daniel Dunbar2008-08-211-101/+8
| | | | | | | | - Postgres - llvm-test/SingleSource/UnitTests/{2006-01-23-InitializedBitField, 2004-11-28-GlobalBoolLayout, 2003-05-02-DependentPHI} llvm-svn: 55100
* Fix an N^2 issue handling constant resolution due to RAUW in large arraysChris Lattner2008-08-211-8/+101
| | | | | | | this speeds up the bcreader from 6.67s to 0.12s on a testcase Daniel provided. rdar://6158117 llvm-svn: 55090
* Rename some GC classes so that their roll will hopefully be clearer.Gordon Henriksen2008-08-171-8/+8
| | | | | | | | | | | | | | | | | | In particular, Collector was confusing to implementors. Several thought that this compile-time class was the place to implement their runtime GC heap. Of course, it doesn't even exist at runtime. Specifically, the renames are: Collector -> GCStrategy CollectorMetadata -> GCFunctionInfo CollectorModuleMetadata -> GCModuleInfo CollectorRegistry -> GCRegistry Function::getCollector -> getGC (setGC, hasGC, clearGC) Several accessors and nested types have also been renamed to be consistent. These changes should be obvious. llvm-svn: 54899
* Enable first-class aggregates support.Dan Gohman2008-07-231-13/+27
| | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. llvm-svn: 53941
* InsertValue and ExtractValue constant expressions are alwaysDan Gohman2008-07-211-41/+0
| | | | | | | folded. Remove code that handled the case where they aren't folded, and remove bitcode reader/writer support for them. llvm-svn: 53887
* Add a little wrapper header that is put around bc files when emittingChris Lattner2008-07-091-1/+51
| | | | | | | | | | | | | | | | bc files for modules with a target triple that indicates they are for darwin. The reader unconditionally handles this, and the writer could turn this on for more targets if we care. This change has two benefits for darwin: 1) it allows us to encode the cpu type of the file in an easy to read place that doesn't require decoding the bc file. 2) it works around a bug (IMO) in darwin's AR where it is incapable of handling files that are not a multiple of 8 bytes long. BC files are only guaranteed to be multiples of 4 bytes long. llvm-svn: 53275
* Improved bitcode support for insertvalue/extractvalue.Dan Gohman2008-05-311-2/+2
| | | | llvm-svn: 51822
* IR, bitcode reader, bitcode writer, and asmparser changes toDan Gohman2008-05-311-33/+55
| | | | | | | | | | | insertvalue and extractvalue to use constant indices instead of Value* indices. And begin updating LangRef.html. There's definately more to come here, but I'm checking this basic support in now to make it available to people who are interested. llvm-svn: 51806
* eliminate calls to deprecated Use::init() interfaceGabor Greif2008-05-261-2/+2
| | | | llvm-svn: 51570
* Make structs and arrays first-class types, and add assemblyDan Gohman2008-05-231-0/+64
| | | | | | | | | and bitcode support for the extractvalue and insertvalue instructions and constant expressions. Note that this does not yet include CodeGen support. llvm-svn: 51468
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-161-2/+2
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-1/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Add CommonLinkage; currently tentative definitionsDale Johannesen2008-05-141-0/+1
| | | | | | | | | | are represented as "weak", but there are subtle differences in some cases on Darwin, so we need both. The intent is that "common" will behave identically to "weak" unless somebody changes their target to do something else. No functional change as yet. llvm-svn: 51118
* Simplify some checksNate Begeman2008-05-121-4/+4
| | | | llvm-svn: 50998
* Pointer comparisons should use icmp, not vicmpNate Begeman2008-05-121-1/+1
| | | | llvm-svn: 50996
* Pointer comparisons should be handled by icmp, not vicmp :)Nate Begeman2008-05-121-1/+1
| | | | llvm-svn: 50994
* Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRefNate Begeman2008-05-121-3/+11
| | | | | | for details. CodeGen support coming in a follow up patch llvm-svn: 50985
* merge of use-diet branch to trunkGabor Greif2008-05-101-12/+39
| | | | llvm-svn: 50943
* Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989Nick Lewycky2008-04-251-9/+0
| | | | | | r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. llvm-svn: 50265
* Switch to using Simplified ConstantFP::get API.Chris Lattner2008-04-201-5/+5
| | | | llvm-svn: 49977
* Gabor points out that reserveOperandSpace takes # of values, Chris Lattner2008-04-131-1/+1
| | | | | | not # of operands as an input. llvm-svn: 49599
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-15/+19
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Reimplement the parameter attributes support, phase #1. hilights:Chris Lattner2008-03-121-17/+6
| | | | | | | | | | | | | | | | | | | | | | | 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. llvm-svn: 48289
* when the bitcode reader is referencing a paramattr, make sure to bump its ↵Chris Lattner2008-03-121-1/+12
| | | | | | refcount. llvm-svn: 48276
OpenPOWER on IntegriCloud