aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Reader/BitcodeReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.Chris Lattner2007-05-181-53/+82
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37204 91177308-0d34-0410-b5e6-96231b3b80d8
* implement the ModuleProvider::dematerializeFunction hookChris Lattner2007-05-151-8/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37080 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a preemptive bitcode format change to support PR1146. This lets us doChris Lattner2007-05-081-16/+25
| | | | | | | | pr1146 in llvm 2.1 without ugly code to emulate old behavior. This should be merged into the 2.0 release branch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36928 91177308-0d34-0410-b5e6-96231b3b80d8
* fix off-by-one that caused the llvm2cpp test to failChris Lattner2007-05-061-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36880 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow structs with zero fields.Chris Lattner2007-05-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36862 91177308-0d34-0410-b5e6-96231b3b80d8
* add a missing checkChris Lattner2007-05-061-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36859 91177308-0d34-0410-b5e6-96231b3b80d8
* implement reading/writing of inlineasm objectsChris Lattner2007-05-061-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36827 91177308-0d34-0410-b5e6-96231b3b80d8
* add a denser encoding for null terminated strings, add a 6-bit abbrev asChris Lattner2007-05-061-0/+14
| | | | | | | well. This shrinks kc++ from 2724088 to 2717360 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36821 91177308-0d34-0410-b5e6-96231b3b80d8
* implement the 'string constant' optimization. This shrinks kc.bit fromChris Lattner2007-05-061-0/+14
| | | | | | | 2878544 to 2815788 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36818 91177308-0d34-0410-b5e6-96231b3b80d8
* further reduce the redundancy of types in the instruction encoding. ThisChris Lattner2007-05-061-64/+65
| | | | | | | shrinks function bodies in kc++ from 891913B to 884073B git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36817 91177308-0d34-0410-b5e6-96231b3b80d8
* stop encoding type/value pairs when the type is implied by the value.Chris Lattner2007-05-061-75/+69
| | | | | | | This shrinks the function block of kc++ from 1055K to 906K git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36816 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for BLOCKINFO records at the module level. This fixes the readerChris Lattner2007-05-051-0/+4
| | | | | | | issues reid noticed last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36785 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for globally associating abbrevs with block IDs, whichChris Lattner2007-05-051-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | relieves us from having to emit the abbrevs into each instance of the block. This shrinks kc.bit from 3368K to 3333K, but will be a more significant win once instructions are abbreviated. The VST went from: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 to: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.5198 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 because we didn't emit the same 3 abbrevs 2345 times :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36767 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate internal length fields from record. Records already know theirChris Lattner2007-05-041-37/+36
| | | | | | | total length git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36752 91177308-0d34-0410-b5e6-96231b3b80d8
* storeinst ctor takes isvolatile before alignment. With this, 176.gcc roundtripsChris Lattner2007-05-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36738 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a misplaced errorChris Lattner2007-05-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36736 91177308-0d34-0410-b5e6-96231b3b80d8
* encode and read param attrs along with function type. WE can now roundtrip ↵Chris Lattner2007-05-041-7/+6
| | | | | | Olden/voronoi loslessly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36735 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for reading the param attrs blockChris Lattner2007-05-041-0/+69
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36731 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead codeChris Lattner2007-05-041-6/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36728 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow this to compile with gcc 4.0.XReid Spencer2007-05-041-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36723 91177308-0d34-0410-b5e6-96231b3b80d8
* Encoding calling conv info in call/invoke instrs, tree add now round trips ↵Chris Lattner2007-05-031-16/+21
| | | | | | completely git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36707 91177308-0d34-0410-b5e6-96231b3b80d8
* the type field for a store is the type of the pointer, not the value.Chris Lattner2007-05-031-3/+4
| | | | | | | With this fix I can round trip treeaadd, only losing calling conv info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36706 91177308-0d34-0410-b5e6-96231b3b80d8
* fix encoding of BB names in the symtabChris Lattner2007-05-031-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36704 91177308-0d34-0410-b5e6-96231b3b80d8
* bug fixesChris Lattner2007-05-031-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36701 91177308-0d34-0410-b5e6-96231b3b80d8
* implement the rest of the instructionsChris Lattner2007-05-031-10/+68
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36699 91177308-0d34-0410-b5e6-96231b3b80d8
* add a few more instructions, getting closeChris Lattner2007-05-031-10/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36688 91177308-0d34-0410-b5e6-96231b3b80d8
* add reader logic for terminator instrs.Chris Lattner2007-05-021-8/+89
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36642 91177308-0d34-0410-b5e6-96231b3b80d8
* add reader support for a bunch of new instructionsChris Lattner2007-05-021-14/+90
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36641 91177308-0d34-0410-b5e6-96231b3b80d8
* read a few instructions, fix some bugs. This is enough to be able to roundChris Lattner2007-05-021-15/+38
| | | | | | | | | | | | | | | trip function bodies like this: define <2 x i64> @foo(<2 x i64> %x, <2 x i64> %y) { %tmp4 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1] %tmp5 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1] %tmp = add <8 x i16> %tmp5, %tmp4 ; <<8 x i16>> [#uses=1] %tmp6 = bitcast <8 x i16> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1] ret <2 x i64> %tmp6 } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36640 91177308-0d34-0410-b5e6-96231b3b80d8
* handle function-level forward references, read binops.Chris Lattner2007-05-011-20/+126
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36620 91177308-0d34-0410-b5e6-96231b3b80d8
* implement materializeModule, force deallocation of vector memory when weChris Lattner2007-05-011-6/+99
| | | | | | | are done with them, start implementing ParseFunctionBody git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36617 91177308-0d34-0410-b5e6-96231b3b80d8
* The stream to read from is now an ivarChris Lattner2007-05-011-13/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36615 91177308-0d34-0410-b5e6-96231b3b80d8
* implement scafolding for lazy deserialization of function bodiesChris Lattner2007-05-011-2/+63
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36614 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement visibility checking during linking. Also implement protectedAnton Korobeynikov2007-04-291-0/+1
| | | | | | | visibility support for bitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36577 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the bitcode reader interface to take a MemoryBuffer instead of knowingChris Lattner2007-04-291-5/+50
| | | | | | | | | | | | | | | anything about disk I/O itself. This greatly simplifies its interface - eliminating the need for the ReaderWrappers.cpp file. This adds a new option to llvm-dis (-bitcode) which instructs it to read the input file as bitcode. Until/unless the bytecode reader is taught to read from MemoryBuffer, there is no way to handle stdin reading without it. I don't plan to switch the bytecode reader over, I'd rather delete it :), so the option will stay around temporarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36554 91177308-0d34-0410-b5e6-96231b3b80d8
* This is not "FIXME" anymoreAnton Korobeynikov2007-04-281-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36541 91177308-0d34-0410-b5e6-96231b3b80d8
* move some code around, fix a bug in the reader reading globalinits (whichChris Lattner2007-04-261-3/+11
| | | | | | | | I just introduced), stub out function reading, purge aggregate values from the value table before reading functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36463 91177308-0d34-0410-b5e6-96231b3b80d8
* add bitcode alias supportChris Lattner2007-04-261-17/+57
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36461 91177308-0d34-0410-b5e6-96231b3b80d8
* ensure that every error return sets a message (and goes through Error, forChris Lattner2007-04-241-19/+35
| | | | | | | | | | easy breakpointing). Fix bugs reading constantexpr geps. We now can disassemble kc++ global initializers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36398 91177308-0d34-0410-b5e6-96231b3b80d8
* fix memory leakChris Lattner2007-04-241-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36397 91177308-0d34-0410-b5e6-96231b3b80d8
* implement reading and writing of constant exprs.Chris Lattner2007-04-241-6/+133
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36394 91177308-0d34-0410-b5e6-96231b3b80d8
* implement support for reading aggregate constants, including handling forwardChris Lattner2007-04-241-1/+77
| | | | | | | constant references, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36391 91177308-0d34-0410-b5e6-96231b3b80d8
* add supprot for FP constants, wide integers, and fix the encoding of MININTChris Lattner2007-04-241-8/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36390 91177308-0d34-0410-b5e6-96231b3b80d8
* read basic constants: null, undef, integers <= 64bitsChris Lattner2007-04-241-0/+77
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36389 91177308-0d34-0410-b5e6-96231b3b80d8
* move check to the right place :)Chris Lattner2007-04-241-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36386 91177308-0d34-0410-b5e6-96231b3b80d8
* track global initsChris Lattner2007-04-241-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36385 91177308-0d34-0410-b5e6-96231b3b80d8
* Read global symtabChris Lattner2007-04-231-3/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36378 91177308-0d34-0410-b5e6-96231b3b80d8
* implement reading of abbrevs, and writing of abbreviated global varrs.Chris Lattner2007-04-231-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36367 91177308-0d34-0410-b5e6-96231b3b80d8
* first part of implementation of abbrevs. The writer isn't fully there yet ↵Chris Lattner2007-04-231-6/+8
| | | | | | | | | and the reader doesn't handle them at all yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36363 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for reading bitcode files. They currently only read types,Chris Lattner2007-04-221-0/+455
the type symtab, and global/function protos, and are missing the important size optimization, but it is a place to start. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36330 91177308-0d34-0410-b5e6-96231b3b80d8