Commit Graph

441 Commits

Author SHA1 Message Date
Chris Lattner
613233230b Fix the regressions my User changes introduced. Apparently some parts of
LLVM make the very reasonable assumption that constant expressions will
have at least one operand! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19943 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 01:11:13 +00:00
Chris Lattner
cad28bd3a0 Adjust to changes in User class and minor changes in instruction ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19894 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:36:19 +00:00
Reid Spencer
0a834720db For PR351:
Remove unix specific code (use of errno and read) from the reader.
Thanks to Jeff Cohen for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-21 07:51:33 +00:00
Reid Spencer
7904c4ffe4 Remove the #include of llvm/Config/unistd.h as it is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19067 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 04:52:04 +00:00
Jeff Cohen
e133721047 Fix problems uncovered by VC++ (first time compiled by VC++)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19056 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 03:23:46 +00:00
Reid Spencer
9153f8f476 For PR351:
Use sys::MappedFile instead of ReadFileIntoAddressSpace and
UnmapFileFromAddressSpace. sys::MappedFile has the nice property that it
cleans up after itself so exception handling can be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18902 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 18:25:27 +00:00
Reid Spencer
1fce09125c Path::get -> Path::toString
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 00:14:15 +00:00
Chris Lattner
389bd04b96 Remove a dead field, make the map go to integer type ID to hash better and
avoid a getType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18691 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 06:19:44 +00:00
Chris Lattner
0aed01d43a Remove #include inadvertently added
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 04:53:17 +00:00
Chris Lattner
c4d6916508 Eliminate this ugly hack. This was put back in when replaceAllUsesOf used
a different algorithm that was extremely inefficient for instructions with
many operands.

This reduces the time of this code snippet from .23s for 176.gcc to 0.03s
in a debug build, which speeds up total llvm-dis time just barely.

It's more of a code cleanup than a speedup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 04:51:50 +00:00
Reid Spencer
3c39127b72 Provide more information in the error message that occurs when there are
unresolved constants remaining.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18502 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04 22:19:53 +00:00
Chris Lattner
02dce169c8 Do not allow bytecode files with unresolved references to be read. Doing
so lets wierd ConstantPlaceholder objects sneak into the system which
confuses it greatly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18487 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04 05:28:27 +00:00
Chris Lattner
3af4b4fe78 RevisionNum is read by error(), initialize it early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 16:58:18 +00:00
Reid Spencer
93ee7dc430 Fix a comment to imply the correct semantics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18097 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 02:58:47 +00:00
Chris Lattner
638c381ef7 Add note that this is for old bytecode files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17991 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 16:24:05 +00:00
Reid Spencer
5a88578249 Per code review:\
* Get rid of memory leaks on exception \
* Provide better comments of how the memory handling works


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17876 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:41:05 +00:00
Chris Lattner
97fbc500a7 Use a per-function flag bit to indicate whether or not there is a function
body for the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17858 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 22:38:52 +00:00
Chris Lattner
3bdad6923e Make *SURE* to null out the pointer before throwing an exception, otherwise
the dtor for the BytecodeReader class will try to free it again!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:55:33 +00:00
Chris Lattner
1992522abd Cleanups. Null out pointer after freeing it for paranoia
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17855 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:55:06 +00:00
Chris Lattner
18549c25d6 Make functions default to having external linkage if they have no
FunctionBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:43:03 +00:00
Reid Spencer
766b793143 Changes necessary to enable linking of archives without LLVM symbol tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17811 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 01:20:11 +00:00
Reid Spencer
ce2bc2b28f Moved to lib/Bytecode/Archive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17800 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:38:32 +00:00
Reid Spencer
565ff3d448 Add wrappers to get defined symbols from bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17770 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:00:48 +00:00
Reid Spencer
d3539b8a5e Simplify handling of decompression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17769 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:00:09 +00:00
Reid Spencer
61aaf2e0af Simplify decompression code by using the high level interface to the Compressor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17768 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 21:59:21 +00:00
Misha Brukman
a3e6ad62f3 Mark an unmaterialized function as having GhostLinkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17748 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 21:02:55 +00:00
John Criswell
b5810282ee Recognize compressed LLVM bytecode files.
This should fix the problem of not being able to link compressed LLVM
bytecode files from LLVM libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17648 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-09 19:37:07 +00:00
Reid Spencer
f0c977cbac * Comments & cleanup per CL code review.
* Accept 'llvc' as signature for compressed bytecode


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17579 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07 18:20:55 +00:00
Reid Spencer
36eea80616 Add comments per CL code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17578 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07 18:19:00 +00:00
Reid Spencer
17f52c5c46 Add support for compressed bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17535 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06 23:17:23 +00:00
Reid Spencer
2bcfcbe795 Implement the GetBytecodeSymbols interface function to extract just the
externally visible defined symbols from a bytecode file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17503 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06 08:56:40 +00:00
Reid Spencer
06aada9ebd Fix library name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17305 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 05:32:01 +00:00
Reid Spencer
cac731ecbe We won't use automake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 03:35:04 +00:00
Reid Spencer
86d341b204 Initial automake generated Makefile template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 23:55:41 +00:00
Chris Lattner
2e7ec128f9 Do not erroneously accept revision 6 bytecode files when the format hasn't
been defined yet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17063 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:56:02 +00:00
Chris Lattner
a79e7cca0d Add support for undef, unreachable, and function flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:18:16 +00:00
Chris Lattner
4a8167fe5c Don't print a bunch of metrics that are meaningless for external functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17017 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-15 19:40:31 +00:00
Chris Lattner
1c765b0037 Fit to 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16964 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-14 01:49:34 +00:00
Chris Lattner
4a242b32f6 Fit in 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16962 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-14 01:39:18 +00:00
Reid Spencer
d96cb6eaa0 Update to reflect changes in Makefile rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16950 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-13 11:46:52 +00:00
Reid Spencer
9f41a5fe85 Initial version of automake Makefile.am file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-10 20:43:57 +00:00
Misha Brukman
44666b15b1 Fix doxygen comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16542 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 16:57:46 +00:00
Chris Lattner
56bc894d06 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16525 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-27 16:59:06 +00:00
Reid Spencer
2da5c3dda6 Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-15 17:06:42 +00:00
Misha Brukman
5adf0ca0b2 Unbreak doxygen, according to Reid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16298 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-12 20:56:38 +00:00
Misha Brukman
7df0074db5 Fix code spacing/alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16297 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-12 20:47:33 +00:00
Reid Spencer
46a981c3e2 Change interface to use correct typedef so it will always compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-11 04:22:58 +00:00
Reid Spencer
3ee8eed034 Print the dependent libraries when dumping bytecode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-11 04:14:07 +00:00
Alkis Evlogimenos
20aa474f8f Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-03 18:19:51 +00:00
Reid Spencer
551ccae044 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/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Reid Spencer
488d73a8b7 Correctly compute the number of compaction tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-27 00:43:51 +00:00
Reid Spencer
e0cf59e52f Add a wrapper for extraction of the dependent libraries from a bytecode
file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16037 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-24 22:46:20 +00:00
Reid Spencer
3120e714e6 Rearrange output a little to make it nicer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-24 22:45:32 +00:00
Reid Spencer
911ec6d1c0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15985 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:58:19 +00:00
Reid Spencer
af073bdee6 Get rid of an extraneous local variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15984 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:53:56 +00:00
Reid Spencer
4542c43761 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15983 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:52:03 +00:00
Reid Spencer
572c256519 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15982 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:50:49 +00:00
Reid Spencer
5b472d9879 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15981 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:49:23 +00:00
Brian Gaeke
715c90ba52 Packed types, brought to you by Brad Jones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 06:00:58 +00:00
Reid Spencer
38d54be85b 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 07:45:14 +00:00
Reid Spencer
9a7e0c5366 Turn a use of intptr_t into a reinterpret_cast<uint64_t> instead to get
rid of compilation warnings on some platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15512 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 22:56:46 +00:00
Chris Lattner
2c6c14d1a5 Make getGlobalTableValue not use getTypeSlot, this speeds up the bc reader
by 5% on eon


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15452 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 00:19:23 +00:00
Chris Lattner
45b5dd2918 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15450 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-03 23:41:28 +00:00
Chris Lattner
bcb11cf132 Simplify code and silence warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15255 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:34:49 +00:00
Chris Lattner
1d78516c65 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 23:15:44 +00:00
Reid Spencer
ada1618afa Always write FP values correctly.
Adjust for new Module.h interface for dependent libraries.
Excise unused backwards compatibility flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:36:26 +00:00
Reid Spencer
7d146e1107 Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15219 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:51 +00:00
Reid Spencer
ad89bd6a1a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15210 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:07:36 +00:00
Reid Spencer
89fc0e3ce0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14940 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:13:12 +00:00
Reid Spencer
a86037e4d9 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14939 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:12:03 +00:00
Reid Spencer
3c90f9fd12 bug 122:
- Update for BytecodeHandler interface change resuing from CPRs going away


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:10:36 +00:00
Brian Gaeke
fe2102b61d Actually set the endian/pointersize flags on the module being read in!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14826 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 20:33:13 +00:00
Brian Gaeke
0859e52582 Fix warning on SparcV9, where sizeof (int) != sizeof (void *).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14786 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 07:37:43 +00:00
Reid Spencer
46b002cd9b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:28:43 +00:00
Reid Spencer
66906518ed - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14764 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:24:05 +00:00
Reid Spencer
9cb5242574 Make the VBRSavings percentage make sense (as a fraction of the total
expanded size instead of the file size). Thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14731 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-10 08:04:13 +00:00
Reid Spencer
2439972a61 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14729 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 22:21:33 +00:00
Reid Spencer
011bed5ef8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 21:13:53 +00:00
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
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
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
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
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
Misha Brukman
500acf72cc Squelch compile-time warning (profile build).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 15:32:09 +00:00
Chris Lattner
003d5173ca Fix warning building in optimized mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13190 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-27 18:24:38 +00:00
Chris Lattner
5fa428fda9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12651 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:27:26 +00:00
Chris Lattner
9dd8770609 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+.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12643 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 23:43:42 +00:00
Brian Gaeke
60d6e54c72 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12567 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 19:51:00 +00:00
Chris Lattner
1e490ba4cd Add support for reading constantexpr select instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12563 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 02:53:59 +00:00
Chris Lattner
11cad517a1 Make error message a bit nicer.
Contributed by Reid Spencer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12523 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 00:16:01 +00:00
Chris Lattner
e3ac22a204 Read select instrs from bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12314 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 05:51:49 +00:00
Chris Lattner
37606f96b0 This debugging hook is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11233 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 17:20:52 +00:00
Chris Lattner
d21cd809b6 Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 04:37:31 +00:00
Chris Lattner
d5d8996720 Start using the new and improve interface to FunctionType arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 04:14:01 +00:00
Misha Brukman
afca90e832 Implement ModuleProvider::materializeModule() by only materializing functions
that are still left in the lazy reader map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10944 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-21 22:55:34 +00:00
Chris Lattner
62f8bf0566 Fix PR212 - Bytecode reader misreads 'long -9223372036854775808'!
Fix testcase test/Regression/Assembler/2004-01-20-MaxLongLong.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:13:07 +00:00
Chris Lattner
cdaff32ef6 Fix bogus warning and simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10924 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 17:06:29 +00:00
Chris Lattner
52f86d6247 Bugfixes for dealing with partially compactified functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10920 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:54:06 +00:00
Chris Lattner
241024381f Save another 30K from 176.gcc by encoding the compaction table a bit more
intelligently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10918 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 22:35:34 +00:00
Chris Lattner
89e025387e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10914 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:08:15 +00:00
Chris Lattner
80b97343ec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10908 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-17 23:25:43 +00:00
Chris Lattner
933619912b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:45:25 +00:00
Chris Lattner
ff47e7d02e Fix more breakage with string change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10882 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:39:06 +00:00
Chris Lattner
44d0eebc13 Fix PR73
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 17:55:01 +00:00
Chris Lattner
570fb1cbd8 Fix brokenness in my last checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10874 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 16:56:15 +00:00
Chris Lattner
7969dc2bec Change all of the bytecode reader primitives to throw exceptions instead of
returning error codes.  Because they don't return an error code, they can
return the value read, which simplifies the code and makes the reader more
efficient (yaay!).

Also eliminate the special case code for little endian machines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 06:13:09 +00:00
Chris Lattner
9e893e8a3d Version 1.2 now supports encoding strings as a special case, to avoid having
to emit all of those sbyte constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10863 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:35:21 +00:00
Chris Lattner
4e8683664d Like output_data, it's obvious that input_data was only used with 1 character
data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:03:22 +00:00
Chris Lattner
c08912f917 Remove support for the pre-1.0 bytecode version #1. This will become
the bytecode revision generated by LLVM 1.2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10848 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 16:44:44 +00:00
Chris Lattner
b16689b647 Don't use ConstantExpr::getShift anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:08:43 +00:00
Chris Lattner
3446ae8337 * finegrainify namespacification of ArchiveReader.cpp
* Refactor reader stuff out of include/llvm/Bytecode/Primitives.h.  This is
  internal implementation details for the reader, not public interfaces!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10739 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:00:15 +00:00
Chris Lattner
258b5375b4 Inching our way towards fixing PR82
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10721 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:42:34 +00:00
Chris Lattner
f63aeece6f remove some useless #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10654 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:55:21 +00:00
Chris Lattner
b70abe1c5a Use new getFileSize function instead of sys/stat.h directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10650 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:40:35 +00:00
Chris Lattner
2d6481cc2a Factor FDHandle out of the bytecode reader into the FileUtilities.h support
routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-29 21:35:05 +00:00
Chris Lattner
ddceeb720d minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10612 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-26 06:16:00 +00:00
John Criswell
9059158b56 Reverted back to revision 1.11. The previous fix doesn't really fix
anything; it just causes the bug to go dormant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10585 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 16:22:49 +00:00
John Criswell
1118d0fd94 Fix PR#193.
Modified ReadArchiveBuffer() so that it dynamically allocates the
std::string object used to hold the bytecode object file's name.  This is
necessary because it is passed by reference to the new Module that is
allocated to represent the bytecode object, and previously we were
using a std::string that disappeared on function exit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 22:37:29 +00:00
Brian Gaeke
6ca5b8f5f4 Make getObjectType() smarter about ranlibbed Mac OS X archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10493 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-17 00:18:18 +00:00
Brian Gaeke
27b40bcc9c Throw better error messages, by calling strerror(errno) when we
get an error inside the bytecode reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10415 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 00:47:44 +00:00
Brian Gaeke
3c09636588 In getObjectType(), doxygenify comment, and take a pointer to the
beginning of the archive member data as an argument.

Get rid of ParseLongFilenameSection(), which is dead.

In ReadArchiveBuffer(), implement support for 4.4BSD/MacOSX long filenames.
This is kind of invasive, because they prepend the long filename to the archive
member data, and then lie about the size. So we have to keep track of the real
size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10392 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 00:38:04 +00:00
Chris Lattner
8d1dbd2134 Emit & read more compressed bytecode by not emitting a bytecodeblock for
each basic block in function.  Instead, just emit a stream of instructions,
chopping up basic blocks based on when we find terminator instructions.  This
saves a fairly substantial chunk of bytecode space.  In stripped, sample
cases, for example, we get this reduction in size:

197.parser: 163036 -> 137180:  18.8% reduction
254.gap   : 844936 -> 689392:  22.6%
255.vortex: 621724 -> 528444:  17.7%

...

Not bad for something this simple.  :)  Note that this doesn't require a new
bytecode version number at all, though version 1.1 should not need to support
the old format.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10280 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 07:05:31 +00:00
Chris Lattner
29b789befa * Finegrainify namespacification
* Strength reduce several data structures which were left over from the
  "bad old days"
* Minor efficiency improvements
* Major efficiency improvement: In BytecodeParser::insertValue, do not allocate
  a new ValueTab entry just because some value exists with a large type.  This
  dramatically reduces the number of allocations/deallocations performed by the
  bytecode reader, and speeds up parsing of Kimwitu++ from 34s to 17s.  This is
  to help address PR127


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10085 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 17:27:18 +00:00