Commit Graph

3111 Commits

Author SHA1 Message Date
Chris Lattner
68e326689d don't build edis if the x86 target isn't enabld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:26:33 +00:00
Sanjiv Gupta
ad597f99d9 disable-mem2reg and disable-gvn options should not be used by the driver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 18:38:44 +00:00
Jeffrey Yasskin
c90171961d Try r96559 for the third time. This time the shared library is only built if
--enable-shared is passed to configure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 06:34:33 +00:00
Jeffrey Yasskin
407fbdd161 Roll back r96959 again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 20:53:37 +00:00
Jeffrey Yasskin
5294af000a Oops. Pass -lgcc _only_ on ARM, not on everything except ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:40:48 +00:00
Jeffrey Yasskin
ea6c39d417 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:10:07 +00:00
Mikhail Glushenkov
b5c2a5d943 Fix -mtune forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 14:29:42 +00:00
Mikhail Glushenkov
9e7d90bcfc Update mcc16 and the ancient Clang plugin for the 'cmd_line' -> 'command' change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:59:30 +00:00
Mikhail Glushenkov
9660c5d3e0 Input files with empty suffixes must be passed to linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:05:21 +00:00
Mikhail Glushenkov
130bedecee Support -Xlinker et al.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:05:15 +00:00
Mikhail Glushenkov
fc2ee15f65 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:05:06 +00:00
Mikhail Glushenkov
a34f97ab22 Correct option forwarding: initial implementation.
Does not work, but the infrastructure changes are in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
c6e0dbf1dd Precompiled headers: initial support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:33 +00:00
Mikhail Glushenkov
be6ee7c116 New experimental/undocumented feature: 'works_on_empty'.
For now, just enough support to make -filelist work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:28 +00:00
Mikhail Glushenkov
9f2a0802e5 Support '-install_name'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:18 +00:00
Daniel Dunbar
951fd6dfad Kill off LLVMGCCARCH and LLVMGCC_VERSION make variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:56:31 +00:00
Daniel Dunbar
99d9863cce Kill off LLVMGCC_MAJVERS make variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:56:22 +00:00
Duncan Sands
18619b2aeb Uniformize the way these options are printed. Requested by
Russell Wallace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 14:37:52 +00:00
Benjamin Kramer
3460f221cd Avoid a dangling pointer dereference, PassManager::add can delete the Pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96576 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 12:57:05 +00:00
Jeffrey Yasskin
2155d459a7 Roll back the shared library, r96559. It broke two darwins and arm, mysteriously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96569 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 04:43:02 +00:00
Jeffrey Yasskin
f6afae2f49 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:36:02 +00:00
Duncan Sands
1df9859c40 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 11:11:14 +00:00
Mikhail Glushenkov
49e496b1cc Support some more Darwin-only options.
We really need a conditional compilation mechanism...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 22:37:13 +00:00
Mikhail Glushenkov
b88c6f6cdc Support -mfix-and-continue properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 22:37:00 +00:00
Mikhail Glushenkov
2ac7ab129d Revert r94752, turns out we don't need to touch these options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 22:36:43 +00:00
Chris Lattner
86020e4628 give MCCodeEmitters access to the current MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:12:47 +00:00
Dan Gohman
a499d20e8d Add support to llvm-extract for extracting multiple functions and/or
multiple global variables at a time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 23:58:53 +00:00
Daniel Dunbar
5532cf44a0 llvm-mc: Remove --show-fixups and always show as part of --show-encoding.
Also, fix a silly memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 01:41:14 +00:00
Daniel Dunbar
6b71653c82 llvm-mc: Add --show-fixups option, for displaying the instruction fixup information in the asm comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 23:00:14 +00:00
Jakob Stoklund Olesen
4b42a1e40f Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 17:24:21 +00:00
Jakob Stoklund Olesen
8addca2f3a clang test suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 17:20:03 +00:00
Sean Callanan
2d58147ca5 Updated the enhanced disassembly library to produce
whitespace tokens in the right places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 01:50:54 +00:00
Sean Callanan
de5dac1c46 Fixed a problem where the enhanced disassembly
library was reporting inaccurate token IDs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 01:00:18 +00:00
Sean Callanan
01cd79fe1b Added header file declarations and .exports entries
for the new APIs offered by the enhanced disassembler
for inspecting operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 23:34:25 +00:00
Sanjiv Gupta
504b4cdc1c Fixed build error for redefinition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 06:08:32 +00:00
Sanjiv Gupta
90f4c914b8 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 05:56:37 +00:00
Jeffrey Yasskin
4688261c20 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 16:19:36 +00:00
Torok Edwin
18743f4502 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 09:31:35 +00:00
Sean Callanan
76706584c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 01:43:08 +00:00
Daniel Dunbar
9dee8e3009 llvm-mc: Add --show-inst option, for showing the MCInst inline with the assembly
output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 18:18:30 +00:00
Chris Lattner
5669e30097 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 05:55:08 +00:00
Sean Callanan
2e235a826d Fixed the disassembler so it accepts multiple
instructions on a single line.  Also made it a
bit more forgiving when it reports errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 03:46:41 +00:00
Chris Lattner
ac7798e906 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 23:57:42 +00:00
Chris Lattner
3813d8adf3 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. :( :(



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 22:31:11 +00:00
Chris Lattner
211edae484 eliminate FileModel::Model, just use CodeGenFileType. The client
of the code generator shouldn't care what object format a target
uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 21:06:45 +00:00
Sean Callanan
b788b3753b ...and fixed the Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 20:20:30 +00:00
Sean Callanan
59b9c8879b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 20:11:23 +00:00
Chris Lattner
b5c5160a55 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 19:14:27 +00:00
Chris Lattner
390444a704 remove dead code, we're requesting TargetMachine::AssemblyFile here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 19:03:39 +00:00
Sean Callanan
d74667e226 Removed an unnecessary class from the EDDisassembler
implementation.  Also made sure that the register maps
were created during disassembler initialization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:18:20 +00:00
Sean Callanan
37ad4661b4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 00:04:46 +00:00
Nate Begeman
39bdc78e6f Kill the Mach-O writer, and temporarily make filetype=obj an error.
The MCStreamer based assemblers will take over for this functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:56:58 +00:00
Sean Callanan
54c7788e99 Fix for builds with separate source and build
directories (like, oh, say, any multistage build)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:27:57 +00:00
Sean Callanan
81b0c39927 Updated to use the proper .exports file for the
target platform, depending on whether the target
supports the blocks API or not


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:01:38 +00:00
Sean Callanan
c54a747352 Rollback on including blocks functionality in .exports
because some platforms don't support blocks and then
break because the symbols aren't present


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:57:50 +00:00
Sean Callanan
7bb2929512 Whoops, left some debugging code in that broke
a buildbot.  Removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 09:02:24 +00:00
Sean Callanan
ee5dfd42f1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 08:49:35 +00:00
Sean Callanan
400c70036d Removed symbols from .exports that are not yet in
the library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 21:21:44 +00:00
Sean Callanan
bd51cdd067 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 01:30:01 +00:00
Mikhail Glushenkov
1124cc02b4 Support some more options...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:19:36 +00:00
Benjamin Kramer
12ea66a727 Replace strcpy with memcpy when we have the length around anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:04:38 +00:00
Jeffrey Yasskin
f0356fe140 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:34:15 +00:00
Mikhail Glushenkov
058b3f5114 Support -arch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 14:55:44 +00:00
Mikhail Glushenkov
967edd0102 Support for -iquote.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 14:55:30 +00:00
Chris Lattner
43b5f9312d make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:43:08 +00:00
Chris Lattner
c0f8a361f5 mark some libraries that currently require RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:22:08 +00:00
Chris Lattner
07404415ab pass "-fasm-verbose" into createAsmStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 07:06:15 +00:00
Chris Lattner
e73a31f667 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 06:49:46 +00:00
Chris Lattner
476e9bd114 elimiante the dynamic_cast's from opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 06:03:06 +00:00
Chris Lattner
6f6e87db19 simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94159 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 05:54:03 +00:00
Chris Lattner
be343b3ca3 move some files out of the llvm-mc tool into the MCParser library so
other tools can link it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 01:58:08 +00:00
Chris Lattner
c6ef277a0b create a new MCParser library and move some stuff into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 01:44:57 +00:00
Chris Lattner
03949c9db3 remove some confused code that used strtoull
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 01:17:12 +00:00
Sean Callanan
fd0b0288e2 Moved handling of inclusion from the AsmLexer to
the AsmParser, breaking AsmLexer's dependence on
SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 00:19:58 +00:00
Sean Callanan
bf2013ee22 Changed the AsmParser to handle error messages itself
rather than passing them off to the AsmLexer to handle.
This means the AsmLexer no longer requires a SourceMgr
to do error handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 23:19:55 +00:00
Sean Callanan
10d33a4937 Promoted the reference to the SourceMgr from AsmLexer
into AsmParser, in preparation for making AsmLexer
independent of the SourceMgr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:45:23 +00:00
Sean Callanan
79036e421f Modified MCAsmLexer to return error information upward
rather than printing it locally, reducing its dependence
on SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:18:24 +00:00
Chris Lattner
1658202529 give createAsmStreamer an 'isLittleEndian' argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 06:39:07 +00:00
Sean Callanan
18b8323de7 Promoted the getTok() method to MCAsmParser so that
the two token accessor functions are declared consistently.
Modified the clients of MCAsmParser to reflect this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:44:56 +00:00
Sean Callanan
79ed1a8734 Added a Lex function to the AsmParser, to allow handling
of include directives to occur within the parser itself.
This will break the lexer's dependency on a SourceMgr as
input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 20:22:31 +00:00
Chris Lattner
aaec205b87 Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:46:13 +00:00
Chris Lattner
ddf6bdde44 add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:45:47 +00:00
Chris Lattner
258281d8ac fix parsing .comm directives on systems which do not represent alignments
as a power of 2.  This fixes MC/AsmParser/directive_comm.s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:22:22 +00:00
Eli Friedman
74733a7e46 Make opt -O3 act more like clang -O3 etc., by making the inlining thresholds
match.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:38:31 +00:00
Chris Lattner
59780b8017 make llvm-config more portable to windows versions of perl,
patch by Michael Beck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:27:43 +00:00
Chris Lattner
c0dba723d1 now that mangler is in libtarget, it can use MCAsmInfo instead of clients
having to pass various fields from it in.  Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 18:22:35 +00:00
Dan Gohman
b56bf581a3 Don't create a (empty) output file, and don't warn about bitcode output
to a console, when --analyze is used.

Similarly, avoid creating an empty output file when --disable-output is used.

Print a warning when the -o option appears with either --analyze or
--disable-output, to indicate that the option is being ignored.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 17:47:24 +00:00
Chris Lattner
45111d160c move the mangler into libtarget from vmcore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:57:06 +00:00
Chris Lattner
1ffb33d033 remove obsolete comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:34:51 +00:00
Chris Lattner
8abfb8adb2 bugpoint doesn't need the mangler at all. DisambiguateGlobalSymbols
dates to a time when two different LLVM values could have the same
name but different types.  Simplify it to just assign names to unnamed
things and let the core symtab resolve duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:34:01 +00:00
Chris Lattner
7c3418ba58 remove calls to dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:20:34 +00:00
Chris Lattner
c5451065e0 remove use of getMangledName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 20:56:05 +00:00
Chris Lattner
469340493c switch liblto to use the new getNameWithPrefix() method instead of getMangledName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:12:14 +00:00
Chris Lattner
54482b472a fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:39:23 +00:00
Chris Lattner
b4307b3370 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:28:38 +00:00
Nate Begeman
3fe980b127 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer

Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:51:18 +00:00
Chris Lattner
9d3c755fd6 add virtual methods to get the start/end of a MCParsedAsmOperand,
the default implementation returns "unknown".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:29:57 +00:00
Chris Lattner
9898671a74 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:21:20 +00:00
Chris Lattner
f007e853e2 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:32:45 +00:00
Benjamin Kramer
d4f195999a Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:03:24 +00:00
David Greene
08fc0d3026 Enable debug buffering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:32 +00:00
David Greene
c58d01b235 Enable debug buffering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:30:21 +00:00
Mikhail Glushenkov
364cf75c40 Forward -O0 to llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-02 08:27:23 +00:00
Mikhail Glushenkov
bc56d86e25 Apparently, it is OK for -MT to be specified several times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-02 08:27:10 +00:00
Mikhail Glushenkov
99da5d7bba Minor simplifactions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 04:41:10 +00:00
Mikhail Glushenkov
3a481e38c9 Minor simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 03:50:51 +00:00
Bill Wendling
9bc0af847d Mark some debug variables as 'unused' to quiet compiler and analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 01:34:57 +00:00
Douglas Gregor
7aed44658c Fix another -Wmismatched-tags warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 18:27:13 +00:00
Douglas Gregor
1f291059b2 Fix struct/class mismatch for LTOModule and LTOCodeGenerator, detected by Clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92004 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:05:07 +00:00
Mikhail Glushenkov
9d2e2b2bb2 Make it easier to regenerate docs when srcdir != objdir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 12:50:03 +00:00
Mikhail Glushenkov
e0b6570d24 Allow (set_option SwitchOption, true).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 12:49:30 +00:00
Chris Lattner
a3dcfb1300 rename HexDisassembler -> Disassembler, it works on any input
integer encoding (0123, 0b10101, 42, etc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 22:50:29 +00:00
Chris Lattner
f444c06f91 just discard the debug output from the disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91933 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 22:47:43 +00:00
Chris Lattner
a1aa8bba77 specify what is invalid about it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 07:03:21 +00:00
Chris Lattner
5a99615704 reject invalid input with a caret, e.g.:
simple-tests.txt:16:1: error: invalid instruction
0xff 0xff
^




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:58:29 +00:00
Chris Lattner
665e947740 various cleanups, make the disassemble reject lines with too much
data on them, for example:

	addb	%al, (%rax)
simple-tests.txt:11:5: error: excess data detected in input
0 0 0 0 0 
    ^



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:56:51 +00:00
Chris Lattner
c3de94fabf If you thought that it didn't make sense for the disassembler
to not produce caret diagnostics, you were right!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:45:48 +00:00
Chris Lattner
2adbef06a6 rewrite the file parser for the disassembler, implementing support for
comments.  Also, check in a simple testcase for the disassembler,
including a test for r91864


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:37:58 +00:00
Chris Lattner
222af46482 don't crash on blank lines, rename some variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 06:24:00 +00:00
Sanjiv Gupta
7ae1ddeb2f Adding a bunch of options to the mcc16 driver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 13:13:29 +00:00
Mikhail Glushenkov
994dbe0073 Add a 'set_option' action for use in OptionPreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 07:49:16 +00:00
Chandler Carruth
b5d3daba91 Update CMake build to include HexDisassembler.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 06:35:17 +00:00
Sean Callanan
ba847da571 Test harness for the LLVM disassembler. When invoked
with -disassemble, llvm-mc now accepts lines of the
form
0x00 0x00
and passes the resulting bytes to the disassembler for
the chosen (or default) target, printing the result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 01:49:59 +00:00
Mikhail Glushenkov
e4ac23a0ff Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:

- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:52 +00:00
Mikhail Glushenkov
68d475ad90 Small documentation update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:03:37 +00:00
Chris Lattner
c0d91b75f0 when opt crashes, print its command line arguments as a pretty stack trace.
Somehow opt was missed when this was added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90912 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:41:28 +00:00
Mikhail Glushenkov
b59b0f81be Documentation update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:26:11 +00:00
Mikhail Glushenkov
5b9b3ba2ba Deprecate 'unpack_values'.
Use 'forward_values' + 'comma_separated' instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov
8461202767 Pass '-msse' and friends to llc as '-mattr=+/-'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 17:03:21 +00:00
Mikhail Glushenkov
fa8182e335 Forward -m32/-m64 to the linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:38:45 +00:00
Mikhail Glushenkov
3ab4883053 Support -march/-mtune/-mcpu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:38:28 +00:00
Mikhail Glushenkov
55cd767bdb Add relocation model options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 09:47:11 +00:00
Mikhail Glushenkov
4227c0ffc5 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 09:19:09 +00:00
Mikhail Glushenkov
97955005b3 Forward -save-temps to llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:51:30 +00:00
Mikhail Glushenkov
18518603f1 Support -[weak_]framework and -F in llvmc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 05:59:55 +00:00
Tobias Grosser
56f4ef3232 Remove ShortNames from getNodeLabel in DOTGraphTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:38:47 +00:00
Tobias Grosser
a10d598602 Instantiate DefaultDOTGraphTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:38:13 +00:00
Viktor Kutuzov
308f6630a3 Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 22:44:18 +00:00
Daniel Dunbar
f87ea4dd9a Add the rest of the build system logic for optional target disassemblers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 04:46:58 +00:00
Viktor Kutuzov
054b52c366 Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 00:00:02 +00:00
Mikhail Glushenkov
e0ace0c08f Make example/Hello compile again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 17:29:25 +00:00
Viktor Kutuzov
e823db8bae Added getDefaultSubtargetFeatures method to SubtargetFeatures class which returns a correct feature string for given triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 20:20:05 +00:00
Viktor Kutuzov
51cdac02c4 Added getArchNameForAssembler method to the Triple class for which returns OS and Vendor independent target assembler arch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 18:48:27 +00:00
Duncan Sands
3ea11cf8fc Make bugpoint pass -load arguments to LLI. This lets one use bugpoint with
programs that depend on native shared libraries.  Patch by Timo Lindfors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 10:20:22 +00:00
Benjamin Kramer
05872ea804 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:36:59 +00:00
Daniel Dunbar
e9b88e4440 Stop running get_target_triple more than we need to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86418 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 23:52:20 +00:00
Kenneth Uildriks
b908f8ad6a Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 15:29:06 +00:00
Nick Lewycky
f4e748bc3f Line this up as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 22:08:51 +00:00
Nick Lewycky
ed1f1687b7 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 22:07:54 +00:00
Douglas Gregor
076124ef26 Reverting 85714, 85715, 85716, which are breaking the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 16:42:53 +00:00