Commit Graph

4093 Commits

Author SHA1 Message Date
Rafael Espindola
d6b43a317e Move the support for using .init_array from ARM to the generic
TargetLoweringObjectFileELF. Use this to support it on X86. Unlike ARM,
on X86 it is not easy to find out if .init_array should be used or not, so
the decision is made via TargetOptions and defaults to off.

Add a command line option to llc that enables it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158692 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 00:48:28 +00:00
Bill Wendling
e68470a1e4 Remove assignments which aren't used afterwards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158534 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15 19:28:20 +00:00
Rafael Espindola
4f81768d44 Use LTO_CODEGEN_PIC_MODEL_DYNAMIC for PIE. This requirest a git version of
gold to work. Since the enum value LDPO_PIE has just been added to plugin-api.h,
use a numeric constant for now so that we don't require an unreleased
version of gold to build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158402 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-13 13:30:24 +00:00
Benjamin Kramer
773ef61299 Object file output from llc isn't experimental anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-11 09:40:10 +00:00
Michael J. Spencer
4d61664696 [llvm-nm] Update documentation to cover object file support and arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158120 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06 23:34:10 +00:00
Benjamin Kramer
95a9d93772 Round 2 of dead private variable removal.
LLVM is now -Wunused-private-field clean except for
- lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields.
- gtest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06 19:47:08 +00:00
Benjamin Kramer
a7542d5f87 Remove unused private fields found by clang's new -Wunused-private-field.
There are some that I didn't remove this round because they looked like
obvious stubs. There are dead variables in gtest too, they should be
fixed upstream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06 18:25:08 +00:00
David Blaikie
4f56a30e0d Reinstate -O3 for LTO.
This broke in r144788 when the CodeGenOpt option was moved from everywhere else
(specifically, from addPassesToEmitFile) to createTargetMachine. Since
LTOCodeGenerator wasn't passing the 4th argument, when the 4th parameter became
the 3rd, it silently continued to compile (int->bool conversion) but meant
something completely different.

This change preserves the existing (accidental) and previous (default)
semantics of the addPassesToEmitFile and restores the previous/intended
CodeGenOpt argument by passing it appropriately to createTargetMachine.

(discovered by pending changes to -Wconversion to catch constant->bool
conversions)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:42:51 +00:00
Bob Wilson
6e1b812850 Add an insertPass API to TargetPassConfig. <rdar://problem/11498613>
Besides adding the new insertPass function, this patch uses it to
enhance the existing -print-machineinstrs so that the MachineInstrs
after a specific pass can be printed.

Patch by Bin Zeng!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 00:17:12 +00:00
Stepan Dyatkovskiy
0aa32d5d0f ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 12:26:47 +00:00
Benjamin Kramer
6514551be7 Plug a leak when using MCJIT.
Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 17:24:08 +00:00
Benjamin Kramer
223f2a72da Remove extra semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157118 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 16:44:12 +00:00
Stepan Dyatkovskiy
f4c261b137 Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new SwitchInst methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-19 13:14:30 +00:00
Jim Grosbach
3e96531186 Refactor data-in-code annotations.
Use a dedicated MachO load command to annotate data-in-code regions.
This is the same format the linker produces for final executable images,
allowing consistency of representation and use of introspection tools
for both object and executable files.

Data-in-code regions are annotated via ".data_region"/".end_data_region"
directive pairs, with an optional region type.

data_region_directive := ".data_region" { region_type }
region_type := "jt8" | "jt16" | "jt32" | "jta32"
end_data_region_directive := ".end_data_region"

The previous handling of ARM-style "$d.*" labels was broken and has
been removed. Specifically, it didn't handle ARM vs. Thumb mode when
marking the end of the section.

rdar://11459456

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-18 19:12:01 +00:00
Kevin Enderby
59c15e920c Fixed a bug in llvm-objdump when disassembling using -macho option for a binary
containing no symbols.  Fixed the crash and fixed it not disassembling anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157031 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-18 00:13:56 +00:00
Danil Malyshev
068c65b22d Added LLIMCJITMemoryManager to the lli. This manager will be used for MCJIT instead of DefaultJIMMemoryManager.
It's more flexible for MCJIT tasks, in addition it's provides a invalidation instruction cache for code sections which will be used before JIT code will be executed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 18:50:11 +00:00
Chandler Carruth
8bc3434e68 Teach the 'opt' tool about '-Os' and '-Oz', corresponding to the Clang
options, to enable easier testing of the innards of LLVM that are
enabled by such optimization strategies.

Note that this doesn't provide the (much needed) function attribute
support for -Oz (as opposed to -Os), but still seems like a positive
step to better test the logic that Clang currently relies on.

Patch by Patrik Hägglund.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 08:32:49 +00:00
Daniel Dunbar
40d65dc305 llvm-config: Use sys::fs::equivalent instead of string comparison.
- Hopefully fixes PR11600 (untested).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156865 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15 22:07:18 +00:00
Kevin Enderby
41854aea66 Fixed a bug in llvm-objdump when disassembling using -macho option for a binary
that has more than one symbol.  The last symbol was not being disassembled to
the end of the section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156840 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15 18:57:14 +00:00
Daniel Dunbar
b5cd41e26f llvm-build: Add support for non-installed libraries (e.g., gtest).
- These libraries are only reported by llvm-config when run from a development
   tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156838 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15 18:44:17 +00:00
Jim Grosbach
918f55fe23 Allow MCCodeEmitter access to the target MCRegisterInfo.
Add the MCRegisterInfo to the factories and constructors.

Patch by Tom Stellard <Tom.Stellard@amd.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156828 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15 17:35:52 +00:00
Rafael Espindola
383fd7afd9 Fix a use after free when the streamer is destroyed. Fixes pr12622.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156606 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-11 03:42:13 +00:00
Bob Wilson
6447d52ba8 Do not install llvm-config-host for cross-builds of clang. rdar://11317847
My previous change to install llvm-config-host for cross-builds resulted
in that file being installed even when the normal llvm-config was not
installed, e.g., when building the install-clang target.  Daniel suggested
this alternative, which solves the immediate problem and also avoids the gunk
in the top-level makefile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156448 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-09 00:07:02 +00:00
Kevin Enderby
9ed9e5d0f9 Fix it so llvm-objdump -arch does accept x86 and x86-64 as valid arch names.
PR12731.  Patch by Meador Inge!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156444 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-08 23:38:45 +00:00
Chandler Carruth
99650c9088 Move the CodeExtractor utility to a dedicated header file / source file,
and expose it as a utility class rather than as free function wrappers.

The simple free-function interface works well for the bugpoint-specific
pass's uses of code extraction, but in an upcoming patch for more
advanced code extraction, they simply don't expose a rich enough
interface. I need to expose various stages of the process of doing the
code extraction and query information to decide whether or not to
actually complete the extraction or give up.

Rather than build up a new predicate model and pass that into these
functions, just take the class that was actually implementing the
functions and lift it up into a proper interface that can be used to
perform code extraction. The interface is cleaned up and re-documented
to work better in a header. It also is now setup to accept the blocks to
be extracted in the constructor rather than in a method.

In passing this essentially reverts my previous commit here exposing
a block-level query for eligibility of extraction. That is no longer
necessary with the more rich interface as clients can query the
extraction object for eligibility directly. This will reduce the number
of walks of the input basic block sequence by quite a bit which is
useful if this enters the normal optimization pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156163 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-04 10:18:49 +00:00
Pete Cooper
ff204963cb PR12729: Change 'llvm-objdump' to display the available targets.
Patch by Meador Inge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156128 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 23:20:10 +00:00
John McCall
9679f0f357 Fix unintentional use of operator bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 05:39:10 +00:00
Eli Bendersky
30183bf042 Remove redundant line (the memory manager is set above to the same object
if !ForceInterpreteri). It has no effect (apart from a memory leak...)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155792 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-29 11:14:59 +00:00
Evan Cheng
0d5c32327a DumpSegment64Command() wasn't returning correct result. Caught by static analyzer. rdar://11329354
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155669 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-26 22:07:28 +00:00
Michael J. Spencer
3c00db75e1 [CMake] Restructure how Clang, Polly and other external projects get included.
While making lld build under the tools directory I decided to refactor how this
works.

There is now a macro, add_llvm_external_project, which takes the name of the
expected subdirectory. This sets up two CMake options.

 * LLVM_EXTERNAL_${NAME}_SOURCE_DIR
     This is the path to the source. It defaults to
     ${CMAKE_CURRENT_SOURCE_DIR}/${name}.
 * LLVM_EXTERNAL_${NAME}_BUILD
     Enable and disable building the tool as part of LLVM.

I chose LLVM_EXTERNAL_${NAME} as a prefix so they all show up together in the
GUI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-26 19:43:35 +00:00
Chris Lattner
fa1059fd9c openbsd doesn't support soname, patch by Brad Smith!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155536 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-25 06:37:20 +00:00
Michael J. Spencer
75338097c7 Remove llvm-ld and llvm-stub (which is only used by llvm-ld).
llvm-ld is no longer useful and causes confusion and so it is being removed.

* Does not work very well on Windows because it must call a gcc like driver to
  assemble and link.
* Has lots of hard coded paths which are wrong on many systems.
* Does not understand most of ld's options.
* Can be partially replaced by llvm-link | opt | {llc | as, llc -filetype=obj} |
  ld, or fully replaced by Clang.

I know of no production use of llvm-ld, and hacking use should be
replaced by Clang's driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 19:27:54 +00:00
Nick Lewycky
9a1484165c Move the JIT flags from llc to lli. These flags showed up as part of moving
backend flags in TargetOptions.h into their own class in r145714.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154993 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-18 08:34:12 +00:00
Joe Groff
e652b521f9 allow opt to take a -mtriple option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154959 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-17 23:05:48 +00:00
Richard Barton
d0c478d95f Add -disassemble support for -show-inst and -show-encode capability llvm-mc. Also refactor so all MC paraphernalia are created once for all uses as much as possible.
The test change is to account for the fact that the default disassembler behaviour has changed with regards to specifying the assembly syntax to use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154809 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16 11:32:10 +00:00
Rafael Espindola
4d2e9d9a1c Remove lto_codegen_set_whole_program_optimization. It is a work in progress,
so we don't want it to show up in the stable 3.1 interface.

While at it, add a comment about why LTOCodeGenerator manually creates the
internalize pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154807 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16 10:58:38 +00:00
Craig Topper
fb22ede033 Make member variables of AsmToken private. Remove unnecessary forward declarations. Remove an unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154775 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-15 22:00:22 +00:00
Nadav Rotem
7d719a5237 Do not convert between fp128 <-> ppc_fp128 since there is no legal cast conversion between the two.
Patch by nobled <nobled@dreamwidth.org>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154772 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-15 20:17:14 +00:00
Sylvestre Ledru
6fc30c26b7 Fix the build under Debian GNU/Hurd.
Thanks to Pino Toscano for the patch



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-11 15:35:36 +00:00
Dylan Noblesmith
83f17f25fc llvm-stress: stop abusing ConstantFP::get()
ConstantFP::get(Type*, double) is unreliably host-specific:
it can't handle a type like PPC128 on an x86 host. It even
has a comment to that effect: "This should only be used for
simple constant values like 2.0/1.0 etc, that are
known-valid both as host double and as the target format."

Instead, use APFloat. While we're at it, randomize the floating
point value more thoroughly; it was previously limited
to the range 0 to 2**19 - 1.

PR12451.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154446 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-10 22:44:51 +00:00
Dylan Noblesmith
701de8fafc llvm-stress: don't make vectors of x86_mmx type
LangRef.html says:
"There are no arrays, vectors or constants of this type."

This was hitting assertions when passing the -generate-x86-mmx
option.

PR12452.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154445 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-10 22:44:49 +00:00
Bill Wendling
64fae7587a Revert the 'EnableInitializing' flag. There is debate on whether we should run that pass by default in LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-09 23:16:51 +00:00
Bill Wendling
64d5b282c9 Apply the scope restrictions after parsing the command line options. There may be some which are used in that function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154348 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-09 22:18:01 +00:00
Bill Wendling
a3706d6754 s/lto_codegen_whole_program_optimization/lto_codegen_set_whole_program_optimization/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154312 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-09 08:32:21 +00:00
Bill Wendling
3029a0c56a Add a hook to turn on the internalize pass through the LTO interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154306 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-09 05:26:48 +00:00
Chandler Carruth
253933ee9e Teach LLVM about a PIE option which, when enabled on top of PIC, makes
optimizations which are valid for position independent code being linked
into a single executable, but not for such code being linked into
a shared library.

I discussed the design of this with Eric Christopher, and the decision
was to support an optional bit rather than a completely separate
relocation model. Fundamentally, this is still PIC relocation, its just
that certain optimizations are only valid under a PIC relocation model
when the resulting code won't be in a shared library. The simplest path
to here is to expose a single bit option in the TargetOptions. If folks
have different/better designs, I'm all ears. =]

I've included the first optimization based upon this: changing TLS
models to the *Exec models when PIE is enabled. This is the LLVM
component of PR12380 and is all of the hard work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154294 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-08 17:51:45 +00:00
Bill Wendling
97d9903236 The internalize pass can be dangerous for LTO.
Consider the following program:

$ cat main.c
void foo(void) { }

int main(int argc, char *argv[]) {
    foo();
    return 0;
}
$ cat bundle.c 
extern void foo(void);

void bar(void) {
     foo();
}
$ clang -o main main.c
$ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
$ nm -m bundle.so
0000000000000f40 (__TEXT,__text) external _bar
                 (undefined) external _foo (from executable)
                 (undefined) external dyld_stub_binder (from libSystem)
$ clang -o main main.c -O4
$ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
Undefined symbols for architecture x86_64:
  "_foo", referenced from:
      _bar in bundle-elQN6d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The linker was told that the 'foo' in 'main' was 'internal' and had no uses, so
it was dead stripped.

Another situation is something like:

define void @foo() {
  ret void
}

define void @bar() {
  call asm volatile "call _foo" ...
  ret void
}

The only use of 'foo' is inside of an inline ASM call. Since we don't look
inside those for uses of functions, we don't specify this as a "use."

Get around this by not invoking the 'internalize' pass by default. This is an
admitted hack for LTO correctness.
<rdar://problem/11185386>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154124 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05 21:26:44 +00:00
Anton Korobeynikov
1895fc90e0 Set soname for FreeBSD as well.
Patch by Bernard Cafarelli!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153965 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 19:48:31 +00:00
Bill Wendling
90e7d4f6f0 Reformatting. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153928 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 03:56:52 +00:00
Bill Wendling
3197b4453d Add an option to turn off the expensive GVN load PRE part of GVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153902 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-02 22:16:50 +00:00
Bill Wendling
8ba9405c5c Hack the hack. If we have a situation where an ASM object is defined but isn't
reflected in the LLVM IR (as a declare or something), then treat it like a data
object.

N.B. This isn't 100% correct. The ASM parser should supply more information so
that we know what type of object it is, and what attributes it should have.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153870 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-02 10:01:21 +00:00
Craig Topper
17463b3ef1 Make MCInstrInfo available to the MCInstPrinter. This will be used to remove getInstructionName and the static data it contains since the same tables are already in MCInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153860 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-02 06:09:36 +00:00
Bill Wendling
1fcbca05db It could come about that we parse the inline ASM before we get a potential
definition for it. In that case, we want to wait for the potential definition
before we create a symbol for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153859 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-02 03:33:31 +00:00
Bill Wendling
7baa27d3b3 Move trivial functions into the class definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 11:25:18 +00:00
Bill Wendling
deee238128 Trim headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153809 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 11:22:30 +00:00
Bill Wendling
c94c562692 Indent according to LLVM's style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153808 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 11:15:43 +00:00
Bill Wendling
ab53bc76fd Cleanup whitespace and trim some of the #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153807 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 11:10:35 +00:00
Bill Wendling
f2cc2ee449 These strings aren't 'const char *' but 'char *'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153805 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 10:51:45 +00:00
Bill Wendling
76b13ed403 Cleanup whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153804 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 10:50:14 +00:00
Bill Wendling
caf71d4185 Free the codegen options when deleting LTO code generator object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153803 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 10:49:43 +00:00
Bill Wendling
168f142834 Cleanup whitespace and remove unneeded 'extern' keyword on function definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153802 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31 10:44:20 +00:00
Bill Wendling
5ff4bc20a1 * Set the scope attributes for the ASM symbol we added to be the value passed
into the function.
* Reorder some header files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153783 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 23:26:06 +00:00
Danil Malyshev
0e4fa5ff36 Re-factored RuntimeDyLd:
1. The main works will made in the RuntimeDyLdImpl with uses the ObjectFile class. RuntimeDyLdMachO and RuntimeDyLdELF now only parses relocations and resolve it. This is allows to make improvements of the RuntimeDyLd more easily. In addition the support for COFF can be easily added.

2. Added ARM relocations to RuntimeDyLdELF.

3. Added support for stub functions for the ARM, allowing to do a long branch.

4. Added support for external functions that are not loaded from the object files, but can be loaded from external libraries. Now MCJIT can correctly execute the code containing the printf, putc, and etc.

5. The sections emitted instead functions, thanks Jim Grosbach. MemoryManager.startFunctionBody() and MemoryManager.endFunctionBody() have been removed.
6. MCJITMemoryManager.allocateDataSection() and MCJITMemoryManager. allocateCodeSection() used JMM->allocateSpace() instead of JMM->allocateCodeSection() and JMM->allocateDataSection(), because I got an error: "Cannot allocate an allocated block!" with object file contains more than one code or data sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153754 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 16:45:19 +00:00
Bill Wendling
8fd3fcdba8 Cleanup whitespace. Doxygenize comments. And indent to llvm coding standards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153740 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 10:29:38 +00:00
Bill Wendling
288967dfac Revert r153694. It was causing failures in the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153701 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 23:23:59 +00:00
Danil Malyshev
4b0b8ef1b0 Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 21:46:18 +00:00
Bill Wendling
24b878031d Make some headway towards compiling all of LLVM.
Module-level ASM may contain definitions of functions and globals. However, we
were not telling the linker that these globals had definitions. As far as it was
concerned, they were just declarations.

Attempt to resolve this by inserting module-level ASM functions and globals into
the '_symbol' set so that the linker will know that they have values.

This gets us further towards our goal of compiling LLVM, but it still has
problems when linking libLTO.dylib because of the `-dead_strip' flag that's
passed to the linker.

<rdar://problem/11124216>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153638 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 08:27:32 +00:00
Bill Wendling
3c6b29b7e9 Cleanup whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 04:28:00 +00:00
Bill Wendling
9f3b483b81 Cache the end() iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 03:34:57 +00:00
Bill Wendling
3bb17380b1 Cleanup some whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 23:12:18 +00:00
Danil Malyshev
30b9e322e1 Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153607 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 21:46:36 +00:00
Bill Wendling
61476d6f90 Inline function into its one caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153598 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 20:48:49 +00:00
Bill Wendling
62cf01e4c5 Reformat the LTOModule code to be more inline with LLVM's coding standards. Add
a bunch of comments for the various functions. No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 20:46:54 +00:00
Bill Wendling
30fe94ea43 Some whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 04:17:34 +00:00
Benjamin Kramer
81bbdfda82 Include cctype for std::isprint.
This should unbreak the msvc build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153329 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23 11:49:32 +00:00
Anton Korobeynikov
d25dc3358b Add soname to LLVM shared library on Linux. Probably the same stuff is necessary for *BSD.
Patch from Mageia!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153324 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23 10:00:42 +00:00
Eric Christopher
a443e5b1f1 Remove the C backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23 05:50:46 +00:00
Chandler Carruth
3e29671cca Revert a series of commits to MCJIT to get the build working in CMake
(and hopefully on Windows). The bots have been down most of the day
because of this, and it's not clear to me what all will be required to
fix it.

The commits started with r153205, then r153207, r153208, and r153221.
The first commit seems to be the real culprit, but I couldn't revert
a smaller number of patches.

When resubmitting, r153207 and r153208 should be folded into r153205,
they were simple build fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-22 05:44:06 +00:00
Danil Malyshev
799184d8eb Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-21 21:06:29 +00:00
Danil Malyshev
b474620398 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153208 91177308-0d34-0410-b5e6-96231b3b80d8 2012-03-21 19:13:08 +00:00
Chris Lattner
1aa73cc05a Fix two bugpoint bugs:
1) opt is not usually in the same path as the target program. Even for
the bugpoint as a standalone app, it should be more portable to search
in PATH, isn't it?
2) bugpoint driver accounts opt plugins, but does not list them in the
final output command.

Patch by Dmitry Mikushin!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 23:42:11 +00:00
Chris Lattner
e0ac6f8a7d fix PR12301 - llvm-bcanalyze should print to stdout, not stderr (except for errors).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 23:40:48 +00:00
Eli Bendersky
61b1851a20 Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted code in LLVM.
Also refactor the existing OProfile profiling code to reuse the same interfaces with the VTune profiling code.
In addition, unit tests for the profiling interfaces were added.

This patch was prepared by Andrew Kaylor and Daniel Malea, and reviewed in the llvm-commits list by Jim Grosbach



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152620 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 08:33:15 +00:00
Stepan Dyatkovskiy
3d3abe0852 llvm::SwitchInst
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
Added some notes relative to case iterators.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152532 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-11 06:09:17 +00:00
Benjamin Kramer
51cf866163 Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152474 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 02:04:38 +00:00
David Meyer
2d70e263c2 Support reading GNU symbol versions in ELFObjectFile
* Add enums and structures for GNU version information.
* Implement extraction of that information on a per-symbol basis (ELFObjectFile::getSymbolVersion).
* Implement a generic interface, GetELFSymbolVersion(), for getting the symbol version from the ObjectFile (hides the templating).
* Have llvm-readobj print out the version, when available.
* Add a test for the new feature: readobj-elf-versioning.test



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-09 20:59:52 +00:00
Duncan Sands
4445215622 Have llvm-mc --version print the list of registered targets like llc does.
Patch by jey.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152315 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 14:24:32 +00:00
Stepan Dyatkovskiy
c10fa6c801 Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
  BasicBlock *BB = i.getCaseSuccessor();
  ConstantInt *V = i.getCaseValue();
  // Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 07:06:20 +00:00
Jim Grosbach
c6449b636f Make MCRegisterInfo available to the the MCInstPrinter.
Used to allow context sensitive printing of super-register or sub-register
references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 19:33:20 +00:00
David Meyer
ee37b6e4cd Fix comments for llvm-readobj, remove extraneous headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:43:51 +00:00
David Meyer
97f7787bfb [Object]
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151845 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 22:19:54 +00:00
David Meyer
5c2b4ea73c [Object]
* Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile.
* Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable.
* Implement this new interface completely for ELF, leave stubs for COFF and MachO.
* Add 'llvm-readobj' tool for dumping ObjectFile information.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151785 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 01:36:50 +00:00
David Meyer
2c67727046 [Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ST_Undefined. Implement these completely for ELF.
Rename ST_External to ST_Unknown, and slightly change its semantics. It now only indicates that the symbol's type
is unknown, not that the symbol is undefined. (For that, use ST_Undefined).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151696 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 02:11:55 +00:00
Derek Schuff
adef06a714 Make MemoryObject accessor members const again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 01:09:06 +00:00
Daniel Dunbar
b6f0625de2 Fix some stray semi-colons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151680 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 00:20:33 +00:00
David Meyer
c46255a32e In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151670 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 23:47:53 +00:00
Michael J. Spencer
dfa1896b6b [Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.
Add -D option to llvm-nm to dump dynamic symbols.

Patch by David Meyer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151600 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 00:40:37 +00:00
Hal Finkel
2cff6179ab Allow llvm-stress to optionally generate the other floating-point types (half, ppcf128, mmx, etc.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151596 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-27 23:59:33 +00:00
Nadav Rotem
bfb7dfa756 Add support for random constant vectors.
Patch by Joey Gouly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151489 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 13:56:18 +00:00
Nadav Rotem
794c16ae85 Style fix: Remove unneeded parentheses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151488 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 12:34:17 +00:00
Nadav Rotem
2e851a9abf Fix a bug in the code that checks if a store value is a vector of i1s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151487 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 12:00:22 +00:00
Nadav Rotem
08c8339307 Fix compilation on MSVC. Rename "_BB" to "Block"
Thanks zygoloid.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 08:59:25 +00:00
Nadav Rotem
c367dfc2f4 fix a copy-and-paste error in the docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151480 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 08:43:43 +00:00
Nadav Rotem
fdc309cc4e Add a random .LL file generator to stress-test different llvm components.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151479 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 08:35:53 +00:00
Duncan Sands
9778ad51ee An easy case where GCC should really be able to work out that the value is only
used if IsInDevelopmentTree is 'true'.  But it doesn't, so help it out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-23 08:25:25 +00:00
Eli Friedman
967570f2ec Improve handling of blockaddresses in bugpoint when splitting a module. Patch by Daniel Reynaud.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151115 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 01:43:47 +00:00
Ahmed Charles
b0934ab7d8 Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 11:37:01 +00:00
Andrew Trick
8dd26253f5 RegAlloc superpass: includes phi elimination, coalescing, and scheduling.
Creates a configurable regalloc pipeline.

Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa.

When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>.

CodeGen transformation passes are never "required" as an analysis

ProcessImplicitDefs does not require LiveVariables.

We have a plan to massively simplify some of the early passes within the regalloc superpass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 04:10:36 +00:00
Hal Finkel
0ae2510ea0 Allow bugpoint to recognize -bb-vectorize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 21:11:12 +00:00
Derek Schuff
2ea93875b2 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:30:29 +00:00
Bill Wendling
705f4813af [unwind removal] Remove a the obsolete 'unwind' enum value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149911 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:55:35 +00:00
Chris Lattner
18c7f80b3e reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul.  Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 02:29:43 +00:00
Cameron Zwarich
a99350511c Allow command-line overrides of the target triple with the Mach-O
disassembler, just like the generic disassembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149681 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 06:35:22 +00:00
Cameron Zwarich
ec8eac6d8b Do the same fix as r149667, but for the Mach-O disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149674 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 05:42:17 +00:00
Cameron Zwarich
aab2191109 Fix llvm-objdump disassembly for interesting Mach-O binaries, e.g. any MacOS
dylib. This regressed with r145408. I will try to make a test case and add it
so that this doesn't happen again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 04:13:37 +00:00
Stepan Dyatkovskiy
24473120a2 SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 07:49:51 +00:00
Argyrios Kyrtzidis
91766fe066 Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.
These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149470 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 04:51:17 +00:00
Hal Finkel
de5e5ec304 Add a basic-block autovectorization pass.
This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 03:51:43 +00:00
Chris Lattner
6a89228fac eliminate the "string" form of ConstantArray::get, using
ConstantDataArray::getString instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149365 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 06:18:43 +00:00
Chris Lattner
ca012b8b23 update this to ConstantDataArray. There are no tests and this isn't using the preferred functionality for ripping apart strings, so I have no way to test this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149361 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 06:03:46 +00:00
Chris Lattner
d408f06048 Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 00:51:16 +00:00
Jim Grosbach
ebd4c05c3c Better diagnostic for malformed .org assembly directive.
Provide source line number information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 00:37:08 +00:00
Jim Grosbach
93cd59aea8 llvm-mc pass through SourceMgr to MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:20:07 +00:00
Peter Collingbourne
b56900aa86 llvm-config: Add support for CMake build trees in which the build
mode does not form part of the path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 01:31:38 +00:00
David Blaikie
4d6ccb5f68 More dead code removal (using -Wunreachable-code)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 21:51:11 +00:00
Nick Lewycky
22de16dc75 Add a TargetOption for disabling tail calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 00:34:10 +00:00
David Blaikie
fdebc38523 Remove unreachable code. (replace with llvm_unreachable to help GCC where necessary)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148284 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 04:43:56 +00:00
Jim Grosbach
61425c0a7f MCJIT support for non-function sections.
Move to a by-section allocation and relocation scheme. This allows
better support for sections which do not contain externally visible
symbols.

Flesh out the relocation address vs. local storage address separation a
bit more as well. Remote process JITs use this to tell the relocation
resolution code where the code will live when it executes.

The startFunctionBody/endFunctionBody interfaces to the JIT and the
memory manager are deprecated. They'll stick around for as long as the
old JIT does, but the MCJIT doesn't use them anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 22:26:39 +00:00
Eli Bendersky
a66a18505e Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches.
Patch developed by Andy Kaylor and Daniel Malea. Reviewed on llvm-commits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 08:56:09 +00:00
Jim Grosbach
4992881636 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 21:23:35 +00:00
Jim Grosbach
f6c22c6760 lli should only create memmgr when JITing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147969 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 21:19:49 +00:00
Jim Grosbach
bf9ab932c1 lli should create a JIT memory manager.
Previously let the JITEmitter do it. That's rather odd, and doesn't play nice
with the MCJIT, so move the (trivial) logic up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 21:12:51 +00:00
David Blaikie
2bd335470f Remove unnecessary default cases in switches that cover all enum values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147855 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 16:47:17 +00:00
Rafael Espindola
9cce24a257 Remove the logging streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147820 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 00:40:39 +00:00
Rafael Espindola
99b4237c16 Split Finish into Finish and FinishImpl to have a common place to do end of
file error checking. Use that to error on an unfinished cfi_startproc.

The error is not nice, but is already better than a segmentation fault.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07 03:13:18 +00:00
Nick Lewycky
db186c4c83 Remove extraneous ".get()->" which is just "->". No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 19:17:23 +00:00
Bill Wendling
467ef21caf Add braces to remove silly warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 06:56:22 +00:00
Rafael Espindola
aba65b05fc Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 01:20:19 +00:00
Dylan Noblesmith
9421406aad drop unneeded config.h includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 23:04:07 +00:00
David Blaikie
2d24e2a396 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:50:00 +00:00
Daniel Dunbar
275dd94afe llvm-config: Fix --targets-built, I changed this to use the registry but wasn't
properly initializing the target infos. I decided it wasn't worth linking them
in for this, so just switched back to using the Makefile variable for now. We
can reconsider later if we ever get pluggable targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146711 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 00:04:43 +00:00
Daniel Dunbar
bcf14bbd57 llvm-config: Update help text for removal of "backend" pseudo component.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 23:43:17 +00:00
Michael J. Spencer
a740e19e7e llvm-nm: refactor in order to support reading files from stdin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 23:17:29 +00:00
Daniel Dunbar
b0c594fd42 LLVMBuild: Introduce a common section which currently has a list of the
subdirectories to traverse into.
 - Originally I wanted to avoid this and just autoscan, but this has one key
   flaw in that new subdirectories can not automatically trigger a rerun of the
   llvm-build tool. This is particularly a pain when switching back and forth
   between trees where one has added a subdirectory, as the dependencies will
   tend to be wrong. This will also eliminates FIXME implicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 22:45:54 +00:00
Daniel Dunbar
4ab406d7fc LLVMBuild: Remove trailing newline, which irked me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 19:48:00 +00:00
Daniel Dunbar
8033f6197c llvm-config: Default to "all" if no components are specified.
- Fixes PR11530.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146388 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 18:22:04 +00:00
Kevin Enderby
94c2e85bea The second part of support for generating dwarf for assembly source files. This
generates the dwarf Compile Unit DIE and a dwarf subprogram DIE for each
non-temporary label.

The next part will be to get the clang driver to enable this when assembling
a .s file.  rdar://9275556


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 18:09:40 +00:00
Chad Rosier
837b4e4a44 Update bcanalyzer to handle new USELIST_BLOCK/USELIST_CODE_ENTRY.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146079 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 21:45:13 +00:00
Duncan Sands
6de29c5715 Have cmake build llvm-cov. Patch by arrowdodger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:54:41 +00:00
Duncan Sands
a3e585d4c2 When doing "opt -O2" verify the bitcode like is done for
"opt -std-compile-opts".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146036 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 17:14:20 +00:00
Jim Grosbach
5792051bfc Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145870 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 23:20:14 +00:00
Nick Lewycky
8a8d479214 Move global variables in TargetMachine into new TargetOptions class. As an API
change, now you need a TargetOptions object to create a TargetMachine. Clang
patch to follow.

One small functionality change in PTX. PTX had commented out the machine
verifier parts in their copy of printAndVerify. That now calls the version in
LLVMTargetMachine. Users of PTX who need verification disabled should rely on
not passing the command-line flag to enable it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 22:16:29 +00:00
Daniel Dunbar
cb497b888a llvm-config: Replace with C++ version (was llvm-config-2).
- Another reapply of r144300, with hopefully one last fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 20:18:09 +00:00
Daniel Dunbar
b3821996ef llvm-config-2: Fix --cflags and --includedir which pointed at the wrong
directory when running from a build directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145622 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 20:00:19 +00:00
Duncan Sands
f6ace19243 Revert commit 145449 (ddunbar) since it is breaking the dragonegg buildbots.
Original commit message:
llvm-config: Replace with C++ version (was llvm-config-2).
 - Reapply of r144300, with lots of fixes/migration easement in between.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145582 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 10:50:19 +00:00
Daniel Dunbar
2662c83a59 llvm-config: Replace with C++ version (was llvm-config-2).
- Reapply of r144300, with lots of fixes/migration easement in between.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145449 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 22:56:31 +00:00
Danil Malyshev
b0436a7305 Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 17:40:10 +00:00
Daniel Dunbar
5a939956b8 edis: Sink EDMain.cpp into lib/MC/MCDisassembler.
- This fixes some layering violations and matches how we handle the llvm-c lib,
   for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145338 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 00:25:57 +00:00
Daniel Dunbar
36e1ac7fff edis: Don't do the target initialization in EDGetDisassembler, this is contrary
to the way we currently expect target selection to work -- clients are supposed
to have control over what targets are available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145331 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 00:06:58 +00:00
Daniel Dunbar
e68c29b74d build/Make: edis isn't built as a shared library anymore, remove related cruft from the Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145329 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 00:06:53 +00:00
Chandler Carruth
790552c20f Revert r145180 as it is causing test failures on all the bots.
Original commit message:
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145182 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 10:37:47 +00:00
Danil Malyshev
9b24738bd1 Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145180 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 10:12:52 +00:00
Chris Lattner
dbc88494ee remove support for reading llvm 2.9 .bc files. LLVM 3.1 is only compatible back to 3.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 05:48:27 +00:00
Rafael Espindola
60e06d6ac2 Point to libLTO with -L/PATH/ -lLTO so that it is found in the install
directory.
Patch by Markus Trippelsdorf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145095 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-23 03:07:25 +00:00
Evan Cheng
b95fc31aa2 Sink codegen optimization level into MCCodeGenInfo along side relocation model
and code model. This eliminates the need to pass OptLevel flag all over the
place and makes it possible for any codegen pass to use this information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144788 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16 08:38:26 +00:00
Michael J. Spencer
f81285c0c5 llvm-objdump: Ignore non-objects in archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16 01:24:41 +00:00
Benjamin Kramer
a7b0cb7594 Remove all remaining uses of Value::getNameStr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 16:27:03 +00:00
Daniel Dunbar
c2f9c8984a llvm-config-2: Detect when we are running out of a BuildTools development tree, so that we can always provide library/include information for the real build directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 22:59:47 +00:00
Daniel Dunbar
0d3c223035 LLVMBuild: Add description files for the LLVM tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 22:59:39 +00:00
Benjamin Kramer
178051fbae Clients are responsible for initializing the targets, remove it from the disassembler API.
This will break users of the LLVMCreateDisasm API (not that I know of any). They have to call the 
LLVMInitializeAll* functions from llvm-c/Target.h themselves now. edis' C API in all its horribleness 
should be unaffected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 13:20:40 +00:00
Daniel Dunbar
1ad92131ab Revert r144300 "llvm-config: Replace with C++ version (was llvm-config-2).",
which didn't appear ready for prime time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144309 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 19:59:35 +00:00
Daniel Dunbar
a6f5a81285 llvm-config: Replace with C++ version (was llvm-config-2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144300 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 18:49:59 +00:00
Daniel Dunbar
f084e1dc42 llvm-config-2: Use USEDLIBS directly instead of LINK_COMPONENTS, which will
require this tool to resolve (currently).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 18:49:50 +00:00
Daniel Dunbar
b191f5a7ef llvm-config-2: Fix thinko in maintenance of visited component set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 14:53:23 +00:00
Daniel Dunbar
4cb5fff50b llvm-config: Drop 'backend' pseudo-component. We don't support/qualify the CBE
enough to have this be useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 19:23:15 +00:00
Daniel Dunbar
12d9a4629b llvm-config-2: Switch to using real library dependency table.
- Also, fix a refacto that left extra "all" component in list (this is now
   defined in the groups explicitly)
 - Reapply of r143879 now that Make should see needed deps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144201 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 19:14:51 +00:00
John McCall
fd22883a34 Use isa<> instead of dyn_cast<> as suggested by Nick.
Should've read the patch a bit closer, sorry.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 03:26:50 +00:00
John McCall
bd3c5ecd37 Fix the printing of constants. Patch by Stepan Dyatkovskiy!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144079 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 06:53:04 +00:00
Owen Anderson
7d3f8b8e48 Fix llvm-objdump's MachO mode to not depend on the value returned by RelocationRef::getInfo().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143966 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-07 17:21:36 +00:00
Daniel Dunbar
6ce1b75b43 Revert "llvm-config-2: Switch to using real library dependency table." while I
investigate build failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06 19:57:04 +00:00
Daniel Dunbar
51dc528e30 llvm-config: Users are allowed to provide component names in mixed case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143881 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06 18:04:49 +00:00
Daniel Dunbar
cc4bcba0b9 llvm-config-2: Switch to using real library dependency table.
- Also, fix a refacto that left extra "all" component in list (this is now
   defined in the groups explicitly)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06 18:04:23 +00:00
Benjamin Kramer
41a964931a Add more PRI.64 macros for MSVC and use them throughout the codebase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 08:57:40 +00:00
Peter Collingbourne
988fdc5f28 Now that the linker supports lazily materialising globals, don't
materialise them in LTO.

I observed a ~0.5-1% speedup for an LTO link of opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143784 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 04:17:25 +00:00
Peter Collingbourne
5d0f76199b Use absolute path to exportsfile in gold plugin CMake build.
(Ninja generator requirement.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143783 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 04:17:20 +00:00
Bill Wendling
931d4c2043 Reformatting changes to get rid of blank lines, put code on one line, and to
decrease some code indentation. No intended functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 18:48:00 +00:00
Bill Wendling
24c5b36841 Move comment to the correct place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143690 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 09:34:06 +00:00
Bill Wendling
a7280fd619 Make the Mangler an ivar so that it doesn't have to be passed around everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143689 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 09:30:19 +00:00
Bill Wendling
b9bff969e9 Refactor the MCContext so that it's an ivar instead of a local which is passed
around. This is important for some future work as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143688 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 09:24:40 +00:00
Daniel Dunbar
4bdd099dfc llvm-config-2: Implement build system support for getting the variables we only
know at build time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 21:01:36 +00:00
Daniel Dunbar
a3a2dfd4a2 build: Add initial cut at LLVMBuild.txt files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:53:17 +00:00
Daniel Dunbar
62b2fea43d llvm-config-2: Implement component dependency traversal, implement support for 'all', and fix a few other minor bugs.
- Still doesn't use actual generated component table, but that is now just a matter of wiring into the build system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143617 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 17:30:19 +00:00
Daniel Dunbar
7fdd291c91 llvm-config: Start stubbing out a C++ version of llvm-config (as llvm-config-2,
for now).

 - Mostly complete except for the data that needs to come from the build system
   or the dependencies.

 - Has some small improvements from current llvm-config:

   o Uses TargetRegistry directly to get some information.

   o Designed to work correctly when used from a CMake build tree (relatively
     untested currently) (although pcc fixed this recently for old llvm-config).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 17:30:16 +00:00
Chad Rosier
cde5464970 Remove some cruft from the BitcodeWriter, while still maintaining backward
compatibility in the BitcodeReader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143598 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:14:01 +00:00
Chandler Carruth
05a484b909 Add back the top-level target for 'llvm-config' and the dependency edge
to force it to build after all library targets so it has complete
dependency information. This should fix broken 'make install' with
CMake.

This is a partial revert of r143540, but it doesn't revert the most
important part of that change: removing the dependency edge from LLVM
tools to the llvm-config script.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143548 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 17:22:57 +00:00
Daniel Dunbar
47c30da847 build/Make: Get rid of llvm-config-perobj, which isn't used anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143541 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 15:56:52 +00:00
Daniel Dunbar
89975e5542 build/CMake: Remove llvm-config.target used to serialize tool builds on
llvm-config build, there is no longer a point to this after Chandler's work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143540 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 15:56:38 +00:00
Kevin Enderby
613b757689 First part of support for generating dwarf for assembly source files with the
-g flag.  In this part we generate the .file for the source being assembled and
the .loc's for the assembled instructions.

The next part will be to generate the dwarf Compile Unit DIE and a dwarf
subprogram DIE for each non-temporary label.

Once the next part is done test cases will be added.  rdar://9275556


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143509 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 22:27:22 +00:00
Sebastian Pop
0173864d8a rename getHostTriple into getDefaultTargetTriple
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 21:32:20 +00:00
Eli Friedman
597362a54b A couple misc fixes so that bugpoint doesn't explode reducing code containing landingpads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143435 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 04:40:56 +00:00
Nick Lewycky
4e478fed1b Switch new .file directive emission off by default, change llc's flag for it to
-enable-dwarf-directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143326 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 01:06:02 +00:00
Stepan Dyatkovskiy
9df3b916cd uint64 formatted output: replaced %llx with PRIx64 macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-28 13:07:32 +00:00
Peter Collingbourne
ee826c8d9c Have llvm-config --cppflags print correct flags when in CMake build directory
Previously, if invoked from a CMake build directory, 'llvm-config
--cppflags' and friends would only print a -I flag for the build
directory's header search path, because it would assume that it was
already installed, not recognising its parent directory as being the
build directory.  Teach llvm-config about CMake build directories
so that it prints a -I for both the source and build directory's
search paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-28 01:02:16 +00:00
Dan Gohman
33ba8b0e96 Remove the Alpha backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 22:56:32 +00:00
Owen Anderson
10c044e440 Revert r143149, stubbing out symbolic disassembly support. The symbolic disassembly support is too MC-engrained to be useful in llvm-objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143152 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 21:55:13 +00:00
Owen Anderson
f1b7448201 Stub out support for symbol disassembly in llvm-objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143149 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 21:46:31 +00:00
Stepan Dyatkovskiy
6eb1ed8c9c Fixed llvm-objdump uint64_t formatted output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 18:40:45 +00:00
Owen Anderson
9472b8d220 Expand relocation type field to 64 bits. MachO scattered relocations require 33 bits of type info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-26 17:08:49 +00:00
Michael J. Spencer
232b1f268c llvm-nm: Use correct format string. Patch by Stepan Dyatkovskiy!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 22:45:47 +00:00
Owen Anderson
0685e94895 Add support for the notion of "hidden" relocations. On MachO, these are relocation entries that are used as additional information for other, real relocations, rather than being relocations themselves.
I'm not familiar enough with ELF or COFF to know if they should have any relocations marked hidden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 20:35:53 +00:00
Owen Anderson
34749ce4df Fix off-by-one error when printing relocations inline with disassembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 20:15:39 +00:00
Michael J. Spencer
22ff0f33db llvm-objdump: Add static symbol table dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142404 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 19:32:17 +00:00
Daniel Dunbar
8c39c9647d build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142401 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 19:27:24 +00:00
Daniel Dunbar
bfe2a6bb59 llvm-ar: Remove local test target, this is no longer useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142400 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 19:27:10 +00:00
Daniel Dunbar
a6b1929657 llvm-config: Add an all-targets pseudo-component.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142399 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 19:27:08 +00:00
Michael J. Spencer
4984d647da Revert "llvm-objdump: Add static symbol table dumping."
This reverts commit 0c30d4e4f5f9110c5a67bd0ca84444dc58697596.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 00:17:04 +00:00
Michael J. Spencer
b12715de41 llvm-objdump: Add static symbol table dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142319 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 23:55:22 +00:00
Nick Lewycky
44d798d976 Add support for a new extension to the .file directive:
.file filenumber "directory" "filename"

This removes one join+split of the directory+filename in MC internals. Because
bitcode files have independent fields for directory and filenames in debug info,
this patch may change the .o files written by existing .bc files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 23:05:28 +00:00
Owen Anderson
481837a743 Rewrite most of MachODump to work through the generic libObject interfaces rather than accessing the MachO internals directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 21:37:35 +00:00
Michael J. Spencer
1e8ba3fa21 llvm-objdump: Add -s, which prints the contents of each section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 17:13:22 +00:00
NAKAMURA Takumi
3a35a3813d tools/CMakeLists.txt: Fixup r142103. I don't remember why I had missed the line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142136 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 11:50:37 +00:00
Chris Lattner
3f2d5f60b3 Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a
string, pass it around as an enum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 05:43:57 +00:00
Chris Lattner
d8b7aa2613 Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance
the X86 asmparser to produce ranges in the one case that was annoying me, for example:

test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
              ^~~~~~~

It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use 
ranges where appropriate if someone is interested.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142106 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 04:47:35 +00:00
NAKAMURA Takumi
4025061b8a CMake: Introduce LLVM_CLANG_SOURCE_DIR, "tools/clang" by default. Clang will not be built if LLVM_CLANG_SOURCE_DIR="" or ${LLVM_CLANG_SOURCE_DIR}/CMakeLists.txt is not found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 02:54:33 +00:00
NAKAMURA Takumi
e5ab51d51f autoconf: Introduce --with-clang-srcdir, to build out-of-tree clang as tools/clang on tools/Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 02:54:26 +00:00
Michael J. Spencer
942eb00911 llvm-object: Add inline relocation information to disassembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 22:17:18 +00:00
Michael J. Spencer
14a5f468d6 llvm-objdump: Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 20:37:20 +00:00
Michael J. Spencer
178dbd4418 llvm-objdump: Fix dumping of multiple symbols with the same address.
This happens in COFF because there is a symbol for the beginning of each
section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141885 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 20:37:08 +00:00
NAKAMURA Takumi
f048c3fe24 llvm-objdump.cpp: Use PRIx64 as format specifier for int64_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 12:51:50 +00:00
Tanya Lattner
f1f1a4f161 Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before.
This line, and those below, will be ignored--

M    include/llvm/Linker.h
M    tools/bugpoint/Miscompilation.cpp
M    tools/bugpoint/BugDriver.cpp
M    tools/llvm-link/llvm-link.cpp
M    lib/Linker/LinkModules.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 00:24:54 +00:00
Nick Lewycky
023bb15bea Add support for dumping section headers to llvm-objdump. This uses the same
flags as binutils objdump but the output is different, not just in format but
also showing different sections. Compare its results against readelf, not
objdump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141579 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 21:21:34 +00:00
Benjamin Kramer
d226ed71f2 llvm-objdump: Take ownership of MCInstrInfos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 13:10:09 +00:00
Benjamin Kramer
1a9908daeb llvm-nm: Don't leak bitcode buffers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 13:10:04 +00:00
Michael J. Spencer
27781b78e1 llvm-objdump: Add relocation and archive support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-08 00:18:30 +00:00
Michael J. Spencer
20990397a4 Fix a few changes I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141392 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 19:52:41 +00:00
Michael J. Spencer
01a4db3ed4 Fix GCC again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141389 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 19:46:12 +00:00
Michael J. Spencer
3773fb46ba Fix spelling in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141386 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 19:25:47 +00:00
Michael J. Spencer
4344b1ef9b Change relocation API to be per section. This time without breaking GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 19:25:32 +00:00
Bill Wendling
a48ad13339 Revert 141376 and 141377 due to breaking the build.
--- Reverse-merging r141377 into '.':
U    tools/llvm-objdump/MachODump.cpp
--- Reverse-merging r141376 into '.':
U    include/llvm/Object/COFF.h
U    include/llvm/Object/ObjectFile.h
U    include/llvm-c/Object.h
U    tools/llvm-objdump/llvm-objdump.cpp
U    lib/Object/MachOObjectFile.cpp
U    lib/Object/COFFObjectFile.cpp
U    lib/Object/Object.cpp
U    lib/Object/ELFObjectFile.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 18:25:37 +00:00
Michael J. Spencer
67370ef903 Fix spelling in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141377 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 18:15:40 +00:00
Michael J. Spencer
f1164a2487 Change relocation API to be per section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141376 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 18:15:25 +00:00
Devang Patel
1e97def44a Update cmake list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141104 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 19:38:16 +00:00
Devang Patel
58c620024a Put GCOVFile and other related interface in a common header so that llvm-cov tool can share it with GCOV writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141095 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 17:24:48 +00:00
Peter Collingbourne
e97552e850 Exclude libLLVMTableGen.a from the shared library
Unbreaks tools for --enable-shared build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141052 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 00:30:34 +00:00
Devang Patel
0066f9290e Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140789 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 17:06:40 +00:00
Devang Patel
a5ef699f41 Clarify comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 16:52:53 +00:00
Devang Patel
8d6c0fb979 Remove unnecessary and unused data member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 16:48:44 +00:00
Devang Patel
7a50202be5 Cosmetic changes, as per Nick's review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140785 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 16:46:47 +00:00
Andrew Trick
f47e870015 Fix build failures better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 01:22:31 +00:00
Daniel Dunbar
7f3654db0c Fix build failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 01:14:42 +00:00