Commit Graph

381 Commits

Author SHA1 Message Date
Reid Spencer
ba466362c4 Remove definition and use of OtherVal enumerator. This just fixes a thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14634 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 01:30:36 +00:00
Reid Spencer
5c15fe5cf8 Finalize bytecode dumping. The "handleFinish" method was getting called
too soon so the function data was not getting dumped (it was generated
after the call handleFinish). Also cleaned up the output format for
proper indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14627 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-05 00:57:50 +00:00
Reid Spencer
d57da4b27d Implementation of SlotTable went into header file. Note that this header
is currently not being used but is retained because it will be the basis
for a clean up of the SlotCalculator class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14612 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:47:22 +00:00
Reid Spencer
0852c80e38 Remove Tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14611 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:46:15 +00:00
Reid Spencer
cb3595c3d1 Implement new output functions for types and compacted type planes. Also
remove use of Type::TypeTyID and Type::TypeTy since Type no longer inherits
Value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14610 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:45:47 +00:00
Reid Spencer
d1fb1b7440 Add new methods outputTypes and outputCompactionTypes for handling Types
separately from Values. This needed for bug 122.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14609 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:44:27 +00:00
Reid Spencer
24ab28f1e5 For bug 122:
Separate Types from Values because Type no longer inherits from Value. The
changes for this are too numerous to list. In essence, any data structure
that contained a Value was doubled so that Types could be contained
similarly. New members include Types, TypeMap, CompactionTypes, and
CompactionTypeMap. Functions taking a Value* were overloaded with a variant
that takes a Type* that acts on the new data structures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14608 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:42:49 +00:00
Reid Spencer
5e394ff01b - Type::TypeTyID doesn't exist any more (bug 122)
- Types don't have names any more, just write them on ostream directly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14606 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:37:54 +00:00
Reid Spencer
04cde2ce59 - Don't use macros to call the BytecodeHandler
- Don't use PARSE_ERROR macro unnecessarily (for simple strings)
- Add comments before each function
- Convert for bug 122 (Type != Value)
- Handle new value range on Type::PrimitiveTypeId enumeration by augmenting
  the reader with a new read_typeid method and sanitizeTypeId method.
- Remove BytecodeHandler's default method implementations to header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14604 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:33:49 +00:00
Reid Spencer
a86159cd4b - Make ValueList an "OtherVal" user of Values to ensure it doesn't get
mistaken for anything else.
- Move function descriptions to Reader.cpp file per Chris.
- Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14602 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:04:56 +00:00
Reid Spencer
97c7d74d04 Remove tabs. Move function declaration to Reader.h where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14601 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:03:03 +00:00
Reid Spencer
77cf296c5d Add #include <iostream> which is needed now that Value.h doesn't include it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14600 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:01:27 +00:00
Reid Spencer
b61cdb7f10 Excise tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14599 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:00:39 +00:00
Reid Spencer
0692dbfa10 Remove files no longer needed. ConstantReader and InstructionReader were
integrated into Reader. Parser.* was just a bad idea. AnalyzerInternals.h
is no longer needed. ReaderPrimitives.h was integrated into Reader.h and
Reader.cpp. Dumper.cpp was integrated into Analyzer.cpp. ReaderInternals.h
became Reader.h. AnalyzerWrappers.cpp was integerated into
ReaderWrappers.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14496 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:32:41 +00:00
Reid Spencer
f89143c7de This is a slimming down of the previous ReaderInternals.h that just
declares the BytecodeReader class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14495 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:31:01 +00:00
Reid Spencer
060d25d1dc MAJOR REWRITE.
- stop passing Buf/BufEnd to every function (now member vars)
- internalize things that used to be in a header file that no one else
  included/needed.
- Remove defunct BCR_TRACE lines
- Standardize error handling with the PARSE_ERROR macro.
- Integrate ConstantReader.cpp and InstructionReader.cpp and reorgnize
  the definition order so that gcc has a chance at optimizing this module
- Standardize case and style of method names.
- Eliminate unneeded header files
- Prepare for Type != Value (bug122) change by splitting Types into their
  own data structures.
- Implement the BytecodeHandler interface calls.
- Provide default implementation of BytecodeHandler interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14494 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:29:38 +00:00
Reid Spencer
df45a5485d Adjustments to allow Bytecode Reading to support the BytecodeHandler
interface which is called by the reader if a BytecodeHandler is provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14493 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:24:14 +00:00
Reid Spencer
f41aa7397c Merge Dumper.cpp and AnalyzerWrappers.cpp into this file. Also, adjust the
dumping facility to produce useful output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14492 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:23:12 +00:00
Reid Spencer
cc1091e66b Analyzer moved to ../Reader directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14491 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:21:53 +00:00
Reid Spencer
46bd33f336 Remove newly defunct Analyzer directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14490 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:21:16 +00:00
Chris Lattner
036de03128 No functionality changes here:
* Some warning fixes for MSVC
  * Minor simplification to the deque scanning code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14417 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 20:52:10 +00:00
Chris Lattner
d61622857f Fix more warnings building with VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14391 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:35:55 +00:00
Chris Lattner
32b588039e fix warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14388 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:11:25 +00:00
Chris Lattner
f70c22b019 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:19:28 +00:00
Reid Spencer
1cf5024de1 Implement tracking of bytecode instruction size and the number of long
instructions generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14154 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 15:10:38 +00:00
Reid Spencer
8a9a3706ff Revert an unneeded interface change to Instruction.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 03:06:43 +00:00
Reid Spencer
7c7680a14e Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14123 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:03:00 +00:00
Reid Spencer
cbb22e218e Implement detailed function level data collection and reporting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14122 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:00:54 +00:00
Reid Spencer
2467a06057 Adjust prototypes to new Handler interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14121 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:00:29 +00:00
Reid Spencer
ab5fce2299 Make the parser deal with functions instead of just function types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14120 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 21:59:20 +00:00
Reid Spencer
8d131d1fec Doxygenize a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14115 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 08:27:00 +00:00
Reid Spencer
00c28a7481 Implemented the bulk of the functionality. Cleaned up the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 08:09:13 +00:00
Reid Spencer
525f228d95 Cleanup alignment of output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14093 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:22:00 +00:00
Reid Spencer
edc3b582ae Implement analysis output. Don't dump function details unless requested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:17:58 +00:00
Reid Spencer
649ee57b1d Implement some rudimentary analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14090 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:16:43 +00:00
Reid Spencer
0545b3e673 Clean up indentation of file body output.
Don't dump functions unless "detailedResults" is requested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:16:19 +00:00
Reid Spencer
a670c414f7 Move parsing details to Parser.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:15:21 +00:00
Reid Spencer
926572c478 Bring some things out of header files that belong only in this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:14:52 +00:00
Reid Spencer
6269ded8ee Cleaned up a dead header file to prevent duplicate definition warnings
in doxygen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 04:38:34 +00:00
Reid Spencer
5e8868d2a3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14057 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:54:47 +00:00
Reid Spencer
b7041b0c43 Make it #include Parser.h instead of AnalyzerInternals.h since it only
needs the BytecodeHandler interface which is now in Parser.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14056 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:53:14 +00:00
Reid Spencer
aee4f5bbfd Adjust what's included to compensate for changes in Parser.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:52:29 +00:00
Reid Spencer
29dba0ceea 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:51:18 +00:00
Reid Spencer
dac69c83c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-07 17:53:43 +00:00
Chris Lattner
fb777c270b Use the new FileUtilities.h API for mapping a file into an address
space


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 00:24:41 +00:00
Reid Spencer
6ed81e253c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 20:18:51 +00:00
Reid Spencer
798ff64328 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-26 07:37:11 +00:00
Reid Spencer
6b1f58b6a4 Put SlotTable.h inclusion back at front of list to be coding standards
compliant. Thanks, Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13771 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 20:09:05 +00:00
Reid Spencer
a85b8cf110 Make the constructor explicit so we can't implicitly convert bool to
SlotTable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13766 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 19:09:25 +00:00
Reid Spencer
3751bd607b Make some improvements suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 19:03:21 +00:00