1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

311 Commits

Author SHA1 Message Date
Reid Spencer
11466e62a7 Make the parser deal with functions instead of just function types.
llvm-svn: 14120
2004-06-10 21:59:20 +00:00
Reid Spencer
4dcaebd069 Doxygenize a comment.
llvm-svn: 14115
2004-06-10 08:27:00 +00:00
Reid Spencer
ce1adf1ff0 Implemented the bulk of the functionality. Cleaned up the code.
llvm-svn: 14113
2004-06-10 08:09:13 +00:00
Reid Spencer
8bb8138b54 Cleanup alignment of output.
llvm-svn: 14093
2004-06-09 06:22:00 +00:00
Reid Spencer
aa5110231e Implement analysis output. Don't dump function details unless requested.
llvm-svn: 14091
2004-06-09 06:17:58 +00:00
Reid Spencer
ca3bcbc07b Implement some rudimentary analysis.
llvm-svn: 14090
2004-06-09 06:16:43 +00:00
Reid Spencer
49f1f6f4c4 Clean up indentation of file body output.
Don't dump functions unless "detailedResults" is requested.

llvm-svn: 14089
2004-06-09 06:16:19 +00:00
Reid Spencer
b3f8b06dfc Move parsing details to Parser.cpp.
llvm-svn: 14088
2004-06-09 06:15:21 +00:00
Reid Spencer
d2e7399ba0 Bring some things out of header files that belong only in this file.
llvm-svn: 14087
2004-06-09 06:14:52 +00:00
Reid Spencer
323cc6283d Cleaned up a dead header file to prevent duplicate definition warnings
in doxygen.

llvm-svn: 14084
2004-06-09 04:38:34 +00:00
Reid Spencer
7495cebbb1 Fix the bug that was preventing the parser from working on all bytecode
files. It was reading non-initialized global vars when the flag said it was
initialized and vice versa. Causes mis-alignment since initialized and
non-initialized constants have different bytecode lengths.

llvm-svn: 14057
2004-06-08 05:54:47 +00:00
Reid Spencer
17fdffaf33 Make it #include Parser.h instead of AnalyzerInternals.h since it only
needs the BytecodeHandler interface which is now in Parser.h

llvm-svn: 14056
2004-06-08 05:53:14 +00:00
Reid Spencer
596ef471a8 Adjust what's included to compensate for changes in Parser.h
llvm-svn: 14055
2004-06-08 05:52:29 +00:00
Reid Spencer
9cdb71239e Merged BytecodeHandler.h into Parser.h since the parser and the handler
must always coexist. Cleaned up the documentation on these interfaces
significantly. This is in preparation for moving Parser.h to the include
directories to make it a public interface.

llvm-svn: 14054
2004-06-08 05:51:18 +00:00
Reid Spencer
329505d08b Commit For New Tool: llvm-abcd (Analysis of ByteCode Dumper). This tool
will (eventually) provide statistical analysis of bytecode files as well
as the ability to dump them in a low level format (slot numbers not
resolved). The purpose of this is to aid in the Type!=Value change of
bug 122. With this initial release, llvm-abcd merely dumps out the
bytecode. However, the infrastructure for separating bytecode parsing from
handling the parsing events is in place. The style chosen is similar to
SAX XML parsing where a handler object is called to handlign the parsing
events. This probably isn't useful to anyone but me right now as there is
no analysis yet, and the dumper doesn't work on every bytecode file. It
will probably be useful by the end of this week. Note that there is some
duplication of code from the bytecode reader.  This was done to eliminate
errors from being introduced in the reader and to minimize the impact to
other LLVM developers. At some point, the Analyzer and the Reader will be
integrated to use the same infrastructure. Also, sorry for the minor change
to Instruction.h but I just couldn't bring myself to write code that
depends on Instruction internals.

llvm-svn: 14048
2004-06-07 17:53:43 +00:00
Reid Spencer
00aca582a2 Moved this file to lib/Bytecode/Writer because its used there only.
llvm-svn: 13900
2004-05-30 00:09:32 +00:00
Chris Lattner
61876bd662 Use the new FileUtilities.h API for mapping a file into an address
space

llvm-svn: 13864
2004-05-28 00:24:41 +00:00
Reid Spencer
b2939fc651 Use the SymbolTable::isEmpty() method instead of checking for no value
planes. A SymbolTable could still have types in it! This fixes problems
with two regression tests that failed because a symbol table that only
contained types was being omitted from bytecode files. Thanks to Chris
for the reduced test case that helped find this immediately.

llvm-svn: 13842
2004-05-27 20:18:51 +00:00
Reid Spencer
dccf1747a1 Part of bug 122:
This change removes the BuildBytecodeInfo flag from the SlotCalculator
class. This flag was needed to distinguish between the Bytecode/Writer
and the AsmWriter. Now that AsmWriter doesn't use SlotCalculator, we can
remove this flag and simplify some code. Also, some minor name changes
to CachedWriter.h needed to be committed (missed in previous commit).

llvm-svn: 13785
2004-05-26 07:37:11 +00:00
Reid Spencer
96fe333298 Put SlotTable.h inclusion back at front of list to be coding standards
compliant. Thanks, Chris.

llvm-svn: 13771
2004-05-25 20:09:05 +00:00
Reid Spencer
8e6d7148c1 Make the constructor explicit so we can't implicitly convert bool to
SlotTable.

llvm-svn: 13766
2004-05-25 19:09:25 +00:00
Reid Spencer
dc5f9c805c Make some improvements suggested by Chris.
llvm-svn: 13765
2004-05-25 19:03:21 +00:00
Reid Spencer
92adcaf58c Adding the initial implementation of the SlotTable class. This class is
the Abstract Data Type that holds slot number values and associates them
with Type* and Value*. The SlotTable is simply the holder of the slot
numbers and provides a controlled interface for building the table. It does
not enforce any particular idiom or functionality for manipulating the slot
numbers.

This is part of bug_122. The SlotCalculator and SlotMachine classes will
follow.

llvm-svn: 13764
2004-05-25 18:44:51 +00:00
Reid Spencer
0e78929263 Changed to use SymbolTable's new iteration interfaces.
llvm-svn: 13759
2004-05-25 17:29:59 +00:00
Misha Brukman
fad1a41fce Squelch compile-time warning (profile build).
llvm-svn: 13228
2004-04-28 15:32:09 +00:00
Chris Lattner
cc929742a1 Fix warning building in optimized mode
llvm-svn: 13190
2004-04-27 18:24:38 +00:00
Chris Lattner
ada730740b Implement support for a new LLVM 1.3 bytecode format, which uses uint's
to index into structure types and allows arbitrary 32- and 64-bit integer
types to index into sequential types.

llvm-svn: 12651
2004-04-05 01:27:26 +00:00
Chris Lattner
b25ac02112 Remove a bunch of cruft that was used to be backwards compatible with the last
prerelease format for LLVM bytecode files.  Now we only are compatible with
LLVM 1.0+.

llvm-svn: 12643
2004-04-03 23:43:42 +00:00
Brian Gaeke
4ca49f84ba Use the true, decoded name of the archive member in getObjectType.
In ReadArchiveBuffer, make sure that MemberName is set in the case where
getObjectType would want to return SVR4LongFilename.

llvm-svn: 12567
2004-03-31 19:51:00 +00:00
Chris Lattner
b9cadcfcd9 Add support for reading constantexpr select instructions
llvm-svn: 12563
2004-03-31 02:53:59 +00:00
Chris Lattner
874db50b32 Make error message a bit nicer.
Contributed by Reid Spencer

llvm-svn: 12523
2004-03-29 00:16:01 +00:00
Chris Lattner
c90b157c66 Write select instructions to bytecode
llvm-svn: 12315
2004-03-12 05:52:01 +00:00
Chris Lattner
eb7e5f6d24 Read select instrs from bytecode
llvm-svn: 12314
2004-03-12 05:51:49 +00:00
Chris Lattner
ada23acba4 This debugging hook is no longer needed.
llvm-svn: 11233
2004-02-09 17:20:52 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
a1757d1d91 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
3818f475de Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.

llvm-svn: 11046
2004-02-01 01:50:31 +00:00
Misha Brukman
5723c64d9a Implement ModuleProvider::materializeModule() by only materializing functions
that are still left in the lazy reader map.

llvm-svn: 10944
2004-01-21 22:55:34 +00:00
Chris Lattner
781ed02fce SlotCalculator.h moved
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner
858d41f7d4 Fix PR212 - Bytecode reader misreads 'long -9223372036854775808'!
Fix testcase test/Regression/Assembler/2004-01-20-MaxLongLong.llx

llvm-svn: 10928
2004-01-20 19:13:07 +00:00
Chris Lattner
a509b856f9 Fix bogus warning and simplify code
llvm-svn: 10924
2004-01-20 17:06:29 +00:00
Chris Lattner
85a8d1cc2b Bugfixes for dealing with partially compactified functions
llvm-svn: 10920
2004-01-20 00:54:06 +00:00
Chris Lattner
28e1981c25 Save another 30K from 176.gcc by encoding the compaction table a bit more
intelligently.

llvm-svn: 10918
2004-01-18 22:35:34 +00:00
Chris Lattner
e29a22a76a Remove -debug output
llvm-svn: 10917
2004-01-18 22:26:53 +00:00
Chris Lattner
2258355dda Add support for writing bytecode files with compactiontables for bytecode files.
This shrinks the bytecode file for 176.gcc by about 200K (10%), and 254.gap by
about 167K, a 25% reduction.  There is still a lot of room for improvement in
the encoding of the compaction table.

llvm-svn: 10915
2004-01-18 21:08:52 +00:00
Chris Lattner
5fc855775d Add support for reading bytecode files with compactiontables for bytecode files.
This shrinks the bytecode file for 176.gcc by about 200K (10%), and 254.gap by
about 167K, a 25% reduction.  There is still a lot of room for improvement in
the encoding of the compaction table.

llvm-svn: 10914
2004-01-18 21:08:15 +00:00
Chris Lattner
630c3ddea0 Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes.  This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.

llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner
cce1db873e If these blocks are empty, there is no reason to even emit the bytecode blocks.
This saves about 15K in 176.gcc, coupled with another patch that I'm working on.

llvm-svn: 10889
2004-01-15 21:06:57 +00:00
Chris Lattner
44232deeda ConstantPointerRef's are no longer emitted. This saves 20028 bytes in the
bytecode files when compiling 176.gcc, but more importantly will make it
easier to eliminate CPR's in the future (no new .bc revision will be
required to support them)

llvm-svn: 10884
2004-01-15 18:46:56 +00:00
Chris Lattner
844284aabe Allow bytecode files to refer directly to global values as constants, instead
of forcing them to go through ConstantPointerRef's.  This allows bytecode
files to mirror .ll files, allows more efficient encoding, and makes it easier
to eventually eliminate CPR's.

llvm-svn: 10883
2004-01-15 18:45:25 +00:00