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

441 Commits

Author SHA1 Message Date
Reid Spencer
7d9cba7a0f Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Misha Brukman
a31e841080 Fix doxygen comment
llvm-svn: 16542
2004-09-28 16:57:46 +00:00
Chris Lattner
047daf6261 The system ranlib on darwin occasionally adds two extra newlines to the
end of files, breaking the CFE build.  As a gross hack around this,
ignore any trailing garbage on bytecode files.  Thanks to Brian for digging
in and identifying the problem.

llvm-svn: 16525
2004-09-27 16:59:06 +00:00
Reid Spencer
c6a8d70cff Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!

llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Misha Brukman
e0998a1df8 Unbreak doxygen, according to Reid.
llvm-svn: 16298
2004-09-12 20:56:38 +00:00
Misha Brukman
7554de4ba6 Fix code spacing/alignment
llvm-svn: 16297
2004-09-12 20:47:33 +00:00
Reid Spencer
378bdcd409 Change interface to use correct typedef so it will always compile.
llvm-svn: 16281
2004-09-11 04:22:58 +00:00
Reid Spencer
f0bec2fe30 Print the dependent libraries when dumping bytecode.
llvm-svn: 16275
2004-09-11 04:14:07 +00:00
Alkis Evlogimenos
0c50e0f211 Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!

llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
1233a0885a Correctly compute the number of compaction tables.
llvm-svn: 16064
2004-08-27 00:43:51 +00:00
Reid Spencer
54503bf00a Prevent an empty compaction table from being written to the bytecode file.
llvm-svn: 16063
2004-08-27 00:38:44 +00:00
Reid Spencer
6f0fa9867f Add the CompactionTableIsEmpty function so that we can determine if a
CompactionTable really needs to be emitted. This is not a straight forward
computation, hence the need for a member function here.

llvm-svn: 16062
2004-08-26 22:32:00 +00:00
Reid Spencer
2d1ee6c0d5 Add a wrapper for extraction of the dependent libraries from a bytecode
file.

llvm-svn: 16037
2004-08-24 22:46:20 +00:00
Reid Spencer
4691dfb9ba Rearrange output a little to make it nicer.
llvm-svn: 16036
2004-08-24 22:45:32 +00:00
Reid Spencer
d7d70bdccb Bytecode Analyzer Cleanup:
- Rearrange output order to make more sense
- Make only the function level output count as "detailed"
- Output dump output directly to stream, don't buffer it.
- Fix counting of block sizes
- Implement new handlers for number of types, dependent libs, target triple
- Compute the size of block headers.

llvm-svn: 15985
2004-08-21 20:58:19 +00:00
Reid Spencer
4c9c991659 Get rid of an extraneous local variable.
llvm-svn: 15984
2004-08-21 20:53:56 +00:00
Reid Spencer
84d4e1b105 Two Changes:
- Pass the output stream to the analyzer so it can write its output there
  directly instead of buffering it.
- Don't pass a boolean to ParseBytecode because its not needed any more.

llvm-svn: 15983
2004-08-21 20:52:03 +00:00
Reid Spencer
c0868628e0 Add boolean file format flags in preparation for version 5 bytecode.
Remove the "processFunctions" boolean from ParseBytecode as it is no
longer needed. This is part of avoiding double reading of functions
when analyzing bytecode.

llvm-svn: 15982
2004-08-21 20:50:49 +00:00
Reid Spencer
09976167c1 Bytecode Reader Cleanup:
- provide the correct conversion for ModuleBlockID in read_block (a potential
  bug but not actually exploited because reading module block ids doesn't
  use read_block).
- install support for handleTypeList handler
- install support for handleDependentLibrary handler
- install support for handleTargetTriple handler
- clean up comments, output strings,
- ensure that processing function arguments doesn't SIGSEGV if one of the
  arguments is a null pointer (yeah, it happened .. weird)
- prepare for version 5 bytecode by documenting what will change.

llvm-svn: 15981
2004-08-21 20:49:23 +00:00
Brian Gaeke
01636f4e0f Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Reid Spencer
90f77c960f Bytecode File Format Changes:
- File format version number bumped to 4
- Writer will now align nothing
- Reader now only expects alignment for version 3 or earlier

llvm-svn: 15875
2004-08-17 07:45:14 +00:00
Reid Spencer
f0067ed08d Correct the comments in the symbol table writer to reflect reality.
llvm-svn: 15848
2004-08-17 02:59:02 +00:00
Reid Spencer
bc04b0b4b5 Turn a use of intptr_t into a reinterpret_cast<uint64_t> instead to get
rid of compilation warnings on some platforms.

llvm-svn: 15512
2004-08-04 22:56:46 +00:00
Alkis Evlogimenos
f853362a44 Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Chris Lattner
21a0243ceb Make getGlobalTableValue not use getTypeSlot, this speeds up the bc reader
by 5% on eon

llvm-svn: 15452
2004-08-04 00:19:23 +00:00
Chris Lattner
7c4828adaf Do not do a linear std::find to reconstruct information we had, but later threw
away.  This speeds up by .bc reader by 30% in a profile build on 252.eon.

llvm-svn: 15450
2004-08-03 23:41:28 +00:00
Alkis Evlogimenos
fb27f702ca Merge i*.h headers into Instructions.h as part of bug403.
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Chris Lattner
60e918e115 Simplify code and silence warning
llvm-svn: 15255
2004-07-27 02:34:49 +00:00
Chris Lattner
e643adb9e5 Fix a serious bug in the double constant reader. In particular, because
(At[3] << 24) is an int type and it is being coerced to uint64_t, it was
getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of
the time.

llvm-svn: 15224
2004-07-25 23:15:44 +00:00
Reid Spencer
5aeeecb218 Always write FP values correctly.
Adjust for new Module.h interface for dependent libraries.
Excise unused backwards compatibility flag.

llvm-svn: 15220
2004-07-25 21:36:26 +00:00
Reid Spencer
bf99424415 Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2

llvm-svn: 15219
2004-07-25 21:32:51 +00:00
Reid Spencer
1bf4f4f9e1 Adjust to new Module.h interface for dependent libraries.
llvm-svn: 15218
2004-07-25 21:32:02 +00:00
Reid Spencer
3043e82af5 bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
  in multiples of 64KByte chunks rather than in multiples of some smaller
  (default) number.

llvm-svn: 15210
2004-07-25 18:07:36 +00:00
Reid Spencer
b339652b44 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14942
2004-07-18 00:18:30 +00:00
Reid Spencer
f460e10236 bug 122:
- Correct ordering of tests because for GlobalValue isa Constant

llvm-svn: 14941
2004-07-18 00:16:21 +00:00
Reid Spencer
4cb4f5f488 User ValueListTy as the type of the ValueList. This avoides the ValueList
from being treated like a Function which can cause the contents of the list
to be come invalidated.

llvm-svn: 14940
2004-07-18 00:13:12 +00:00
Reid Spencer
99ac617179 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14939
2004-07-18 00:12:03 +00:00
Reid Spencer
b320f8eb03 bug 122:
- Update for BytecodeHandler interface change resuing from CPRs going away

llvm-svn: 14938
2004-07-18 00:10:36 +00:00
Chris Lattner
47c6a06211 Fix for PR341
llvm-svn: 14845
2004-07-15 02:40:04 +00:00
Brian Gaeke
d8746a7ab6 Actually set the endian/pointersize flags on the module being read in!
llvm-svn: 14826
2004-07-14 20:33:13 +00:00
Brian Gaeke
f6ec78a335 Fix warning on SparcV9, where sizeof (int) != sizeof (void *).
llvm-svn: 14786
2004-07-13 07:37:43 +00:00
Chris Lattner
9fc90f37fd Fix unused var warning
llvm-svn: 14775
2004-07-12 20:29:52 +00:00
Reid Spencer
c6bdf47e72 Various cleanups:
- Remove tabs
- Standardize use of space around ( and ).
- Consolidate the ConstantPlaceHolder class
- Rename two methods to be more meaningful (ParseType, ParseTypes)
- Correct indentation of blocks
- Add documentation
- Convert input dependent asserts to error(...) so it throws instead.
Provide placeholder implementations of read_float and read_double that
still read in platform-specific endianess. When I figure out how to do
this without knowing the endianess of the platform, it will get implemented
correctly.

llvm-svn: 14765
2004-07-11 17:28:43 +00:00
Reid Spencer
1d6847c22e - Rename two methods to give them more meaning
- Add read_float and read_double in preparation for a correct
  implementation of bytecode floating point support.

llvm-svn: 14764
2004-07-11 17:24:05 +00:00
Reid Spencer
af6625347f Remove tabs.
llvm-svn: 14763
2004-07-11 17:22:51 +00:00
Reid Spencer
1a22913bac Prepare the writer for a non-broken implementation of writing floating
point values. This will be fixed when I figure out how to do it correctly
without depending on knowing the endianess of a platform.

llvm-svn: 14762
2004-07-11 17:22:07 +00:00
Reid Spencer
27a5454cf0 Make the VBRSavings percentage make sense (as a fraction of the total
expanded size instead of the file size). Thanks Chris.

llvm-svn: 14731
2004-07-10 08:04:13 +00:00
Reid Spencer
20dc3903a6 Error Handling Cleanup:
- get rid of PARSE_ERROR macro
- add error(std::string) function
- use error(std::string) for all errors
- make input dependent asserts call error(std::string) instead
- ensure asserts are only for logic bugs, not input discrepancies.

llvm-svn: 14729
2004-07-09 22:21:33 +00:00
Reid Spencer
d38042c423 Fix a backwards compatibility bug found by Tanya. In version 1.2, the
global type plane starts with a length and the TypeTyID value to identify
the type plane has having type definitions. This doesn't happen in 1.3
because the types are read from a known position in the file. However, the
TypeTyID must be read in (and ignored) if its a 1.2 bytecode file.

llvm-svn: 14728
2004-07-09 21:13:53 +00:00
Reid Spencer
3e8a01d80f Remove definition and use of OtherVal enumerator. This just fixes a thinko.
llvm-svn: 14634
2004-07-06 01:30:36 +00:00
Reid Spencer
4d7e02d657 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.

llvm-svn: 14627
2004-07-05 00:57:50 +00:00
Reid Spencer
373ae97a58 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.

llvm-svn: 14612
2004-07-04 11:47:22 +00:00
Reid Spencer
3c5a47177e Remove Tabs.
llvm-svn: 14611
2004-07-04 11:46:15 +00:00
Reid Spencer
bd058052d9 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.

llvm-svn: 14610
2004-07-04 11:45:47 +00:00
Reid Spencer
ae9ac3dcc5 Add new methods outputTypes and outputCompactionTypes for handling Types
separately from Values. This needed for bug 122.

llvm-svn: 14609
2004-07-04 11:44:27 +00:00
Reid Spencer
f15d7739d1 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.

llvm-svn: 14608
2004-07-04 11:42:49 +00:00
Reid Spencer
50fc2ffa25 - Type::TypeTyID doesn't exist any more (bug 122)
- Types don't have names any more, just write them on ostream directly

llvm-svn: 14606
2004-07-04 11:37:54 +00:00
Reid Spencer
37b31cbcba Move SlotCalculator.h to lib/Bytecode/Writer since that is the only place
that needs it after the Type != Value changes (bug 122).

llvm-svn: 14605
2004-07-04 11:36:31 +00:00
Reid Spencer
58d99835c3 - 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.

llvm-svn: 14604
2004-07-04 11:33:49 +00:00
Reid Spencer
1ed71ecc7c - 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.

llvm-svn: 14602
2004-07-04 11:04:56 +00:00
Reid Spencer
1b40b59651 Remove tabs. Move function declaration to Reader.h where it belongs.
llvm-svn: 14601
2004-07-04 11:03:03 +00:00
Reid Spencer
b342d41159 Add #include <iostream> which is needed now that Value.h doesn't include it
llvm-svn: 14600
2004-07-04 11:01:27 +00:00
Reid Spencer
43f703a636 Excise tabs.
llvm-svn: 14599
2004-07-04 11:00:39 +00:00
Reid Spencer
d15e874bb7 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

llvm-svn: 14496
2004-06-29 23:32:41 +00:00
Reid Spencer
b8b9962dd1 This is a slimming down of the previous ReaderInternals.h that just
declares the BytecodeReader class.

llvm-svn: 14495
2004-06-29 23:31:01 +00:00
Reid Spencer
401a9df238 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.

llvm-svn: 14494
2004-06-29 23:29:38 +00:00
Reid Spencer
e0ce1743c6 Adjustments to allow Bytecode Reading to support the BytecodeHandler
interface which is called by the reader if a BytecodeHandler is provided.

llvm-svn: 14493
2004-06-29 23:24:14 +00:00
Reid Spencer
61cff86f35 Merge Dumper.cpp and AnalyzerWrappers.cpp into this file. Also, adjust the
dumping facility to produce useful output.

llvm-svn: 14492
2004-06-29 23:23:12 +00:00
Reid Spencer
21cbc878d9 Analyzer moved to ../Reader directory.
llvm-svn: 14491
2004-06-29 23:21:53 +00:00
Reid Spencer
976bae4918 Remove newly defunct Analyzer directory.
llvm-svn: 14490
2004-06-29 23:21:16 +00:00
Chris Lattner
2c7b54fea3 No functionality changes here:
* Some warning fixes for MSVC
  * Minor simplification to the deque scanning code

llvm-svn: 14417
2004-06-25 20:52:10 +00:00
Chris Lattner
33ebfe4339 Fix more warnings building with VC++
llvm-svn: 14391
2004-06-25 00:35:55 +00:00
Chris Lattner
6198a05b01 fix warnings
llvm-svn: 14388
2004-06-25 00:11:25 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Reid Spencer
efdd7cd3ac Implement tracking of bytecode instruction size and the number of long
instructions generated.

llvm-svn: 14154
2004-06-11 15:10:38 +00:00
Reid Spencer
7172b26a18 Revert an unneeded interface change to Instruction.h
llvm-svn: 14137
2004-06-11 03:06:43 +00:00
Reid Spencer
35e67bbc91 Remove tabs.
llvm-svn: 14123
2004-06-10 22:03:00 +00:00
Reid Spencer
024d735433 Implement detailed function level data collection and reporting.
llvm-svn: 14122
2004-06-10 22:00:54 +00:00
Reid Spencer
4a21e2053a Adjust prototypes to new Handler interface.
llvm-svn: 14121
2004-06-10 22:00:29 +00:00
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