Bill Wendling
05a4c0b1f2
Introducing the "linker_weak" linkage type. This will be used for Objective-C
...
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:
.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1
This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".
llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Duncan Sands
d0286618b5
Remove variables that are written by not read.
...
llvm-svn: 107126
2010-06-29 11:07:47 +00:00
Devang Patel
0c927a80fe
Use ValueMap instead of DenseMap.
...
The ValueMapper used by various cloning utility maps MDNodes also.
llvm-svn: 106706
2010-06-24 00:33:28 +00:00
Rafael Espindola
ea22615ccd
Add an extra-library-path option to the plugin. This is used to support
...
having a library both as bitcode and native code. We want to use the
bitcode first, but if codegen produces new undefined references we have to use
the native code to satisfy those references.
Gold has no notion of bitcode and native search directories, so instead it has
an API where the plugin can instruct it to look for the libraries it is passing
to it. This patch uses that API.
llvm-svn: 106674
2010-06-23 20:20:59 +00:00
Rafael Espindola
705c2bd4c3
add_input_file and add_input_library now take const arguments, remove the
...
const_cast.
llvm-svn: 106410
2010-06-21 02:23:12 +00:00
Rafael Espindola
cf8f391d49
Save more temps with -save-temps.
...
llvm-svn: 106409
2010-06-21 02:17:36 +00:00
Rafael Espindola
d7bfa3a0f7
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.
llvm-svn: 106303
2010-06-18 19:18:58 +00:00
Rafael Espindola
23f533848f
Don't produce output only if *all* files are unused.
...
llvm-svn: 105962
2010-06-14 21:20:52 +00:00
Daniel Dunbar
9800936127
llvm-mc: Don't set NO_INSTALL on llvm-mc.
...
llvm-svn: 105837
2010-06-11 22:00:08 +00:00
Duncan Sands
cd6523c879
Change another reference to the "indirect callgraph node" to
...
refer to the "external node" instead.
llvm-svn: 105731
2010-06-09 17:39:05 +00:00
Duncan Sands
1585c44a59
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.
llvm-svn: 105730
2010-06-09 17:35:00 +00:00
Nick Lewycky
ff1e3db00e
Plug a leak in the non-error case by removing one level of indirection.
...
llvm-svn: 105556
2010-06-07 21:42:19 +00:00
Dan Gohman
96649dea39
Run dead type elimination after dead argument elimination.
...
llvm-svn: 105552
2010-06-07 20:28:37 +00:00
Dan Gohman
94bc7c650c
Use ->isVoidTy().
...
llvm-svn: 105550
2010-06-07 20:19:26 +00:00
Rafael Espindola
b93be14fa0
Misc cleanups to the gold plugin.
...
llvm-svn: 105534
2010-06-07 16:45:22 +00:00
Dan Gohman
a4614e30ec
No need to special-case structs here; structs are first-class now.
...
llvm-svn: 105513
2010-06-05 00:42:29 +00:00
Dan Gohman
b03730d276
No need to special-case structs here; structs are first-class now.
...
llvm-svn: 105442
2010-06-04 00:18:06 +00:00
Rafael Espindola
ee11d1e6a5
Add a emit-llvm option to the plugin and make the path argument to also-emit-llvm optional.
...
llvm-svn: 105414
2010-06-03 21:11:20 +00:00
Nick Lewycky
14c5598c42
Perfer !string.empty() over string != "".
...
llvm-svn: 105397
2010-06-03 17:13:23 +00:00
Nick Lewycky
04d3d4e46f
Whitespace cleanup.
...
llvm-svn: 105395
2010-06-03 17:10:17 +00:00
Rafael Espindola
9d46e81a8b
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.
llvm-svn: 105389
2010-06-03 14:45:44 +00:00
Dan Gohman
6163340daf
Eliminate some unnessary Path::exists() calls.
...
llvm-svn: 104888
2010-05-27 20:51:54 +00:00
Dan Gohman
35206e98e6
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.
llvm-svn: 104882
2010-05-27 20:19:47 +00:00
Dan Gohman
d13e45d0ec
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.
llvm-svn: 104878
2010-05-27 20:06:51 +00:00
Dan Gohman
5dc7fed6ab
Don't create an output stream when output is disabled.
...
llvm-svn: 104875
2010-05-27 19:52:20 +00:00
Dan Gohman
bf0dac1735
Avoid calling outs() and fouts() when the stream isn't really needed.
...
llvm-svn: 104873
2010-05-27 19:47:36 +00:00
Duncan Sands
f2bec8edf6
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.
llvm-svn: 104485
2010-05-24 07:49:55 +00:00
Daniel Dunbar
eb23d9ac22
MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.
...
llvm-svn: 104463
2010-05-23 17:44:06 +00:00
Matt Fleming
5d40d53cab
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.
llvm-svn: 104318
2010-05-21 12:54:43 +00:00
Daniel Dunbar
8824824171
Remove dead option.
...
llvm-svn: 104303
2010-05-21 00:27:55 +00:00
Rafael Espindola
aa7f3b0561
Avoid renaming loadable modules at install time. Now the gold plugin is named
...
LLVMgold.so both in both the build and install directories.
llvm-svn: 103897
2010-05-16 03:13:23 +00:00
Dan Gohman
79033132d7
Use regular PassManager instead of FunctionPassManager in opt, since it
...
isn't doing lazy streaming. This also fixes a missing doFinalization call.
llvm-svn: 103774
2010-05-14 15:36:54 +00:00
Jakob Stoklund Olesen
ed8dd53c85
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.
llvm-svn: 103721
2010-05-13 17:58:15 +00:00
Rafael Espindola
bc6fabbd3e
Add an also-emit-llvm option to the gold plugin.
...
llvm-svn: 103714
2010-05-13 13:39:31 +00:00
Jeffrey Yasskin
6768d483a0
Fix PR6951 by fixing Module leaks in bugpoint.
...
llvm-svn: 103523
2010-05-11 23:25:16 +00:00
Dan Gohman
5f389dacab
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.
llvm-svn: 103492
2010-05-11 19:57:55 +00:00
Sean Callanan
e79322802a
Extended the edis "IsBranch" property to call
...
instructions as well. Added support for checking
this to the llvm-mc tester as well.
llvm-svn: 103454
2010-05-11 01:27:08 +00:00
Bill Wendling
ed91169004
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.
llvm-svn: 103451
2010-05-11 00:30:02 +00:00
Kalle Raiskila
482cc7f93a
Add command line option --gcc to bugpoint.
...
Remove sending duplicate of the --gcc-tool-args parameters to gcc.
llvm-svn: 103397
2010-05-10 07:38:37 +00:00
Chris Lattner
b064c6f5a3
don't pass -f to llc, it doesn't have it anymore. Patch by Kevin Fan (PR7090)
...
llvm-svn: 103263
2010-05-07 16:27:04 +00:00
Chris Lattner
5fc1e951f6
make -filetype=obj default to emitting its output to foo.obj
...
when on windows instead of foo.o. Patch by Nathan Jeffords!
llvm-svn: 103150
2010-05-06 00:54:20 +00:00
Sean Callanan
7edf493591
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.
llvm-svn: 103128
2010-05-05 22:47:27 +00:00
Duncan Sands
153ad3b903
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.
llvm-svn: 102865
2010-05-02 15:36:26 +00:00
Nick Lewycky
31e338dba8
The llc -f flag was removed.
...
llvm-svn: 102670
2010-04-29 23:37:44 +00:00
Dan Gohman
c147c83a95
llc no longer requires the -f option to overwrite files.
...
llvm-svn: 102651
2010-04-29 18:46:52 +00:00
Daniel Dunbar
780c6fe8ba
Remove dead option.
...
llvm-svn: 102621
2010-04-29 16:29:02 +00:00
Bill Wendling
8a16d236db
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>
llvm-svn: 102405
2010-04-27 00:55:25 +00:00
Sean Callanan
0da87c200d
Fixed edis to tokenize instructions with no
...
operands correctly.
llvm-svn: 102227
2010-04-24 01:00:16 +00:00
Sean Callanan
72d3d36188
Fixes to edis that mark x86 call targets as
...
memory operands rather than immediate operands.
llvm-svn: 102217
2010-04-23 22:17:17 +00:00
Sean Callanan
a50d7d5434
Fixed EDOperand to use the operand type, not the
...
flags, to determine whether or not the operand is
a memory operand.
llvm-svn: 102158
2010-04-23 01:56:36 +00:00
Mikhail Glushenkov
e652c68942
Support .a files directly (without -l).
...
llvm-svn: 101789
2010-04-19 17:25:38 +00:00
Dan Gohman
b66acedc8a
Fix more -Wcast-qual warnings.
...
llvm-svn: 101656
2010-04-17 17:44:03 +00:00
Chris Lattner
6a038be777
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.
llvm-svn: 101558
2010-04-16 22:42:17 +00:00
Nick Lewycky
e96e382131
Revert r64616 which worked around http://gcc.gnu.org/PR42757 , we just didn't
...
know it at the time.
llvm-svn: 101439
2010-04-16 04:32:20 +00:00
Dan Gohman
499f38cfcb
Create an exports file, so that the plugin only exports the onload symbol.
...
llvm-svn: 101431
2010-04-16 00:43:25 +00:00
Dan Gohman
792df0f4ca
Make things static that don't need to be referenced from outside the file.
...
llvm-svn: 101430
2010-04-16 00:42:57 +00:00
Dan Gohman
55f814fdc4
Make the export files absolute paths, and change Makefile.rules
...
to expect them this way, to fix srcdir!=objdir builds.
llvm-svn: 101414
2010-04-15 23:08:00 +00:00
Dan Gohman
bfbdc27d54
Generalize the EXPORTED_SYMBOL_FILE concept in the Makefiles to work with
...
native linking export files, including running sed to prepend underscores
on darwin, and make use of it in libLTO and libEnhancedDisassembly.
Remove the leading underscores from library export files so that they
work with the new EXPORTED_SYMBOL_FILE support.
llvm-svn: 101399
2010-04-15 20:54:25 +00:00
Benjamin Kramer
c57e4c744b
Simplify ".bc" detection.
...
llvm-svn: 101365
2010-04-15 11:33:14 +00:00
Daniel Dunbar
3bf3e0e63a
Remove unnecessary uses of <iostream>.
...
llvm-svn: 101338
2010-04-15 03:47:24 +00:00
Chris Lattner
f827b4be59
fix a crash on "lli ex" or any other file whose name is exactly two
...
characters long.
llvm-svn: 101336
2010-04-15 03:32:19 +00:00
Nick Lewycky
3720e3e45f
Don't forget cmake!
...
llvm-svn: 101234
2010-04-14 05:35:20 +00:00
Nick Lewycky
2874312841
Remove accidentally committed cruft.
...
llvm-svn: 101230
2010-04-14 04:46:11 +00:00
Nick Lewycky
396b2fc686
Bugpoint no longer uses exceptions.
...
llvm-svn: 101228
2010-04-14 04:40:31 +00:00
Douglas Gregor
a672ffc669
Unbreak CMake build by improving the EnhancedDisassembly makefile a
...
bit (we're not trying to build a shared library yet) and generating
the X86GenEDInfo.inc and ARMGenEDInfo.inc files as necessary.
llvm-svn: 101188
2010-04-13 22:47:43 +00:00
Sean Callanan
29a7152676
Fixed a nasty layering violation in the edis source
...
code. It used to #include the enhanced disassembly
information for the targets it supported straight
out of lib/Target/{X86,ARM,...} but now it uses a
new interface provided by MCDisassembler, and (so
far) implemented by X86 and ARM.
Also removed hacky #define-controlled initialization
of targets in edis. If clients only want edis to
initialize a limited set of targets, they can set
--enable-targets on the configure command line.
llvm-svn: 101179
2010-04-13 21:21:57 +00:00
Ted Kremenek
02e55f4a52
Add CMake support for 'edis'.
...
llvm-svn: 101177
2010-04-13 20:52:50 +00:00
Chris Lattner
f3ed0658ed
Make the disassembler respect the assembler dialect when printing instructions,
...
patch by Marius Wachtler!
llvm-svn: 101160
2010-04-13 18:41:17 +00:00
Sean Callanan
5066bc60be
Build system fix to make llvm-mc properly build
...
after edis. Really, there ought to be some
mechanism to ensure that PARALLEL_DIRS get built
after DIRS.
llvm-svn: 101095
2010-04-12 23:55:28 +00:00
Sean Callanan
7d250f2b65
Build system fixes. llvm-mc depends on
...
libEnhancedDisassembly, so we now build the
static library in all cases (although the shared
library is only built when requested/possible).
Also, fixed a bug where edis wasn't properly
initializing the targets it uses.
llvm-svn: 101072
2010-04-12 21:55:49 +00:00
Sean Callanan
d9474b01ae
Bug fix: made the enhanced disassembler's link
...
flags work properly when EDIS_VERSION is defined
llvm-svn: 101063
2010-04-12 20:23:08 +00:00
Sean Callanan
033fde84b5
Second try at integrating the edis tester. This
...
time I use the LIBS variable, which is not subject
to a %.a -> -l% transformation, to link llvm-mc
against libEnhancedDisassembly.
llvm-mc -edis works the same as llvm-mc
-disassemble, but outputs tokens and operands.
llvm-svn: 101058
2010-04-12 19:43:00 +00:00
Benjamin Kramer
033019690a
Boolify.
...
llvm-svn: 101035
2010-04-12 12:22:19 +00:00
Nick Lewycky
096fd1e0a6
Remove use of exceptions from bugpoint. No deliberate functionality change!
...
llvm-svn: 101013
2010-04-12 05:08:25 +00:00
Nick Lewycky
87bd8ff991
Remove dead argument and clean whitespace. No functionality change.
...
llvm-svn: 100954
2010-04-10 23:18:13 +00:00
Sean Callanan
2ec5514c48
Updated the edis build mechanism to allow for builds
...
that do not build some (or all) of the targets that
edis supports.
llvm-svn: 100910
2010-04-10 00:48:10 +00:00
Chris Lattner
bc47db9f8e
revert r100842 which broke several of the build bots.
...
llvm-svn: 100848
2010-04-09 04:24:20 +00:00
Sean Callanan
6a94ce3daf
Added a tester for the enhanced disassembler,
...
integrated into the llvm-mc testing tool.
llvm-svn: 100842
2010-04-09 01:43:16 +00:00
Sean Callanan
736f3ecc4c
Bugfixes for edis. Code to initialize instruction
...
state was being executed too lazily, and the LLVM
assembly syntax for the disassembler was not being
written into the proper disassembler state variable.
llvm-svn: 100830
2010-04-09 00:11:15 +00:00
Sean Callanan
dcd7a375dd
Added support for ARM disassembly to edis.
...
I also added a rule to the ARM target's Makefile to
build the ARM-specific instruction information table
for the enhanced disassembler.
I will add the test harness for all this stuff in
a separate commit.
llvm-svn: 100735
2010-04-08 00:48:21 +00:00
Chris Lattner
5b4c7591ac
add .o file writing for inline asm in llc. Here's a silly
...
demo:
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
<inline asm>:1:2: error: unrecognized instruction
abc incl %eax
^
LLVM ERROR: Error parsing inline asm
Only problem seems to be that the parser finalizes OutStreamer
at the end of the first inline asm, which isn't what we want.
For example:
$ cat asm.c
int foo(int X) {
__asm__ ("incl %0" : "+r" (X));
return X;
}
$ clang asm.c -S -o - -emit-llvm | llc
...
subq $8, %rsp
movl %edi, (%rsp)
movl %edi, %eax
## InlineAsm Start
incl %eax
## InlineAsm End
movl %eax, (%rsp)
movl %eax, 4(%rsp)
addq $8, %rsp
ret
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000 subq $0x08,%rsp
0000000000000004 movl %edi,(%rsp)
0000000000000007 movl %edi,%eax
0000000000000009 incl %eax
$
don't stop at inc!
llvm-svn: 100491
2010-04-05 23:11:24 +00:00
Chris Lattner
8b9eaae8d5
tidy #includes.
...
llvm-svn: 100489
2010-04-05 23:07:18 +00:00
Chris Lattner
269737461d
stringref-ize the MemoryBuffer::get apis. This requires
...
a co-committed clang patch.
llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Chris Lattner
8fb6be1886
fix an ugly wart in the MCInstPrinter api where the
...
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.
llvm-svn: 100307
2010-04-04 05:04:31 +00:00
Chris Lattner
fb18894982
remove some extraneous casts
...
llvm-svn: 100287
2010-04-03 21:03:50 +00:00
Chris Lattner
c2f273b52d
Add special case bitcode support for DebugLoc. This avoids
...
having the bitcode writer materialize mdnodes for all the
debug location tuples when writing out the bc file and
stores the information in a more compact form. For example,
the -O0 -g bc file for combine.c in 176.gcc shrinks from
739392 to 512096 bytes.
This concludes my planned short-term debug info work.
llvm-svn: 100261
2010-04-03 02:17:50 +00:00
Mikhail Glushenkov
f4668a70f5
Pass -shared to the linker.
...
llvm-svn: 100260
2010-04-03 02:00:03 +00:00
Chris Lattner
6fb3f169c8
add a couple missing enum names.
...
llvm-svn: 100257
2010-04-03 01:05:24 +00:00
Sean Callanan
ea4f4644ee
Updated the install location for EnhancedDisassembly
...
on Mac OS X to use @rpath rather than an absolute
path. Also allowed the version to be set using an
environment variable.
llvm-svn: 100163
2010-04-02 00:53:42 +00:00
Mikhail Glushenkov
a44a629d14
Pass -m32/-m64 to assembler.
...
llvm-svn: 100064
2010-03-31 23:51:55 +00:00
Dan Gohman
ad125e679e
Fix llvm-ld to clean up its output files in case of an error.
...
llvm-svn: 99915
2010-03-30 19:56:41 +00:00
Chris Lattner
64d472ae54
revert r99719 which is breaking the botz.
...
llvm-svn: 99721
2010-03-27 18:01:10 +00:00
Dan Gohman
542d5a3602
Make llvm-ld remove its output files in the event of an error.
...
llvm-svn: 99719
2010-03-27 16:49:51 +00:00
Dan Gohman
4651d3f3ef
No need to check the same condition twice.
...
llvm-svn: 99716
2010-03-27 16:36:08 +00:00
Daniel Dunbar
d04906b49e
llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
...
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.
llvm-svn: 99563
2010-03-25 22:49:09 +00:00
Dan Gohman
7f76052c8c
Trim #includes.
...
llvm-svn: 99416
2010-03-24 19:56:17 +00:00
Dan Gohman
475a978a96
It's not necessary to call raw_ostream::close explicitly on automatic
...
raw_ostream variables immediately before they go out of scope.
llvm-svn: 99413
2010-03-24 19:00:02 +00:00
Daniel Dunbar
b07aeb1c00
llvm-mc: Support -filetype=null, for timing purposes.
...
llvm-svn: 99349
2010-03-23 23:47:12 +00:00
Bill Wendling
a33116ece2
Remove if DISABLED not if not DISABLED...
...
llvm-svn: 99343
2010-03-23 23:09:03 +00:00
Bill Wendling
9a977ce8ce
Use "DISABLE_EDIS" to disable building "edis" explicitly. Don't build it for
...
Apple-style builds.
llvm-svn: 99336
2010-03-23 22:15:33 +00:00
Chris Lattner
9870d15fb7
make sure to delete the llvm module before calling llvm_shutdown,
...
this fixes crashes in error cases, PR6683
llvm-svn: 99334
2010-03-23 21:59:43 +00:00
Dan Gohman
396921fedd
llc doesn't need LinkAllVMCore.
...
llvm-svn: 99186
2010-03-22 16:59:44 +00:00
Jeffrey Yasskin
da98ae0163
Avoid leaking the FunctionPassManager from opt.
...
llvm-svn: 99180
2010-03-22 15:56:04 +00:00
Jeffrey Yasskin
94ecd53a3a
Free all Constants in ~LLVMConstantImpl. We avoid assertion failures
...
by dropping all references from all constants that can use other
constants before trying to destroy any of them.
I also had to free bugpoint's Module in ~BugDriver().
llvm-svn: 99160
2010-03-22 05:23:37 +00:00
Daniel Dunbar
78c65dad40
llvm-mc: Fix MCInstPrinter memory leaks.
...
llvm-svn: 99101
2010-03-20 22:36:35 +00:00
Daniel Dunbar
760b4c67b1
llvm-mc: Fix memory leak of MCAsmInfo.
...
llvm-svn: 99098
2010-03-20 22:36:25 +00:00
Daniel Dunbar
b478edff7c
llvm-mc: Fix target selection for --disassemble to use GetTarget.
...
llvm-svn: 98973
2010-03-19 18:07:50 +00:00
Chris Lattner
32452cf12f
fix an MCInstPrinter leak that jyasskin pointed out:
...
createAsmStreamer now takes ownership of the instprinter.
llvm-svn: 98939
2010-03-19 05:48:53 +00:00
Jeffrey Yasskin
16289314f6
Bugpoint's default memory limit (100MB) was too low for valgrind, so
...
this patch raises the default to 800MB when valgrind's active. 800
was chosen semi-arbitrarily.
llvm-svn: 98905
2010-03-19 00:09:28 +00:00
Sean Callanan
233132382a
Changed install_name for libEnhancedDisassembly.dylib on
...
Mac OS X to match current install location. This has no
effect on other platforms.
llvm-svn: 98773
2010-03-17 22:01:36 +00:00
Chris Lattner
75c1269e40
add support for bugpointing the integrated assembler. Something like this
...
works for me: bugpoint Output/bisort.llvm.bc -run-llc-ia -safe-run-llc
This uses llc with the integrated assembler as the test compiler and llc
without it as the safe compiler.
llvm-svn: 98618
2010-03-16 06:41:47 +00:00
Daniel Dunbar
661d89861c
llvm-mc: Delete output files on error.
...
llvm-svn: 98445
2010-03-13 19:31:47 +00:00
Daniel Dunbar
33c92a1a88
llvm-mc: Support -n, useful for comparing -integrated-as output since the
...
compiler may not lead with the text section.
llvm-svn: 98418
2010-03-13 02:20:57 +00:00
Daniel Dunbar
92c67d1d56
llvm-mc: Support -arch as a simplified form of -triple.
...
llvm-svn: 98417
2010-03-13 02:20:38 +00:00
Chris Lattner
c101ad818c
give Mangler access to TargetData.
...
llvm-svn: 98378
2010-03-12 20:47:28 +00:00
Chris Lattner
956582f876
make the mangler take an MCContext instead of an MAI.
...
No functionality change.
llvm-svn: 98363
2010-03-12 18:44:54 +00:00
Chris Lattner
f4dce6a6d8
remove MAI argument from createAsmStreamer since it
...
can get it from the context now.
llvm-svn: 98361
2010-03-12 18:28:53 +00:00
Chris Lattner
debc026df2
change MCContext to always have an MCAsmInfo.
...
llvm-svn: 98293
2010-03-11 22:53:35 +00:00
Daniel Dunbar
687d99cfa8
MC: Provide MCAssembler with a TargetAsmBackend.
...
llvm-svn: 98222
2010-03-11 01:34:27 +00:00
Duncan Sands
26e65e7ee8
Attempt to fix random build failures seen when doing highly
...
parallel builds: the gold plugin fails to link because the lto
library is in the middle of being written out by the linker.
llvm-svn: 98054
2010-03-09 09:03:21 +00:00
Mikhail Glushenkov
67cac93b81
Make it not an error to specify -O* options several times.
...
As in 'llvmc -O2 -O2 test.c'.
llvm-svn: 97787
2010-03-05 04:46:39 +00:00
Chris Lattner
a867bc28df
apparently if gold is around lto needs to be part of DIRS.
...
llvm-svn: 97780
2010-03-05 02:34:34 +00:00
Chris Lattner
41804bf422
Only build libedis if ENABLE_SHARED is specified, just like liblto.
...
Don't build any of the dynamic library stuff on cygwin/mingw.
llvm-svn: 97771
2010-03-05 00:59:18 +00:00
Chris Lattner
bbffb2392c
liblto and gold don't need to be built in serial
...
llvm-svn: 97770
2010-03-05 00:54:45 +00:00
Erick Tryzelaar
4e7593750d
Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153.
...
We need this so can not bake DESTDIR into the O'Caml symlinks.
llvm-svn: 97743
2010-03-04 20:56:19 +00:00
Dan Gohman
ed398abb31
Make llc opt into the addPassesToEmitFile verify pass.
...
llvm-svn: 97502
2010-03-01 21:45:21 +00:00
Chris Lattner
e006dfe764
don't build edis if the x86 target isn't enabld.
...
llvm-svn: 97268
2010-02-26 21:26:33 +00:00
Sanjiv Gupta
7ede252650
disable-mem2reg and disable-gvn options should not be used by the driver.
...
llvm-svn: 97236
2010-02-26 18:38:44 +00:00
Jeffrey Yasskin
f073920691
Try r96559 for the third time. This time the shared library is only built if
...
--enable-shared is passed to configure.
llvm-svn: 97119
2010-02-25 06:34:33 +00:00
Jeffrey Yasskin
82c2f2fd24
Roll back r96959 again.
...
llvm-svn: 96981
2010-02-23 20:53:37 +00:00
Jeffrey Yasskin
0c478ab8af
Oops. Pass -lgcc _only_ on ARM, not on everything except ARM.
...
llvm-svn: 96965
2010-02-23 18:40:48 +00:00
Jeffrey Yasskin
e653785a3d
Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 of
...
the examples shared to make sure the shared library keeps working.
llvm-svn: 96959
2010-02-23 18:10:07 +00:00
Mikhail Glushenkov
21c7a63ce6
Fix -mtune forwarding.
...
llvm-svn: 96944
2010-02-23 14:29:42 +00:00
Mikhail Glushenkov
4a7ee0bea5
Update mcc16 and the ancient Clang plugin for the 'cmd_line' -> 'command' change.
...
llvm-svn: 96933
2010-02-23 09:59:30 +00:00
Mikhail Glushenkov
3cd3e0df5f
Input files with empty suffixes must be passed to linker.
...
llvm-svn: 96927
2010-02-23 09:05:21 +00:00
Mikhail Glushenkov
8a3109fb8e
Support -Xlinker et al.
...
llvm-svn: 96926
2010-02-23 09:05:15 +00:00
Mikhail Glushenkov
e14b9c7b16
Typo.
...
llvm-svn: 96924
2010-02-23 09:05:06 +00:00
Mikhail Glushenkov
232ae779ee
Correct option forwarding: initial implementation.
...
Does not work, but the infrastructure changes are in place.
llvm-svn: 96920
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
328ae37049
Precompiled headers: initial support.
...
llvm-svn: 96919
2010-02-23 09:04:33 +00:00
Mikhail Glushenkov
d030cced3d
New experimental/undocumented feature: 'works_on_empty'.
...
For now, just enough support to make -filelist work.
llvm-svn: 96918
2010-02-23 09:04:28 +00:00
Mikhail Glushenkov
e213e3cbb6
Support '-install_name'.
...
llvm-svn: 96917
2010-02-23 09:04:18 +00:00
Daniel Dunbar
ad1465c21b
Kill off LLVMGCCARCH and LLVMGCC_VERSION make variables.
...
llvm-svn: 96909
2010-02-23 07:56:31 +00:00
Daniel Dunbar
9774a591a4
Kill off LLVMGCC_MAJVERS make variable.
...
llvm-svn: 96907
2010-02-23 07:56:22 +00:00
Duncan Sands
b7bb8ab12e
Uniformize the way these options are printed. Requested by
...
Russell Wallace.
llvm-svn: 96580
2010-02-18 14:37:52 +00:00
Benjamin Kramer
c855708633
Avoid a dangling pointer dereference, PassManager::add can delete the Pass.
...
llvm-svn: 96576
2010-02-18 12:57:05 +00:00
Jeffrey Yasskin
e4b750f830
Roll back the shared library, r96559. It broke two darwins and arm, mysteriously.
...
llvm-svn: 96569
2010-02-18 04:43:02 +00:00
Jeffrey Yasskin
64b33dd9b7
Add a shared library for LLVM, named libLLVM2.7svn.(so|dylib), and add an
...
--enable-shared configure flag to have the tools linked shared. (2.7svn is just
$(LLVMVersion) so it'll change to "2.7" in the release.) Always link the
example programs shared to test that the shared library keeps working.
On my mac laptop, Debug libLLVM2.7svn.dylib is 39MB, and opt (for example) is
16M static vs 440K shared.
Two things are less than ideal here:
1) The library doesn't include any version information. Since we expect to break
the ABI with every release, this shouldn't be much of a problem. If we do
release a compatible 2.7.1, we may be able to hack its library to work with
binaries compiled against 2.7.0, or we can just ask them to recompile. I'm
hoping to get a real packaging expert to look at this for the 2.8 release.
2) llvm-config doesn't yet have an option to print link options for the shared
library. I'll add this as a subsequent patch.
llvm-svn: 96559
2010-02-18 02:36:02 +00:00
Duncan Sands
1b33dd3c83
There are two ways of checking for a given type, for example isa<PointerType>(T)
...
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.
llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Mikhail Glushenkov
d823a2e8ee
Support some more Darwin-only options.
...
We really need a conditional compilation mechanism...
llvm-svn: 96129
2010-02-13 22:37:13 +00:00
Mikhail Glushenkov
6de0557115
Support -mfix-and-continue properly.
...
llvm-svn: 96128
2010-02-13 22:37:00 +00:00
Mikhail Glushenkov
3b9bef0cfb
Revert r94752, turns out we don't need to touch these options.
...
llvm-svn: 96127
2010-02-13 22:36:43 +00:00
Chris Lattner
946403d05f
give MCCodeEmitters access to the current MCContext.
...
llvm-svn: 96038
2010-02-12 23:12:47 +00:00
Dan Gohman
8c140d394f
Add support to llvm-extract for extracting multiple functions and/or
...
multiple global variables at a time.
llvm-svn: 95825
2010-02-10 23:58:53 +00:00
Daniel Dunbar
75df429af0
llvm-mc: Remove --show-fixups and always show as part of --show-encoding.
...
Also, fix a silly memory leak.
llvm-svn: 95752
2010-02-10 01:41:14 +00:00
Daniel Dunbar
1b050afd4e
llvm-mc: Add --show-fixups option, for displaying the instruction fixup information in the asm comments.
...
llvm-svn: 95710
2010-02-09 23:00:14 +00:00
Jakob Stoklund Olesen
e307c6e94b
Oops.
...
llvm-svn: 95670
2010-02-09 17:24:21 +00:00
Jakob Stoklund Olesen
2a84a7ccbd
clang test suite
...
llvm-svn: 95667
2010-02-09 17:20:03 +00:00
Sean Callanan
4ea988636a
Updated the enhanced disassembly library to produce
...
whitespace tokens in the right places.
llvm-svn: 95645
2010-02-09 01:50:54 +00:00
Sean Callanan
97fa88ebf2
Fixed a problem where the enhanced disassembly
...
library was reporting inaccurate token IDs.
llvm-svn: 95639
2010-02-09 01:00:18 +00:00
Sean Callanan
dee7f5dcd4
Added header file declarations and .exports entries
...
for the new APIs offered by the enhanced disassembler
for inspecting operands.
llvm-svn: 95606
2010-02-08 23:34:25 +00:00
Sanjiv Gupta
4a56e894a7
Fixed build error for redefinition.
...
llvm-svn: 95532
2010-02-08 06:08:32 +00:00
Sanjiv Gupta
09a80bb7d9
Add uppercase and lowercase part defines in driver.
...
Use a temp dir with a unique name in the current dir itself.
Use forward_value instead of unpack_values.
llvm-svn: 95530
2010-02-08 05:56:37 +00:00
Jeffrey Yasskin
1604115c5a
Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
...
llc.cpp also defined these flags, meaning that when I linked all of LLVM's
libraries into a single shared library, llc crashed on startup with duplicate
flag definitions. This patch passes them through the EngineBuilder into
JIT::selectTarget().
llvm-svn: 95390
2010-02-05 16:19:36 +00:00
Torok Edwin
37e451649c
New flag for GenLibDeps, and llvm-config-perobjincl.
...
This allows to show the explicit files that need to be built/linked to get an
LLVM component.
llvm-svn: 95300
2010-02-04 09:31:35 +00:00
Sean Callanan
7662f4139b
Filled in a few new APIs for the enhanced
...
disassembly library that provide access to
instruction information, and fixed ambiguous
wording in the comments for the header.
llvm-svn: 95274
2010-02-04 01:43:08 +00:00
Daniel Dunbar
d997cd69cd
llvm-mc: Add --show-inst option, for showing the MCInst inline with the assembly
...
output.
llvm-svn: 95227
2010-02-03 18:18:30 +00:00
Chris Lattner
e8811c3222
change addPassesToEmitFile to return true on failure instead of its input,
...
add -filetype=null for performance testing and remove -filetype=dynlib,
which isn't planned to be implemented.
llvm-svn: 95202
2010-02-03 05:55:08 +00:00
Sean Callanan
0139e2193d
Fixed the disassembler so it accepts multiple
...
instructions on a single line. Also made it a
bit more forgiving when it reports errors.
llvm-svn: 95197
2010-02-03 03:46:41 +00:00
Chris Lattner
78f57ac8dc
Hook up -filetype=obj through the MachO streamer. Here's a demo:
...
$ cat t.ll
@g = global i32 42
$ llc t.ll -o t.o -filetype=obj
$ nm t.o
00000000 D _g
There is still a ton of work left. Instructions are not being encoded
yet apparently.
llvm-svn: 95162
2010-02-02 23:57:42 +00:00
Chris Lattner
7dd4ad3ced
Remove a bunch of stuff around the edges of the ELF writer.
...
Now the only use of the ELF writer is the JIT, which won't be
easy to fix in the short term. :( :(
llvm-svn: 95148
2010-02-02 22:31:11 +00:00
Chris Lattner
7d162688a9
eliminate FileModel::Model, just use CodeGenFileType. The client
...
of the code generator shouldn't care what object format a target
uses.
llvm-svn: 95124
2010-02-02 21:06:45 +00:00
Sean Callanan
8546911370
...and fixed the Makefile.
...
llvm-svn: 95119
2010-02-02 20:20:30 +00:00
Sean Callanan
d451ee255b
Renamed the ed directory to edis, as suggested
...
yesterday. This eliminates possible confusion
about what exactly in this directory; the name
is still short, though.
llvm-svn: 95118
2010-02-02 20:11:23 +00:00
Chris Lattner
ff8ba8fc79
eliminate all forms of addPassesToEmitMachineCode except
...
the one used by the JIT. Remove all forms of
addPassesToEmitFileFinish except the one used by the static
code generator. Inline the remaining version of
addPassesToEmitFileFinish into its only caller.
llvm-svn: 95109
2010-02-02 19:14:27 +00:00
Chris Lattner
eef9f9ccf9
remove dead code, we're requesting TargetMachine::AssemblyFile here.
...
llvm-svn: 95105
2010-02-02 19:03:39 +00:00
Sean Callanan
269ee798c8
Removed an unnecessary class from the EDDisassembler
...
implementation. Also made sure that the register maps
were created during disassembler initialization.
llvm-svn: 95051
2010-02-02 02:18:20 +00:00
Sean Callanan
d41b7acd7a
Changed to Chris Lattner's suggested approach, which
...
merely stubs out the blocks-based disassembly functions
if the library wasn't built with blocks, which allows a
constant .exports file and also properly deals with
situations in which the compiler used to build a client
is different from the compiler used to build the library.
llvm-svn: 95034
2010-02-02 00:04:46 +00:00
Nate Begeman
4d489ea053
Kill the Mach-O writer, and temporarily make filetype=obj an error.
...
The MCStreamer based assemblers will take over for this functionality.
llvm-svn: 95033
2010-02-01 23:56:58 +00:00
Sean Callanan
69ecef0859
Fix for builds with separate source and build
...
directories (like, oh, say, any multistage build)
llvm-svn: 95028
2010-02-01 23:27:57 +00:00
Sean Callanan
25ef2910a9
Updated to use the proper .exports file for the
...
target platform, depending on whether the target
supports the blocks API or not
llvm-svn: 95024
2010-02-01 23:01:38 +00:00
Sean Callanan
ba52e5e86a
Rollback on including blocks functionality in .exports
...
because some platforms don't support blocks and then
break because the symbols aren't present
llvm-svn: 95011
2010-02-01 21:57:50 +00:00
Sean Callanan
ad75f823d7
Whoops, left some debugging code in that broke
...
a buildbot. Removed.
llvm-svn: 94975
2010-02-01 09:02:24 +00:00
Sean Callanan
e860736826
Added the enhanced disassembly library's implementation and
...
fleshed out the .exports file. I still have to fix several
details of operand parsing, but the basic functionality is
there and usable.
llvm-svn: 94974
2010-02-01 08:49:35 +00:00
Sean Callanan
a6a8be8712
Removed symbols from .exports that are not yet in
...
the library.
llvm-svn: 94844
2010-01-29 21:21:44 +00:00
Sean Callanan
5d23b70461
Added a bare-bones Makefile to build the enhanced disassembly
...
library as a static and a shared library. Added dependencies
so the target-specific enhanced disassembly info tables are
built before the library.
llvm-svn: 94780
2010-01-29 01:30:01 +00:00
Mikhail Glushenkov
94b2e3f219
Support some more options...
...
llvm-svn: 94752
2010-01-28 18:19:36 +00:00
Benjamin Kramer
3b01285b76
Replace strcpy with memcpy when we have the length around anyway.
...
llvm-svn: 94746
2010-01-28 18:04:38 +00:00
Jeffrey Yasskin
fb10587e50
Kill ModuleProvider and ghost linkage by inverting the relationship between
...
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.
Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods. The bindings to
other languages still use the ModuleProvider concept. It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.
Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735 .
llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Mikhail Glushenkov
89d78050aa
Support -arch.
...
llvm-svn: 94546
2010-01-26 14:55:44 +00:00
Mikhail Glushenkov
13cd7be07e
Support for -iquote.
...
llvm-svn: 94545
2010-01-26 14:55:30 +00:00
Chris Lattner
5a57121631
make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
...
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Chris Lattner
397d34f06b
mark some libraries that currently require RTTI.
...
llvm-svn: 94377
2010-01-24 20:22:08 +00:00
Chris Lattner
5eb0c8a2bd
pass "-fasm-verbose" into createAsmStreamer.
...
llvm-svn: 94165
2010-01-22 07:06:15 +00:00
Chris Lattner
276811b58a
Stop building RTTI information for *most* llvm libraries. Notable
...
missing ones are libsupport, libsystem and libvmcore. libvmcore is
currently blocked on bugpoint, which uses EH. Once it stops using
EH, we can switch it off.
This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.
llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Chris Lattner
c07d7f41e3
elimiante the dynamic_cast's from opt.
...
llvm-svn: 94160
2010-01-22 06:03:06 +00:00
Chris Lattner
8b02bfe487
simplify code.
...
llvm-svn: 94159
2010-01-22 05:54:03 +00:00
Chris Lattner
c0e2ef62fa
move some files out of the llvm-mc tool into the MCParser library so
...
other tools can link it.
llvm-svn: 94131
2010-01-22 01:58:08 +00:00
Chris Lattner
9a84d96edf
create a new MCParser library and move some stuff into it.
...
llvm-svn: 94129
2010-01-22 01:44:57 +00:00
Chris Lattner
f1ac97964f
remove some confused code that used strtoull
...
llvm-svn: 94128
2010-01-22 01:17:12 +00:00
Sean Callanan
e9111e7172
Moved handling of inclusion from the AsmLexer to
...
the AsmParser, breaking AsmLexer's dependence on
SourceMgr.
llvm-svn: 94054
2010-01-21 00:19:58 +00:00