Chris Lattner
c5f6c3fd48
Remove a dead field, make the map go to integer type ID to hash better and
...
avoid a getType.
llvm-svn: 18691
2004-12-09 06:19:44 +00:00
Chris Lattner
565d505b28
Remove #include inadvertently added
...
llvm-svn: 18686
2004-12-09 04:53:17 +00:00
Chris Lattner
23b2d6fd82
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.
llvm-svn: 18685
2004-12-09 04:51:50 +00:00
Reid Spencer
8cddd97526
Provide more information in the error message that occurs when there are
...
unresolved constants remaining.
llvm-svn: 18502
2004-12-04 22:19:53 +00:00
Chris Lattner
8f849baa59
Check in some patches for better assertions
...
llvm-svn: 18500
2004-12-04 21:28:47 +00:00
Chris Lattner
8bd875f0de
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.
llvm-svn: 18487
2004-12-04 05:28:27 +00:00
Chris Lattner
d6020eabef
RevisionNum is read by error(), initialize it early.
...
llvm-svn: 18386
2004-11-30 16:58:18 +00:00
Reid Spencer
49f3fe5d81
Compute the firstFileOffset correctly after reading the LLVM symbol table.
...
llvm-svn: 18300
2004-11-28 03:13:02 +00:00
Reid Spencer
d841d33637
Adjust to Compressor interface change
...
llvm-svn: 18249
2004-11-25 19:38:05 +00:00
Reid Spencer
da5beb436a
Allow reading of member names that begin with an _ character.
...
llvm-svn: 18179
2004-11-23 22:35:39 +00:00
Reid Spencer
df25e5b3bb
Fix a comment to imply the correct semantics.
...
llvm-svn: 18097
2004-11-22 02:58:47 +00:00
Reid Spencer
f381e95cc6
Distinguish between BSD4.4 and SVR4 symbol tables
...
llvm-svn: 18044
2004-11-20 07:29:40 +00:00
Reid Spencer
1c4d0a214a
Correct the computation of when to add the padding. It is not based on the
...
member's size. It is based on the oddness/evenness of the file pointer.
This fixes a bug with llvm-ar not being able to read archives produced by
llvm-ranlib when there are members with odd long file name lengths.
llvm-svn: 17997
2004-11-19 17:08:00 +00:00
Chris Lattner
e5662f4700
Add note that this is for old bytecode files.
...
llvm-svn: 17991
2004-11-19 16:24:05 +00:00
Reid Spencer
640ab4f4f6
Don't save an iterator, just use post-increment.
...
llvm-svn: 17981
2004-11-19 03:44:10 +00:00
Reid Spencer
a181a37bb4
Make findModulesDefiningSymbols modify its symbols argument so we can \
...
eliminate symbols defined by the archive efficiently
llvm-svn: 17976
2004-11-19 03:18:22 +00:00
Reid Spencer
a98ccac6fc
Fix some things for Mac OSX archives:
...
* ensure trailing spaces are eliminated so they don't factor into the
length of a member's name.
* make sure all the bytes of a name are written even if the name ends in
multiple null characters (bug in OSX ar)
* make sure we provide the full member name when searching for symbols so
the module name is not accidentally duplicated.
llvm-svn: 17918
2004-11-17 18:28:29 +00:00
Reid Spencer
3e245bd4d5
Make sure we parse bytecode with a module identifier that reflects the full
...
name of the module: "Archive.a(object.o)"
llvm-svn: 17917
2004-11-17 18:25:21 +00:00
Reid Spencer
b9fbea4c79
Adjust long file name writing to match BSD 4.4 and Mac OSX style archives.
...
llvm-svn: 17910
2004-11-17 16:14:21 +00:00
Reid Spencer
f59013e0fa
Despite documentation to the contrary, Mac OSX and BSD 4.4 archive formats
...
*do* include the length of the long file in the length of the member and
they are *not* null terminated.
llvm-svn: 17909
2004-11-17 16:13:11 +00:00
Reid Spencer
35a3e7eacc
Fix typeo in comment.
...
llvm-svn: 17892
2004-11-16 07:05:16 +00:00
Reid Spencer
2d66bbb7c3
Per code review:\
...
* Make the numVbrBytes function more efficient and better documented \
* Fix a bug in name truncation \
* Add comments before functions \
* Get rid of functions that are now inlined into the header \
* Do not have Archive doing symbol table printing \
* Put assert comments into the assert so they print out \
* Make sure foreign symbol tables are written
llvm-svn: 17884
2004-11-16 06:47:30 +00:00
Reid Spencer
b6d946d19d
Per code review:\
...
* Make sure we write out the foreign symbol table if we read one \
* Make the padding calculation more efficiently and avoid Solaris warnings
llvm-svn: 17883
2004-11-16 06:47:19 +00:00
Reid Spencer
e39cdbd7f7
Per code review:\
...
* Make sure all members are initialized upon construction
llvm-svn: 17882
2004-11-16 06:47:07 +00:00
Reid Spencer
2fe884dad8
Per code review:\
...
* Get rid of memory leaks on exception \
* Provide better comments of how the memory handling works
llvm-svn: 17876
2004-11-16 06:41:05 +00:00
Chris Lattner
10b5a5c0da
Do not emit FunctionBlock blocks for external functions. This shrinks
...
bytecode files by about 8 bytes per external function
llvm-svn: 17859
2004-11-15 22:39:49 +00:00
Chris Lattner
558ce75905
Use a per-function flag bit to indicate whether or not there is a function
...
body for the function.
llvm-svn: 17858
2004-11-15 22:38:52 +00:00
Chris Lattner
c199d448e9
Disable this change, it was premature
...
llvm-svn: 17857
2004-11-15 21:56:33 +00:00
Chris Lattner
704cad0375
Make *SURE* to null out the pointer before throwing an exception, otherwise
...
the dtor for the BytecodeReader class will try to free it again!
llvm-svn: 17856
2004-11-15 21:55:33 +00:00
Chris Lattner
4a2ae87435
Cleanups. Null out pointer after freeing it for paranoia
...
llvm-svn: 17855
2004-11-15 21:55:06 +00:00
Chris Lattner
571b490404
If a function is external, do not output a FunctionBlock for the function
...
AT ALL. This saves 11 bytes per external function from the bytecode file,
and is also required to make GhostLinkage work.
llvm-svn: 17854
2004-11-15 21:46:40 +00:00
Chris Lattner
d1e621acc6
Make functions default to having external linkage if they have no
...
FunctionBlock.
llvm-svn: 17853
2004-11-15 21:43:03 +00:00
Reid Spencer
52da956231
* Make sure the string table gets read even if there isn't a foreign
...
symbol table.
* Make sure we update the file pointer for each member when rebuilding the
symbol table.
llvm-svn: 17812
2004-11-15 01:40:20 +00:00
Reid Spencer
bfc924424d
Changes necessary to enable linking of archives without LLVM symbol tables.
...
llvm-svn: 17811
2004-11-15 01:20:11 +00:00
Reid Spencer
85698d2435
Moved to lib/Bytecode/Archive.
...
llvm-svn: 17800
2004-11-14 22:38:32 +00:00
Reid Spencer
5c112bc910
Simplify compression code by using the high level interface to the Compressor
...
llvm-svn: 17771
2004-11-14 22:01:41 +00:00
Reid Spencer
cc354b445d
Add wrappers to get defined symbols from bytecode
...
llvm-svn: 17770
2004-11-14 22:00:48 +00:00
Reid Spencer
b9baef5ca8
Simplify handling of decompression
...
llvm-svn: 17769
2004-11-14 22:00:09 +00:00
Reid Spencer
115f252d2a
Simplify decompression code by using the high level interface to the Compressor
...
llvm-svn: 17768
2004-11-14 21:59:21 +00:00
Reid Spencer
2917639a35
Completely rewritten to allow reading of archives and symbol table lookup in a more efficient manner.
...
llvm-svn: 17767
2004-11-14 21:58:33 +00:00
Reid Spencer
0a3e3a41c3
Implementation declarations for Archive
...
llvm-svn: 17766
2004-11-14 21:57:46 +00:00
Reid Spencer
131f129398
First working version
...
llvm-svn: 17765
2004-11-14 21:56:59 +00:00
Reid Spencer
0a3ec41881
Add the Archive library
...
llvm-svn: 17764
2004-11-14 21:55:27 +00:00
Misha Brukman
6da7a2e054
Mark an unmaterialized function as having GhostLinkage
...
llvm-svn: 17748
2004-11-14 21:02:55 +00:00
Reid Spencer
9534caa3bb
Moved to lib/Bytecode/Archive in preparation for re-write.
...
llvm-svn: 17742
2004-11-14 19:59:40 +00:00
John Criswell
5be81b837b
Recognize compressed LLVM bytecode files.
...
This should fix the problem of not being able to link compressed LLVM
bytecode files from LLVM libraries.
llvm-svn: 17648
2004-11-09 19:37:07 +00:00
Reid Spencer
c9c7c7fbee
* Comments & cleanup per CL code review.
...
* Accept 'llvc' as signature for compressed bytecode
llvm-svn: 17579
2004-11-07 18:20:55 +00:00
Reid Spencer
152f895e9b
Add comments per CL code review.
...
llvm-svn: 17578
2004-11-07 18:19:00 +00:00
Reid Spencer
1446cd065f
* Add comments and cleanup per CL code review
...
* Make signature for compressed bytecode llvc instead of unreadable
* Make the CompressionContext have a constructor and destructor.
llvm-svn: 17576
2004-11-07 18:17:38 +00:00
Reid Spencer
a81994464f
Add support for compressed bytecode
...
llvm-svn: 17535
2004-11-06 23:17:23 +00:00
Reid Spencer
bf14271ed6
Implement the GetBytecodeSymbols interface function to extract just the
...
externally visible defined symbols from a bytecode file.
llvm-svn: 17503
2004-11-06 08:56:40 +00:00
Reid Spencer
c3a4c8a346
Makefile for the LLVMArchive library.
...
llvm-svn: 17500
2004-11-06 08:52:36 +00:00
Reid Spencer
8907e56650
First kinda/sorta working version of the Archive library. Reading is not
...
yet supported but writing works. Way too early to review this. More to come
llvm-svn: 17499
2004-11-06 08:51:45 +00:00
Reid Spencer
36b5b2c07e
Fix library name.
...
llvm-svn: 17305
2004-10-28 05:32:01 +00:00
Reid Spencer
ccdfdd7346
Fix name of library
...
llvm-svn: 17304
2004-10-28 05:30:54 +00:00
Chris Lattner
75772beb3b
Fix the previous bug the correct way. This fixes ptrdist/bc
...
llvm-svn: 17201
2004-10-24 04:27:59 +00:00
Chris Lattner
9595df9f4e
Fix a bug that Brian brought to my attention. This corrects:
...
Assembler/2004-10-22-BCWriterUndefBug.llx
llvm-svn: 17177
2004-10-23 03:10:23 +00:00
Reid Spencer
e48ba34fd4
We won't use automake
...
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
a0019a2104
Do not erroneously accept revision 6 bytecode files when the format hasn't
...
been defined yet!
llvm-svn: 17063
2004-10-16 18:56:02 +00:00
Chris Lattner
8336590b1f
Add support for undef, unreachable, and function flags
...
llvm-svn: 17054
2004-10-16 18:18:16 +00:00
Chris Lattner
33dd5f87b8
There is no reason not to build these in parallel
...
llvm-svn: 17023
2004-10-15 23:22:15 +00:00
Chris Lattner
b346be57a2
Don't print a bunch of metrics that are meaningless for external functions
...
llvm-svn: 17017
2004-10-15 19:40:31 +00:00
Chris Lattner
ad57c9f54c
Today is not my day. Fix broken #
...
llvm-svn: 16967
2004-10-14 02:31:35 +00:00
Chris Lattner
d2a5066c6a
unbreak previous checkin :(
...
llvm-svn: 16966
2004-10-14 02:06:48 +00:00
Chris Lattner
93bfff6da2
Add back a missing paren
...
llvm-svn: 16965
2004-10-14 01:57:28 +00:00
Chris Lattner
aef5a2d78d
Fit to 80 cols
...
llvm-svn: 16964
2004-10-14 01:49:34 +00:00
Chris Lattner
2ed4986e00
Wrap to 80 cols, delete some seriously old debugging printouts
...
llvm-svn: 16963
2004-10-14 01:46:07 +00:00
Chris Lattner
3f3d5aad47
Fit in 80 columns
...
llvm-svn: 16962
2004-10-14 01:39:18 +00:00
Chris Lattner
bdb8db1a40
Minor cleanups
...
llvm-svn: 16961
2004-10-14 01:35:17 +00:00
Reid Spencer
e6418ec30f
Update to reflect changes in Makefile rules.
...
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
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