Commit Graph

3131 Commits

Author SHA1 Message Date
Rafael Espindola
dd76f18f90 Add a pass-through option to the plugin. The use case for this option is to
ask the linker to take another look into some library or object. The case when
one might want to do this is when codegen introduces a new undefined reference.
The canonical example is libgcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18 19:18:58 +00:00
Rafael Espindola
38a979bf95 Don't produce output only if *all* files are unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14 21:20:52 +00:00
Daniel Dunbar
9a56c328b1 llvm-mc: Don't set NO_INSTALL on llvm-mc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 22:00:08 +00:00
Duncan Sands
3982c2c8bc Change another reference to the "indirect callgraph node" to
refer to the "external node" instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 17:39:05 +00:00
Duncan Sands
c0ccc70414 Output "external node" rather than "Indirect CallGraph node" when printing
callgraph SCC's.  This makes it match what the node itself would print.  Also,
"indirect callgraph node" doesn't make sense - it has nothing particularly to
do with indirect calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 17:35:00 +00:00
Nick Lewycky
221aec60a7 Plug a leak in the non-error case by removing one level of indirection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105556 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 21:42:19 +00:00
Dan Gohman
d0a6a8ca31 Run dead type elimination after dead argument elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 20:28:37 +00:00
Dan Gohman
e49a13e726 Use ->isVoidTy().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 20:19:26 +00:00
Rafael Espindola
6c8099243a Misc cleanups to the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 16:45:22 +00:00
Dan Gohman
70972bb5cd No need to special-case structs here; structs are first-class now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-05 00:42:29 +00:00
Dan Gohman
b304ba94db No need to special-case structs here; structs are first-class now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 00:18:06 +00:00
Rafael Espindola
c4b55610d8 Add a emit-llvm option to the plugin and make the path argument to also-emit-llvm optional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 21:11:20 +00:00
Nick Lewycky
662f738ec3 Perfer !string.empty() over string != "".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 17:13:23 +00:00
Nick Lewycky
fc55defb30 Whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 17:10:17 +00:00
Rafael Espindola
c72f8e9f9d Don't preserve all symbols in a .so and instead trust gold to know what is
needed. The result is that now we are able to drop unnecessary symbol from
shared libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 14:45:44 +00:00
Dan Gohman
d27047f87d Eliminate some unnessary Path::exists() calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 20:51:54 +00:00
Dan Gohman
4b7416b75d When handling raw_ostream errors manually, use clear_error() so that
raw_ostream doesn't try to do its own error handling.

Also, close the raw_ostream before checking for errors so that any
errors that occur during closing are caught by the manual check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 20:19:47 +00:00
Dan Gohman
d928fb670f Don't special-case stdout in llvm::WriteBitcodeToFile; just consider
it to be the caller's responsibility to provide a stream in binary
mode. This fixes a layering violation and avoids an outs() call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 20:06:51 +00:00
Dan Gohman
7f924a3116 Don't create an output stream when output is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 19:52:20 +00:00
Dan Gohman
26a7074939 Avoid calling outs() and fouts() when the stream isn't really needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 19:47:36 +00:00
Duncan Sands
4139630212 Apply timeouts and memory limits in more places. In particular, when
bugpoint does "Running the code generator to test for a crash" this
gets you a crash if llc goes into an infinite loop or uses up vast
amounts of memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-24 07:49:55 +00:00
Daniel Dunbar
fdb5a86179 MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 17:44:06 +00:00
Matt Fleming
d8a33ddcfe Currently, createMachOStreamer() is invoked directly in llvm-mc which
isn't ideal if we want to be able to use another object file format.

Add a createObjectStreamer() factory method so that the correct object
file streamer can be instantiated for a given target triple.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21 12:54:43 +00:00
Daniel Dunbar
596490682a Remove dead option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21 00:27:55 +00:00
Rafael Espindola
bbe03f8d29 Avoid renaming loadable modules at install time. Now the gold plugin is named
LLVMgold.so both in both the build and install directories.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-16 03:13:23 +00:00
Dan Gohman
9cc1c18b7b Use regular PassManager instead of FunctionPassManager in opt, since it
isn't doing lazy streaming. This also fixes a missing doFinalization call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14 15:36:54 +00:00
Jakob Stoklund Olesen
18e05b4692 Fix complete badness in bugpoint's IsARMArchitecture() function.
The revision history for this function is interesting, with multiple layers of
wrongness being introduced one at a time.

This fixes a weird issue where bugpoint -run-llc would suddenly exit 13 half way
through isolating a miscompilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-13 17:58:15 +00:00
Rafael Espindola
62bacd69c2 Add an also-emit-llvm option to the gold plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-13 13:39:31 +00:00
Jeffrey Yasskin
6865f29fe7 Fix PR6951 by fixing Module leaks in bugpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 23:25:16 +00:00
Dan Gohman
99dca4fde7 Remove the "WantsWholeFile" concept, as it's no longer needed. CBE
and the others use the regular addPassesToEmitFile hook now, and
llc no longer needs a bunch of redundant code to handle the
whole-file case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 19:57:55 +00:00
Sean Callanan
972bf8dea1 Extended the edis "IsBranch" property to call
instructions as well.  Added support for checking
this to the llvm-mc tester as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 01:27:08 +00:00
Bill Wendling
81043ee5dc The getDefaultSubtargetFeatures method of SubtargetFeature did actually return a
string of features for that target. However LTO was using that string to pass
into the "create target machine" stuff. That stuff needed the feature string to
be in a particular form. In particular, it needed the CPU specified first and
then the attributes. If there isn't a CPU specified, it required it to be blank
-- e.g., ",+altivec". Yuck.

Modify the getDefaultSubtargetFeatures method to be a non-static member
function. For all attributes for a specific subtarget, it will add them in like
normal. It will also take a CPU string so that it can satisfy this horrible
syntax.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 00:30:02 +00:00
Kalle Raiskila
faa95763eb Add command line option --gcc to bugpoint.
Remove sending duplicate of the --gcc-tool-args parameters to gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 07:38:37 +00:00
Chris Lattner
199b66a535 don't pass -f to llc, it doesn't have it anymore. Patch by Kevin Fan (PR7090)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 16:27:04 +00:00
Chris Lattner
5758d4ce46 make -filetype=obj default to emitting its output to foo.obj
when on windows instead of foo.o.  Patch by Nathan Jeffords!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 00:54:20 +00:00
Sean Callanan
be192dd1e9 Fixed a sign-extension bug in the X86 disassembler
that was causing PC-relative branch targets to be
evaluated incorrectly.  Also added support for
checking operand values to the llvm-mc tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 22:47:27 +00:00
Duncan Sands
57b6e9eb6c Remove the -enable-sjlj-eh option, which doesn't do anything.
Remove the -enable-eh option which is only used by the JIT,
and replace it with -jit-enable-eh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 15:36:26 +00:00
Nick Lewycky
8d0e1bcc92 The llc -f flag was removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-29 23:37:44 +00:00
Dan Gohman
281ead4da6 llc no longer requires the -f option to overwrite files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-29 18:46:52 +00:00
Daniel Dunbar
8ae93e77e8 Remove dead option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-29 16:29:02 +00:00
Bill Wendling
c3d0e0c8ef r98363 deleted a '!' when cleaning up whitespace. This caused globals which are
*not* declarations to *not* be placed in the "preserve" list.
<rdar://problem/7870735>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 00:55:25 +00:00
Sean Callanan
a870256d7d Fixed edis to tokenize instructions with no
operands correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-24 01:00:16 +00:00
Sean Callanan
a0f914b6c1 Fixes to edis that mark x86 call targets as
memory operands rather than immediate operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-23 22:17:17 +00:00
Sean Callanan
d8993a3f92 Fixed EDOperand to use the operand type, not the
flags, to determine whether or not the operand is
a memory operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-23 01:56:36 +00:00
Mikhail Glushenkov
c1b202a2b8 Support .a files directly (without -l).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 17:25:38 +00:00
Dan Gohman
43bc70ebef Fix more -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 17:44:03 +00:00
Chris Lattner
2decb22222 introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>.  No functionality change,
but now we have a much tidier interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:42:17 +00:00
Nick Lewycky
4b67bc1e80 Revert r64616 which worked around http://gcc.gnu.org/PR42757 , we just didn't
know it at the time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 04:32:20 +00:00
Dan Gohman
aa08c55e18 Create an exports file, so that the plugin only exports the onload symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 00:43:25 +00:00
Dan Gohman
f6920033e0 Make things static that don't need to be referenced from outside the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101430 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 00:42:57 +00:00