Gabor Greif
cc8681cea3
Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
...
llvm-svn: 80224
2009-08-27 06:41:46 +00:00
Chris Lattner
2bbbcbca79
fix some type confusion in ReadVBR64: "Piece" should be only 32 bits,
...
not 64, because we read at most 32 bits at a time. OTOH, "Result" must
be 64-bits and insertion into it must be 64-bit clean. Thanks to Ivan
Sorokin for bringing this up.
llvm-svn: 74932
2009-07-07 18:39:49 +00:00
Sebastian Redl
51473d2434
Fix three MSVC 2008 warnings that completely clutter the build output.
...
llvm-svn: 74430
2009-06-29 17:12:06 +00:00
Chris Lattner
c8838e7b00
give bitstreamreader an API to ignore names for blocks/records,
...
only llvm-bcanalyzer wants this info.
llvm-svn: 70239
2009-04-27 20:04:08 +00:00
Chris Lattner
f84ee5d944
Add two new record types to the blockinfo block:
...
BLOCKNAME and SETRECORDNAME. This allows a bitcode
file to be self describing with pretty names for
records and blocks in addition to numbers. This
enhances llvm-bcanalyzer to use this to print prettily.
llvm-svn: 70165
2009-04-26 22:21:57 +00:00
Chris Lattner
eae2abdfa3
make BitstreamCursor's copyable and assignable.
...
llvm-svn: 70159
2009-04-26 21:07:02 +00:00
Chris Lattner
a43dcba929
Make a major API change to BitstreamReader: split all the reading
...
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-04-26 20:59:02 +00:00
Douglas Gregor
8965c485d7
Allow jumping to the end of a bitstream while reading
...
llvm-svn: 69145
2009-04-15 04:53:47 +00:00
Douglas Gregor
1c83e8d3ec
Fix BitstreamReader's GetCurrentBitNo to return the correct bit number, and stop JumpToBit from covering up its mistakes
...
llvm-svn: 68648
2009-04-08 22:26:47 +00:00
Chris Lattner
12dadd5a5e
Add an API for the bitstream reader to read blobs and return
...
them by reference, instead of packing each byte into a
smallvector.
llvm-svn: 68486
2009-04-07 02:56:46 +00:00
Chris Lattner
bd885be4b0
allow clients to look up abbrev id's
...
llvm-svn: 68471
2009-04-06 22:43:46 +00:00
Chris Lattner
ac7e143979
add a new Blob encoding abbreviation for bitcode files that emits
...
elements in a form that is efficient for the reader to just get a
pointer in memory and start reading. APIs to do efficient reading
and writing are still todo.
llvm-svn: 68465
2009-04-06 21:50:39 +00:00
Chris Lattner
c67eb55ed2
split ReadAbbreviatedLiteral out of ReadAbbreviatedField.
...
llvm-svn: 68463
2009-04-06 21:37:10 +00:00
Chris Lattner
44a17471be
reduce indentation with early-out
...
llvm-svn: 68462
2009-04-06 21:34:58 +00:00
Dan Gohman
770f4158e5
Use CHAR_BIT instead of hard-coding 8 in several places where it
...
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.
llvm-svn: 68227
2009-04-01 18:45:54 +00:00
Misha Brukman
5cfd666bde
Removed trailing whitespace.
...
llvm-svn: 65199
2009-02-20 23:04:06 +00:00
Evan Cheng
d9353009b7
Fix more -Wshorten-64-to-32 warnings.
...
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Ted Kremenek
994b0d4b1a
Fixed potential bug where CurWord is not zeroed out in JumpToBit.
...
llvm-svn: 44469
2007-11-30 22:39:46 +00:00
Ted Kremenek
93329cbed2
Made Deserializer a friend class of BitstreamReader.
...
Moved some of the logic in BitstreamReader::ExitBlock into a utility function
BitstreamReader::PopBlockScope. The latter is a private method. It will also
be called by Deserializer to manipulate the current "block scope."
llvm-svn: 43972
2007-11-10 02:00:38 +00:00
Hartmut Kaiser
b72a8fcf9c
Silenced a VC++ warning.
...
llvm-svn: 43276
2007-10-24 00:06:31 +00:00
Chris Lattner
37779a0b4c
we aren't at the end of stream until we've consumed all the bytes AND all
...
the bits in those bytes.
llvm-svn: 36861
2007-05-06 08:12:09 +00:00
Jeff Cohen
0b108b4f29
Make code more 64-bit aware.
...
llvm-svn: 36833
2007-05-06 03:24:19 +00:00
Jeff Cohen
ce844b2aaa
Unbreak VC++.
...
llvm-svn: 36831
2007-05-06 03:12:47 +00:00
Chris Lattner
2753e54f7b
Fix a subtle bug that prevented round-tripping 470.lbm
...
llvm-svn: 36825
2007-05-06 01:43:38 +00:00
Chris Lattner
7d16cb364d
minor bugfix
...
llvm-svn: 36777
2007-05-05 07:20:34 +00:00
Chris Lattner
cedc5577f2
add a 6-bit encoding type for strings.
...
llvm-svn: 36770
2007-05-05 01:15:42 +00:00
Chris Lattner
eca2bb1334
Implement support for globally associating abbrevs with block IDs, which
...
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 :)
llvm-svn: 36767
2007-05-05 00:17:00 +00:00
Chris Lattner
75b84adf6b
add support for array abbreviations.
...
llvm-svn: 36754
2007-05-04 20:33:47 +00:00
Chris Lattner
4e0c6003b7
minor cleanups. Add provisions for a new standard BLOCKINFO_BLOCK
...
block type.
llvm-svn: 36748
2007-05-04 18:25:49 +00:00
Chris Lattner
f0086ffafa
refcount BitCodeAbbrev objects
...
llvm-svn: 36747
2007-05-04 17:35:19 +00:00
Chris Lattner
21e0d64a6e
several bitfixes to JumpToBit
...
llvm-svn: 36616
2007-05-01 05:51:32 +00:00
Chris Lattner
eb2a5f5f99
add JumpToBit, an explicit init method, and a default ctor.
...
llvm-svn: 36613
2007-05-01 04:59:06 +00:00
Chris Lattner
31d1dec66d
add some helpers
...
llvm-svn: 36580
2007-04-29 21:49:05 +00:00
Chris Lattner
8a40d39a8e
compute this value correctly
...
llvm-svn: 36575
2007-04-29 19:49:58 +00:00
Chris Lattner
d61ccde429
add a method
...
llvm-svn: 36571
2007-04-29 19:17:32 +00:00
Chris Lattner
8308e85781
make this file self-contained
...
llvm-svn: 36555
2007-04-29 08:05:07 +00:00
Chris Lattner
193294e642
implement reading of abbrevs
...
llvm-svn: 36366
2007-04-23 18:57:58 +00:00
Chris Lattner
5510ac5a56
first part of implementation of abbrevs. The writer isn't fully there yet and the
...
reader doesn't handle them at all yet.
llvm-svn: 36363
2007-04-23 16:04:05 +00:00
Reid Spencer
bcf9c262e7
Terminate with newline.
...
llvm-svn: 36345
2007-04-22 16:31:22 +00:00
Jeff Cohen
2cf2830f4d
Teach Visual Studio about Bitcode.
...
llvm-svn: 36341
2007-04-22 15:00:52 +00:00
Chris Lattner
97852839f7
Define the content-independent interfaces to read/write bitcode files and
...
the high-level interface to read/write LLVM IR bitcode files.
This is a work in progress.
llvm-svn: 36329
2007-04-22 06:22:05 +00:00