Chris Lattner
4b688a1c70
This mega patch converts us from using Function::a{iterator|begin|end} to
...
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
9cc39e2f8b
Fix an apparent ambiguity compiling on PPC
...
llvm-svn: 20507
2005-03-07 02:59:36 +00:00
Chris Lattner
1343991e93
simplify and speed up some code
...
llvm-svn: 20472
2005-03-06 02:32:00 +00:00
Chris Lattner
1ccff5c8c7
second argument to Value::setName is now gone.
...
llvm-svn: 20463
2005-03-05 19:05:20 +00:00
Chris Lattner
a024984017
Fix spelling, patch contributed by Gabor Greif!
...
llvm-svn: 20343
2005-02-27 06:18:25 +00:00
Reid Spencer
24b41ba78d
Implement an isBytecodeArchive method to determine if an archive contains
...
bytecode file members or not.
Patch Contributed By Adam Treat
llvm-svn: 20338
2005-02-26 22:00:32 +00:00
Chris Lattner
608a8c9f55
use more specific cast.
...
llvm-svn: 20297
2005-02-24 05:26:04 +00:00
Reid Spencer
a7a01f13df
Make the check for global variables the same as the one for functions. In
...
both cases they are looking for non-external variables/functions that do
not have internal linkage. Using "!isExternal()" is a little more
understandable than "hasInitializer()"
llvm-svn: 20155
2005-02-13 18:12:20 +00:00
Chris Lattner
1788cf35ab
Make sure to clear the LazyFunctionLoadMap after we ParseAllFunctionBodies.
...
Otherwise, clients who call ParseAllFunctionBodies will attempt to parse
the function bodies twice, which is (uh) very very bad (tm).
This fixes gccld on python.
llvm-svn: 20152
2005-02-13 17:48:18 +00:00
Chris Lattner
fdc746ac38
Do not put internal symbols into the symbol table. This shrinks the symbol
...
table for archives in common cases, and prevents trying to resolve a
external reference with an internal reference. This shrinks the libpython.a
symbol table from 126302 to 19770 bytes.
llvm-svn: 20151
2005-02-13 17:42:11 +00:00
Chris Lattner
e4aaa4cf01
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! :)
llvm-svn: 19943
2005-01-31 01:11:13 +00:00
Chris Lattner
031d5f649c
Adjust to changes in User class and minor changes in instruction ctors.
...
llvm-svn: 19894
2005-01-29 00:36:19 +00:00
Jeff Cohen
df055196d4
Properly close mapped files.
...
llvm-svn: 19863
2005-01-28 01:17:07 +00:00
Jeff Cohen
7311de2af2
Use binary mode for reading/writing bytecode files
...
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Reid Spencer
03a53912a7
Remove potential platform portability issue with size of "int".
...
llvm-svn: 19172
2004-12-29 01:20:24 +00:00
Reid Spencer
44d96443fe
For PR351:
...
Remove unix specific code (use of errno and read) from the reader.
Thanks to Jeff Cohen for pointing this out.
llvm-svn: 19081
2004-12-21 07:51:33 +00:00
Reid Spencer
f9693c67ae
Remove the #include of llvm/Config/unistd.h as it is no longer needed.
...
llvm-svn: 19067
2004-12-20 04:52:04 +00:00
Jeff Cohen
61fe69a426
Fix problems uncovered by VC++ (first time compiled by VC++)
...
llvm-svn: 19056
2004-12-20 03:23:46 +00:00
Reid Spencer
ffc90507a4
For PR351:
...
* Remove #inclusion of FileUtilities.h, not needed any more.
* Convert getUniqueFilename -> sys::Pat::makeUnique()
llvm-svn: 18948
2004-12-15 01:51:56 +00:00
Reid Spencer
1c72c28b2b
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.
llvm-svn: 18902
2004-12-13 18:25:27 +00:00
Reid Spencer
aaa17b8807
Make sure the Archive gets deleted if there's an error.
...
llvm-svn: 18869
2004-12-13 03:22:31 +00:00
Reid Spencer
466ab53f35
Implement error handling in OpenAndLoad* functions so the Linker can handle it.
...
llvm-svn: 18853
2004-12-13 02:59:03 +00:00
Reid Spencer
e2af9dc813
Path::get -> Path::toString
...
llvm-svn: 18785
2004-12-11 00:14:15 +00:00
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