summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.h
AgeCommit message (Collapse)Author
2012-12-04Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth
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. =] llvm-svn: 169224
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-10-11Fix some typos 165739, spotted by Duncan.Jan Wen Voung
llvm-svn: 165753
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-02-29Fix PR12080 by ensuring that MaterializeModule actually reads all the bitcodeDerek Schuff
in the streaming case. llvm-svn: 151676
2012-02-06Enable streaming of bitcodeDerek Schuff
This CL delays reading of function bodies from initial parse until materialization, allowing overlap of compilation with bitcode download. llvm-svn: 149918
2012-01-02Materialize functions whose basic blocks are used by global variables. FixesRafael Espindola
PR11677. llvm-svn: 147425
2011-12-07Begin adding experimental support for preserving use-list ordering of bitcodeChad Rosier
files. First, add a new block USELIST_BLOCK to the bitcode format. This is where USELIST_CODE_ENTRYs will be stored. The format of the USELIST_CODE_ENTRYs have not yet been defined. Add support in the BitcodeReader for parsing the USELIST_BLOCK. Part of rdar://9860654 and PR5680. llvm-svn: 146078
2011-11-27remove support for reading llvm 2.9 .bc files. LLVM 3.1 is only compatible ↵Chris Lattner
back to 3.0 llvm-svn: 145164
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner
llvm-svn: 135375
2011-07-09Land the long talked about "type system rewrite" patch. ThisChris Lattner
patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
2011-07-07type can be nullChris Lattner
llvm-svn: 134601
2011-07-07use a more efficient check for 'is metadata'Chris Lattner
llvm-svn: 134599
2011-06-17remove bitcode reader support for LLVM 2.7 metadata encoding.Chris Lattner
llvm-svn: 133268
2010-10-06Provide a fast "get me the target triple from the module" API. This canBill Wendling
drastically reduce the linking time during LTO. Patch by Shantonu Sen! llvm-svn: 115728
2010-09-13Add full auto-upgrade support for LLVM 2.7 bitcode metadata.Dan Gohman
llvm-svn: 113764
2010-07-20Add support for remapping metadata kind IDs when reading in aDan Gohman
bitcode file, so that two bitcode files where the same metadata kind name happens to have been assigned a different ID can still be linked together. Eliminate the restriction that metadata kind IDs can't be 0. Change MD_dbg from 1 to 0, because we can now, and because it's less mysterious that way. llvm-svn: 108939
2010-01-27Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. llvm-svn: 94686
2009-12-29Final step in the metadata API restructuring: move the Chris Lattner
getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. llvm-svn: 92259
2009-10-28add bitcode reader support for blockaddress. We can now fullyChris Lattner
round trip blockaddress through .ll and .bc files, so add a testcase. There are still a bunch of places in the optimizer and other places that need to be updated to work with these constructs, but at least the basics are in now. llvm-svn: 85377
2009-09-18Write and read metadata attachments.Devang Patel
llvm-svn: 82259
2009-08-13Push LLVMContexts through the IntegerType APIs.Owen Anderson
llvm-svn: 78948
2009-08-11Make LLVMContext and LLVMContextImpl classes instead of structs.Benjamin Kramer
llvm-svn: 78690
2009-08-04Factor some of the constants+context related code out into a separate ↵Owen Anderson
header, to make LLVMContextImpl.h not hideous. Also, fix some MSVC compile errors. llvm-svn: 78115
2009-08-04Use separate ValueList for metadata.Devang Patel
This fixes PR4666. llvm-svn: 78056
2009-07-22Introduce MetadataBase, a base class for MDString and MDNode.Devang Patel
Derive MDString directly from MetadataBase. Introduce new bitcode block to hold metadata. llvm-svn: 76759
2009-07-07LLVMContext-ify the bitcode reader.Owen Anderson
llvm-svn: 74942
2009-07-01Make the use of const with respect to LLVMContext sane. Hopefully this is ↵Owen Anderson
the last time, for the moment, that I will need to make far-reaching changes. llvm-svn: 74655
2009-07-01Hold the LLVMContext by reference rather than by pointer.Owen Anderson
llvm-svn: 74640
2009-07-01Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson
LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. llvm-svn: 74614
2009-04-26Make a major API change to BitstreamReader: split all the readingChris Lattner
state out of the BitstreamReader class into a BitstreamCursor class. Doing this allows the client to have multiple cursors into the same file, each with potentially different live block stacks and abbreviation records. llvm-svn: 70157
2009-03-31reimplement BitcodeReaderValueList in terms of WeakVH instead of makingChris Lattner
it be an LLVM IR User object. llvm-svn: 68156
2008-09-26Now Attributes are divided in three groupsDevang Patel
- 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
2008-09-25 Large mechanical patch.Devang Patel
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
2008-09-23s/ParameterAttributes/Attributes/gDevang Patel
llvm-svn: 56513
2008-08-21recommit bcreader, handling packed structs correctly. ApparentlyChris Lattner
people want fast *and* correct. Sheesh. llvm-svn: 55102
2008-08-21Revert 55090, regressions in:Daniel Dunbar
- Postgres - llvm-test/SingleSource/UnitTests/{2006-01-23-InitializedBitField, 2004-11-28-GlobalBoolLayout, 2003-05-02-DependentPHI} llvm-svn: 55100
2008-08-21Fix an N^2 issue handling constant resolution due to RAUW in large arraysChris Lattner
this speeds up the bcreader from 6.67s to 0.12s on a testcase Daniel provided. rdar://6158117 llvm-svn: 55090
2008-05-26eliminate calls to deprecated Use::init() interfaceGabor Greif
llvm-svn: 51570
2008-05-10merge of use-diet branch to trunkGabor Greif
llvm-svn: 50943
2008-03-25Add explicit keywords.Dan Gohman
llvm-svn: 48801
2008-03-12Reimplement the parameter attributes support, phase #1. hilights:Chris Lattner
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
2007-12-29Remove attribution from file headers, per discussion on llvmdev.Chris Lattner
llvm-svn: 45418
2007-08-04This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth
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
2007-05-18Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.Chris Lattner
llvm-svn: 37204
2007-05-15implement the ModuleProvider::dematerializeFunction hookChris Lattner
llvm-svn: 37080
2007-05-06Keep header file free of 'possible loss of data' warnings.Jeff Cohen
llvm-svn: 36832
2007-05-06stop encoding type/value pairs when the type is implied by the value.Chris Lattner
This shrinks the function block of kc++ from 1055K to 906K llvm-svn: 36816
2007-05-04add support for reading the param attrs blockChris Lattner
llvm-svn: 36731
2007-05-02add reader logic for terminator instrs.Chris Lattner
llvm-svn: 36642