Commit Graph

8318 Commits

Author SHA1 Message Date
Reid Spencer
d4543da9b0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17918 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 18:28:29 +00:00
Reid Spencer
6ab7a4f9ef Make sure we parse bytecode with a module identifier that reflects the full
name of the module: "Archive.a(object.o)"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17917 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 18:25:21 +00:00
Chris Lattner
1b9fe1cbbe Generalize this code to turn any cast-to-first-element-of into a gep constexpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17914 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 17:59:35 +00:00
Chris Lattner
bc2a99b480 Simplify conditional and fix LICM/2004-11-17-UndefIndexCrash.ll
by saying what we mean


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17913 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 17:39:39 +00:00
Reid Spencer
96ce335f4e Adjust long file name writing to match BSD 4.4 and Mac OSX style archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17910 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 16:14:21 +00:00
Reid Spencer
dd95e8d71e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17909 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-17 16:13:11 +00:00
Tanya Lattner
ced8222405 Added my own defMap. Only saving values that are not loop invariant. Fixed a couple of assertions that were triggered due to registers not being allocated. These both had to do with PHINodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17907 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 21:31:37 +00:00
Chris Lattner
bcb31d645d Minor cleanup and speedup. This reduces link-time for 252.eon from 35.5s
to 34.7s with a profile build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17906 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 20:39:04 +00:00
Chris Lattner
8511c351dc Make this function work with non-abstract types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17905 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 20:30:53 +00:00
Chris Lattner
a63acbfeab Don't increment a dead iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17904 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 19:04:40 +00:00
Chris Lattner
39a83dc37c Fix a major bug in the signed shr code, which apparently only breaks 134.perl!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17902 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 18:40:52 +00:00
Reid Spencer
be31d2ad78 * Use low-level unix I/O interface since we're on Unix.
* Don't use variable length arrays (replaced with alloca)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17901 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 17:14:08 +00:00
Chris Lattner
0033baf94e Simplify the remapper by only needing one map, since the body of the functions
being linked do not need to be remapped any longer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17900 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 17:12:38 +00:00
Chris Lattner
73559b1f4c Do not delete dead invoke instructions!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17897 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 16:32:28 +00:00
Misha Brukman
e5525438b0 Erase non-applicable Unix comment, this is Win32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17896 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:35:32 +00:00
Brian Gaeke
4cda591341 Update list of failing benchmarks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17895 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:32:58 +00:00
Brian Gaeke
b354b7148e Correct the implicit-defs information for indirect and direct calls.
You can't have implicit defs that overlap explicit defs, or implicit
defs that alias one another.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17894 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:32:09 +00:00
Chris Lattner
4bbfbff119 Take advantage of the fact that we are allowed to clobber the input module
by splicing function bodies from the src module to the destination module.

This speeds up linking quite a bit, e.g. gccld time on 176.gcc from 26s -> 20s
when forming the .rbc file, with a profile build.  One of the really strange
but cool effects of this patch is that it speeds up the optimizers as well,
from 12s -> 10.7s, presumably because of better locality???

In any case, this is just a first step.  We can trivially get rid of the
LocalMap now and do other simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:31:51 +00:00
Reid Spencer
30e4056a5d Fix typeo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17892 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:05:16 +00:00
Reid Spencer
56d3cdbd21 Remove useless #include.
Patch contributed by Jeff Cohen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17891 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:00:23 +00:00
Reid Spencer
9860121890 Simplify code.
Patch contributed by Jeff Cohen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17890 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:59:53 +00:00
Reid Spencer
e26057a376 Standardize on 'class' instead of 'struct'. Gets rid of warnings in VC++
Patch contributed by Jeff Cohen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17889 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:58:55 +00:00
Brian Gaeke
8311befb69 Give a better message for a common assertion failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17887 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:52:35 +00:00
Reid Spencer
5cc498f116 Add a comment to some code that at first glance just doesn't look right.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17886 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:50:36 +00:00
Reid Spencer
99d3604acf Per code review:\
* Adjust indentation\
* Ensure memory do not leak if exceptions happen (std::auto_ptr use)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:47:41 +00:00
Reid Spencer
87f90729d6 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17884 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:47:30 +00:00
Reid Spencer
4a980d1813 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:47:19 +00:00
Reid Spencer
1f465809cd Per code review:\
* Make sure all members are initialized upon construction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17882 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:47:07 +00:00
Chris Lattner
242e525edc The second arg may be clobbered by this function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17880 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:41:36 +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
a4d0c6fb94 use an autoptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:40:54 +00:00
Reid Spencer
8bf7fba10b Per code review:
* get rid of (void) construct in function declarations
* make toString a const member
* add a default implementation of toString for Win32


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17873 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:22:17 +00:00
Reid Spencer
b608a81a18 Per code review:
* Clean up the StatusInfo constructor to construct all members and give
  them reasonable values.
* Get rid of the Vector typedef and make the interface to
  getDirectoryContent use a std::set instead of a std::vector so the dir
  content is sorted.
* Make the getStatusInfo method const and not return a useless boolean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17872 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:15:19 +00:00
Reid Spencer
9bbba09139 Per code review:
*Implement/Document the cl::extrahelp feature instead of the MoreHelp ptr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:11:52 +00:00
Chris Lattner
eea9b134fc Simplify namespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17870 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 04:47:33 +00:00
Chris Lattner
8f1ac9f90d Remove a dead function, which died when we got GAS emission working (phwew,
hold your nose!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17869 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 04:34:29 +00:00
Chris Lattner
f2d552eca6 Implement a simple FIXME: if we are emitting a basic block address that has
already been emitted, we don't have to remember it and deal with it later,
just emit it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17868 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 04:30:51 +00:00
Chris Lattner
16fe6f5f24 * Merge some win32 ifdefs together
* Get rid of "emitMaybePCRelativeValue", either we want to emit a PC relative
  value or not: drop the maybe BS.  As it turns out, the only places where
  the bool was a variable coming in, the bool was a dynamic constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17867 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 04:21:18 +00:00
Chris Lattner
02376e3f29 Now that we have ghost linkage, we can force resolution of external symbols
immediately instead of lazily.

In this program, for example:

int main() {
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
}

We used to have to go through compilation callback 4 times (once for each
call to printf), now we don't go to it at all.

Thanks to Misha for noticing this, and for adding the initial ghost linkage
patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 23:20:04 +00:00
Chris Lattner
0050ef8319 There is no reason to try to materialize the function from bytecode if it
already has been.  This may be a small speedup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17863 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 23:18:09 +00:00
Chris Lattner
5aa3ed92de Add debug-only=jit printout, so we see when lazily resolved symbols are
set up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 23:16:55 +00:00
Chris Lattner
36c625d3a5 Simplify and rearrange long shift code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 23:16:34 +00:00
Chris Lattner
d6e431f45e Do not emit FunctionBlock blocks for external functions. This shrinks
bytecode files by about 8 bytes per external function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 22:39:49 +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
fd7f8fea65 Disable this change, it was premature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17857 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:56:33 +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
86c9365761 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17854 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:46:40 +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
Misha Brukman
145a5a3746 Add BCTR and LWZU instruction opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:20:09 +00:00