1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
Commit Graph

214 Commits

Author SHA1 Message Date
Chris Lattner
0bb60b108d Add a couple more IPO's
llvm-svn: 12863
2004-04-12 05:38:15 +00:00
Chris Lattner
caefe03e39 Disable strict alias analysis in the backend c compiler, as the code we
generate is not TBAA safe.

llvm-svn: 12774
2004-04-08 15:18:59 +00:00
Chris Lattner
825c162788 Revert previous patch, I'm a moron :)
llvm-svn: 12773
2004-04-08 15:18:03 +00:00
Chris Lattner
5608c6da7e Right, we break strict aliasing requirements. Make sure to disable strict
aliasing in the C compiler.

llvm-svn: 12772
2004-04-08 15:14:43 +00:00
Chris Lattner
1a40aaf3ba Minor cleanups
llvm-svn: 12700
2004-04-06 16:54:04 +00:00
Chris Lattner
3259504cce Add a new gccld -native-cbe option which causes gccld to generate native code
for the application with the C backend instead of the native LLVM code generator

llvm-svn: 12698
2004-04-06 16:43:13 +00:00
Chris Lattner
0179360703 Run the new pass in gccld now that it passes all tests
llvm-svn: 12196
2004-03-07 22:12:40 +00:00
Chris Lattner
dc004a7269 We have this snazzy link-time optimizer. How about we start using it? This
removes some cruft from 255.vortex, cleaning up after DAE and IPCP, which
do horrible, beautiful, things to vortex.

llvm-svn: 11861
2004-02-26 03:34:30 +00:00
Chris Lattner
24c4dd56b5 Add a new pass, run internalize first
llvm-svn: 11839
2004-02-25 21:35:13 +00:00
Alkis Evlogimenos
15ac9b976d Include Config/config.h for SHLIBEXT.
llvm-svn: 11779
2004-02-23 22:42:51 +00:00
Chris Lattner
3c9511b0ac Make sure to print a stack trace whenever an error signal is delivered to
the tool.

llvm-svn: 11633
2004-02-19 20:32:39 +00:00
John Criswell
a43fe7d309 Fixed PR#197. The libcrtend library is removed from the library linking list
when creating native executables.

llvm-svn: 10979
2004-01-26 23:51:10 +00:00
John Criswell
3a994220ad Fixes for PR214. Use the SHLIBEXT variable instead of hardcoding .so into
every file.

llvm-svn: 10976
2004-01-26 20:59:41 +00:00
Chris Lattner
9ec6983d9e Make sure to verify the result before writing out the bytecode file. Not doing
so can cause obscure errors downstream.

llvm-svn: 10840
2004-01-14 03:39:46 +00:00
John Criswell
207cf0a20d Modified the logic so that library objects with main() are only linked in
if the program currently has main undefined.

llvm-svn: 10597
2003-12-23 20:27:14 +00:00
John Criswell
8f95f1d2ca Modified the linker so that it always links in an object from an archive
that defines the symbol "main."  This is a hack that ensures that programs
that place their main function in a library and then link it in
(i.e. Apache 2.x) get their main function linked in.

There is probably a more correct way to do this, but this works for now.

llvm-svn: 10594
2003-12-23 17:37:06 +00:00
John Criswell
90e72c9cba Added the -h option for compatibility with other linkers.
llvm-svn: 10335
2003-12-09 15:39:11 +00:00
Chris Lattner
21551f0cd4 Fix compatibility with gcc 3.4
llvm-svn: 10262
2003-11-29 19:45:47 +00:00
Chris Lattner
d4174e7703 The function resolving pass must be run, even if -disable-opt is specified
llvm-svn: 10250
2003-11-28 09:44:03 +00:00
Chris Lattner
e7ad2f6b04 * The return value of LinkLibraries is ignored, so remove it.
* Finegrainify namespacification of Linker.cpp
* If linking a library in fails, do not STOP LINKING IN LIBRARIES AND
  CONTINUE ANYWAY!  Instead, just output the warning, and keep going. :)

llvm-svn: 10249
2003-11-28 07:44:09 +00:00
Misha Brukman
1af6ec9cbf I'm gonna be picky and say we don't really need that trailing slash "lib/"
llvm-svn: 10196
2003-11-24 05:31:57 +00:00
Misha Brukman
407528ec44 Make sure we ONLY add a `-load' switch to the JIT command line if the file is
verified as having an ELF header. This fixes PR151.

llvm-svn: 10195
2003-11-24 05:29:42 +00:00
Misha Brukman
c147a00407 When writing out the runner script, add -load=<lib> lines to pull in all the
shared objects automagically, so it doesn't have to be done by hand.

llvm-svn: 10114
2003-11-20 19:08:42 +00:00
Misha Brukman
f045db38cd Add ability to search only for native shared object, and expose the
functionality to the rest of gccld.

llvm-svn: 10113
2003-11-20 19:08:06 +00:00
Misha Brukman
19a9eeb585 For consistency, removed space between function name and left paren in function
call, i.e. [ addPass (...) ]  =>  [ addPass(...) ]

llvm-svn: 10105
2003-11-20 06:26:15 +00:00
Misha Brukman
f516afa0c0 * Doxygenified comments, simplifying them and shortening in the process
* Eliminated extra space

llvm-svn: 10104
2003-11-20 06:21:54 +00:00
Brian Gaeke
2016376753 Add a -verify option to verify the results of gccld passes.
Add a -disable-opt option to turn off gccld optimization passes.

llvm-svn: 10040
2003-11-16 23:07:28 +00:00
Brian Gaeke
c65d049581 When we find a module we want, in an archive, in verbose mode,
print out the module's identifier (which should now contain the name
 of both the archive and the module.)
Wrap some lines at 80 cols.

llvm-svn: 10039
2003-11-16 23:07:13 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
dad096c2e1 Move IsArchive, IsBytecode to FileUtilities. Fix up some method comments.
llvm-svn: 9902
2003-11-11 21:54:01 +00:00
Brian Gaeke
aaa29b094d This version of Linker.cpp works a lot better, but it's a little messy. Sorry.
Use FileOpenable() instead of FileExists().
Create IsBytecode() predicate -- like IsArchive(), but for bytecode files.
Use IsBytecode() before trying to load any file as a bytecode file.

llvm-svn: 9893
2003-11-11 18:27:37 +00:00
Chris Lattner
14ab34bf94 Give gccld more guts
llvm-svn: 9835
2003-11-09 19:55:09 +00:00
Brian Gaeke
4388a20bc3 Give this header file an Emacs mode-line.
llvm-svn: 9749
2003-11-05 22:13:10 +00:00
Brian Gaeke
a38dea74cc Do not assume the first file is a bytecode file. Instead, construct a dummy
Module and link things into that.

Also, fix a typo in an error message.

llvm-svn: 9748
2003-11-05 22:13:00 +00:00
Brian Gaeke
4f8c392983 Shorten and correct some function-header comments.
Make "verbose" output MUCH nicer. Now it tells you when you are linking a
bytecode file, or an archive, and whether it's because you called it by name,
or because you gave it a -l option, and it says "Trying" before it takes
action and prints a message in the past tense afterwards.

Make LinkFiles not skip the first file in Files.

Make LinkFiles warn you if it can't find a file and LLVM_LIB_SEARCH_PATH is
unset.

llvm-svn: 9747
2003-11-05 22:12:52 +00:00
Chris Lattner
16a148787e Make -r work, fixing PR 91
llvm-svn: 9724
2003-11-05 06:05:21 +00:00
Chris Lattner
dc9da3878f If linking a library, do not link other libraries, like libc, into it!
This fixes lots of annoying warnings and error messages

llvm-svn: 9677
2003-11-03 17:27:17 +00:00
Brian Gaeke
93e3e06b90 lli -q is history. Rebuild your gccld shell scripts, folks!
llvm-svn: 9494
2003-10-24 20:00:06 +00:00
Chris Lattner
bc9bb8e370 Turn on the inliner by default at link-time
llvm-svn: 9477
2003-10-24 18:09:23 +00:00
Chris Lattner
97d6ee74bb Turn on the IPCP pass by default. It has passed all of the tests
llvm-svn: 9435
2003-10-23 18:25:57 +00:00
Brian Gaeke
bbeaf0ce11 Fix off-by-one error in processing of libraries named on command line.
llvm-svn: 9351
2003-10-21 21:07:12 +00:00
John Criswell
a8dfda0513 Added LLVM copyright to Makefiles.
llvm-svn: 9314
2003-10-20 22:29:16 +00:00
Chris Lattner
34a5a4c718 fix file header
llvm-svn: 9294
2003-10-20 17:58:43 +00:00
John Criswell
d06dc1136b Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Brian Gaeke
acbc37a19e Don't include "Config/stdlib.h".
llvm-svn: 9037
2003-10-10 19:12:22 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Brian Gaeke
66d8a200cf Make more error messages have gccld's name in them.
Add a newline after "Cannot find <library>".

llvm-svn: 8968
2003-10-08 19:09:30 +00:00
Misha Brukman
a43e5aae7e Doxygen-ified comments.
llvm-svn: 8778
2003-09-30 18:09:32 +00:00
Misha Brukman
6ff19a4909 * Ordered includes according to LLVM style
* Put function signatures on one line if possible
* Deleted empty comment lines (^//$)
* Deleted braces around single statements
* Deleted space between function call and argument list

llvm-svn: 8775
2003-09-30 17:59:25 +00:00
Misha Brukman
5d816db32f Made code more terse:
* Deleted empty comment lines
* No single begin-braces '{' on a line by themselves

llvm-svn: 8773
2003-09-30 17:51:20 +00:00
Misha Brukman
ddcbeb56a9 Doxygen-ified function comments.
llvm-svn: 8771
2003-09-30 17:42:57 +00:00
Misha Brukman
c4577d4f33 Removed extra space in comments.
llvm-svn: 8770
2003-09-30 17:40:12 +00:00
Chris Lattner
0552cd931e Remove initials from source file
llvm-svn: 8769
2003-09-30 17:36:51 +00:00
Misha Brukman
d85607c390 Make code more terse:
* Remove extra blank lines
* Delete space between function call and arg list
* Delete non-content comment lines ("//")

llvm-svn: 8768
2003-09-30 17:33:12 +00:00
Brian Gaeke
7e16b3f05b 1. Use better error messages in LinkFiles().
2. I think the caller of LinkFiles() should not ignore a true return value.
   (If you have a good reason why it ought to, feel free to revert
   this. It's just something that's been bugging me for a while.)

llvm-svn: 8760
2003-09-30 14:03:48 +00:00
Chris Lattner
9ca002dd34 Update file headers for renamed files.
llvm-svn: 8758
2003-09-30 03:24:28 +00:00
Misha Brukman
8e65370329 Tersified code:
* Removed space between function name and its argument list
* Removed space between '&' and variable name
* Removed empty comment lines: `//'

llvm-svn: 8750
2003-09-29 22:26:24 +00:00
Misha Brukman
7a17430b40 * Ordered includes according to LLVM programmers' guide
* Made code layout more verbose: no more '{' on a line by itself
* Pruned extra whitespace

llvm-svn: 8748
2003-09-29 22:16:43 +00:00
Chris Lattner
07621721bf Minor cleanups:
* Local header file goes at top
 * Remove unneeded #includes
 * Wrap code at 80 columns
 * Declare variables where they are used
 * 'register' is not needed
 * Use 'unsigned' instead of 'int' variables where possible

llvm-svn: 8657
2003-09-22 20:21:34 +00:00
John Criswell
2d676f282d New header file for gccld.
llvm-svn: 8610
2003-09-19 20:24:40 +00:00
John Criswell
a63a20d3eb Removed linking functionality from gccld.cpp and moved it to linker.cpp.
Renamed functions that were all lower-case.
Moved functions from util.cpp into linker.cpp or gccld.cpp.
Removed util.h and created gccld.h.
Refactored the linker functionality in linker.cpp so that it is easier to
follow, easier to modify, and it's library/object file search behavior is
easier to understand and document.
Added code to include library paths when doing native linking, but this
causes problems and is currently #ifdef'd out.

llvm-svn: 8609
2003-09-19 20:24:23 +00:00
John Criswell
9f7bb3c331 Refactored gccld into three C++ source files.
Added code ignore bytecode link failures when generating native code.
Moved native code and bytecode generation out of the main() function.

llvm-svn: 8595
2003-09-18 16:22:26 +00:00
John Criswell
d3b8e07a98 Replaced the call to strdup() with a new operator followed by a strcpy().
This should prevent calls to the new oerator and malloc.

llvm-svn: 8587
2003-09-17 19:14:41 +00:00
John Criswell
b0eb351d77 Added the use of the const keyword.
Have gccld find the path to llc and gcc instead of having the library do it.

llvm-svn: 8586
2003-09-17 19:04:22 +00:00
John Criswell
2682c34226 Removed the use of the environ variable and instead use the environment array
passed into main().  This may (or may not) be more portable, but it looks
nicer.
Added functions to copy the environment array and modify the copy, thus
preserving the environment.
Switched from using system() to using ExecWait().
The code now removes the assembly file generated when using the -native option.
Fixed the remove_env() function: The previous revision truncated the
environment variable list.  This version just zaps the variable as intended.

llvm-svn: 8579
2003-09-17 15:20:51 +00:00
John Criswell
206836748e Added the -native option.
With this option, gccld links the program into LLVM bytecode and a native code
binary.  This allows llvmgcc to correctly tell GNU configure scripts when
things aren't defined properly (because the native link will fail).

llvm-svn: 8570
2003-09-16 21:27:35 +00:00
Brian Gaeke
b10292fa2a -abort-on-exception is gone. Rebuild your gccld shell scripts, folks! :-)
llvm-svn: 8368
2003-09-05 19:23:03 +00:00
John Criswell
cdcee99ee6 Added code that makes the bytecode file readable (needed by the generated shell
script).
Removed the use of sys/types.h and sys/stat.h.
Modified FileExists() so that it uses the access() system call to check for
file existance.  This requires less header files and might even be a tad bit
faster.

llvm-svn: 8328
2003-09-02 21:11:22 +00:00
John Criswell
3ac81b74cb Modified the code so that it uses the MakeFileExecutable() method. The new
library code now adds all execute bits that are allowed by the umask value to
the file's current permission bits.

llvm-svn: 8325
2003-09-02 20:17:20 +00:00
John Criswell
9047331cc7 "Help keep our secrets secret."
Added code to respect the umask value.  Before, files were generated world
readable, which may not be desirable for all installations.

llvm-svn: 8215
2003-08-29 14:46:12 +00:00
Chris Lattner
2f00b4ed63 add preliminary support for -export-dynamic
llvm-svn: 8058
2003-08-22 19:18:45 +00:00
Misha Brukman
1b0f71e3f1 Make the bytecode file executable as well for LLEE purposes.
llvm-svn: 7992
2003-08-20 20:38:15 +00:00
Chris Lattner
899f2381f1 Revert my last (accidental) checkin, but keep the typeo fix
llvm-svn: 7879
2003-08-15 04:56:47 +00:00
Chris Lattner
0427dd4f4f rename selection library to selectiondag
llvm-svn: 7878
2003-08-15 04:56:09 +00:00
Chris Lattner
caa0d010d6 Run the simplify CFG pass after instcombine which has the effect of deleting
ALL of the global ctor/dtor stuff if it is not used!

llvm-svn: 6916
2003-06-26 05:29:50 +00:00
Chris Lattner
622df692df Move the instcombine pass before globaldce, so that if globals are made dead by instcombine, that they can be deleted.
llvm-svn: 6910
2003-06-26 04:32:31 +00:00
Chris Lattner
daebdb2358 Funcresolve no longer performs nicification of resolved functions
instcombine does this

llvm-svn: 6787
2003-06-19 17:03:51 +00:00
Chris Lattner
7b1df04748 Add new DAE pass to gccld. It does not add cause any regressions in the test-suite
llvm-svn: 6770
2003-06-18 16:29:02 +00:00
Chris Lattner
67b4289b39 Fix formatting in file
llvm-svn: 6398
2003-05-29 15:13:15 +00:00
Chris Lattner
c8e346caeb Add compatibility option
llvm-svn: 6354
2003-05-27 19:15:11 +00:00
Brian Gaeke
b599881570 gccld.cpp:
Fix typo in header.
 Add IsArchive static method.
 Roll LoadLibraryFromDirectory() into LoadLibrary(), and factor
  LoadLibraryExactName() out of the result. Instead of treating the current
  directory specially, just insert it into LibPaths in the beginning of
  main().
 Make LoadLibrary() take a "search" flag that says whether to search for the
  correct library, or just trust that LibName is right.
 Make LinkLibrary() take a "search" flag, and pass it to LoadLibrary().
 Change the for-loop over InputFilenames to detect ar archives and link them
  in as libraries without searching.
 Change the for-loop over Libraries to explicitly turn on the "search" flag
  to LinkLibrary() that makes LoadLibrary() search for the correct library
  (i.e., when processing -lNAME options.)

llvm-svn: 6316
2003-05-23 20:27:07 +00:00
Chris Lattner
a929e45913 Search LLVM_LIB_SEARCH_PATH for objects to allow it to find crtend.o
Implement minor library linking optimization.

llvm-svn: 6181
2003-05-13 22:14:13 +00:00
Chris Lattner
4a984c606f Make sure to create a target data that matches the Module's target properties.
llvm-svn: 5904
2003-04-24 19:13:02 +00:00
Chris Lattner
cfac8ce5da Add support for allowing the user to extend the GCCLD searchpath
llvm-svn: 5825
2003-04-21 19:53:24 +00:00
Chris Lattner
e3fca9bc04 Eliminate useless duplicate libraries
llvm-svn: 5823
2003-04-19 23:07:33 +00:00
Chris Lattner
8b99be746e Add first support for linking in .a files correctly and minimally, like a real linker does
llvm-svn: 5822
2003-04-19 22:44:38 +00:00
Chris Lattner
f53dee47b8 Add crufty compatibility stuff for ld
llvm-svn: 5813
2003-04-18 23:38:22 +00:00
Chris Lattner
60bb70a682 Use anonymous namespace instead of "static"
Kill using decl

llvm-svn: 5811
2003-04-18 23:01:25 +00:00
Chris Lattner
4fa3b88238 Allow the user to disable the internalize pass
llvm-svn: 5792
2003-04-16 21:43:22 +00:00
Chris Lattner
9a6368cb87 Make stuff compiled with gccld not dump into the debugger if there's a problem
llvm-svn: 5028
2002-12-14 21:28:32 +00:00
Chris Lattner
ea9f0c3c4e Print the tool name when an error comes from so that I can tell which
tool of a pipeline is having issues.

llvm-svn: 3167
2002-07-30 21:43:22 +00:00
Chris Lattner
9099afeef5 *** empty log message ***
llvm-svn: 3087
2002-07-25 16:31:09 +00:00
Chris Lattner
b67e0533b7 *** empty log message ***
llvm-svn: 3044
2002-07-24 17:12:08 +00:00
Chris Lattner
5b4d1e6d6c *** empty log message ***
llvm-svn: 3040
2002-07-23 22:04:43 +00:00
Chris Lattner
24bcbdd155 *** empty log message ***
llvm-svn: 3002
2002-07-23 17:52:38 +00:00
Chris Lattner
99ad379582 *** empty log message ***
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Chris Lattner
a5eae315e5 YEs, we really do want to sort.
llvm-svn: 2810
2002-06-30 16:20:02 +00:00
Anand Shukla
c28bf298bb Changes for 64bit gcc
llvm-svn: 2799
2002-06-25 21:57:48 +00:00
Chris Lattner
d7cbd7d5d2 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner
58c7d2372e Use literal newline instead of endl
llvm-svn: 2668
2002-05-20 19:49:24 +00:00
Chris Lattner
466c66f47a Merge all include/llvm/Transforms/Scalar/* into a single Scalar.h
llvm-svn: 2538
2002-05-07 20:03:27 +00:00
Chris Lattner
e17a86e8a2 Oops, somehow lost a slash. Fixed
llvm-svn: 2524
2002-05-07 18:39:52 +00:00
Chris Lattner
9e1c79995e Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories

llvm-svn: 2523
2002-05-07 18:36:35 +00:00
Chris Lattner
cb8c2d31c2 Straighten out makefiles after moving code to new Transform Utils library
llvm-svn: 2520
2002-05-07 18:18:26 +00:00
Chris Lattner
55a350ffa8 Run the internalize pass to mark all functions except main internal when
linking the final program to allow smarter optimizations

llvm-svn: 2364
2002-04-28 05:49:45 +00:00
Chris Lattner
ded2679ed0 Make sure that there is no case where a signal can occur leaving a partially
written output file.  This is important because crashing testcases often write
part of a file out, and the testing harness decides the file is up-to-date next
time the test is run.

llvm-svn: 2303
2002-04-18 19:55:25 +00:00
Chris Lattner
b78ee9705b * The cleangcc pass is broken into two parts, we only want to
FunctionResolvingPass one.
* We run it *after* the symbol stripping pass so that -strip can be
  pipelined with the constant merging pass or something else if desired.

llvm-svn: 2226
2002-04-10 20:37:47 +00:00
Chris Lattner
4522bc2f02 Add support for the gnu ld -s (strip) option
llvm-svn: 2157
2002-04-08 05:18:12 +00:00
Chris Lattner
0c23bfd2d8 GCCLD actually does transformations to simplify the linked program now.
llvm-svn: 2155
2002-04-08 00:14:58 +00:00
Chris Lattner
8b16900b1b Remove asmwriter library from link line, because the useful contents of it
have been incorporated into the vmcore library.

llvm-svn: 2153
2002-04-07 22:35:30 +00:00
Chris Lattner
bc15ae64dd Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.

llvm-svn: 2144
2002-04-07 20:49:59 +00:00
Chris Lattner
6a2a2e40f3 Echo the right tool name on error
llvm-svn: 1865
2002-03-12 15:41:36 +00:00
Chris Lattner
4489946ab0 * Implement linking to libraries
* Pass arguments to program through shell script

llvm-svn: 1851
2002-03-11 17:49:53 +00:00
Chris Lattner
51e409d5ce Initial Checkin of gccld
llvm-svn: 1578
2002-01-24 19:12:12 +00:00