Commit Graph

3444 Commits

Author SHA1 Message Date
Chris Lattner 3d70addad7 switch opt to using PassManagerBuilder.h
llvm-svn: 131824
2011-05-22 00:21:33 +00:00
Chris Lattner ac99108d36 switch llvm-ld. It has a terrible mechanism that people can add extra
passes, it should be converted to use extension points.

llvm-svn: 131823
2011-05-22 00:21:15 +00:00
Chris Lattner f200a0af58 switch bugpoint and liblto to PassManagerBuilder.
llvm-svn: 131821
2011-05-22 00:20:07 +00:00
Andrew Trick d5d0764b3b Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request.

llvm-svn: 131780
2011-05-21 00:56:46 +00:00
Oscar Fuentes a4445d6a51 CMake builds gold by default since revision 127466. This is
inconsistent with autoconf, which by default set BINUTILS_INCDIR to
empty and exclude gold from target list.

Based on a patch by Haitao Li!

llvm-svn: 131229
2011-05-12 11:26:21 +00:00
Andrew Trick 69005e5953 Typo and missing checkin from r131186.
llvm-svn: 131187
2011-05-11 16:44:08 +00:00
Andrew Trick 55aeb55aa3 Bugpoint support for miscompilations that result in a crash.
This change allows bugpoint to pinpoint the "opt" pass and bitcode
segment responsible for a crash caused by miscompilation. At least it
works well for me now, without having to create any custom execution
wrappers.

llvm-svn: 131186
2011-05-11 16:31:24 +00:00
Jim Grosbach 112a2de78c Tidy up. 80-column and whitespace.
llvm-svn: 131094
2011-05-09 20:05:25 +00:00
Duncan Sands 9aa54fef84 Remove an unused variable.
llvm-svn: 130860
2011-05-04 19:13:01 +00:00
Rafael Espindola 7219831894 llvmc: Pass -disable-cfi to llc.
llvm-svn: 130712
2011-05-02 19:45:24 +00:00
Rafael Espindola fd05785324 Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.

This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.

llvm-svn: 130634
2011-05-01 03:50:49 +00:00
Rafael Espindola a3181d12c6 Add all the plumbing needed for MC to expand cfi to the old tables in
the final assembly. It is the same technique used when targeting
assemblers that don't support .loc.

llvm-svn: 130587
2011-04-30 03:44:37 +00:00
Chandler Carruth 3f7b581e2f Revert an unintended commit. Very sorry for this one.
llvm-svn: 130393
2011-04-28 08:18:22 +00:00
Chandler Carruth e63a7b21f6 nuke gold
llvm-svn: 130391
2011-04-28 08:17:05 +00:00
Mikhail Glushenkov f08209382a Remove all references to plugins from the LLVMC docs.
llvm-svn: 130090
2011-04-24 14:17:32 +00:00
Jay Foad 1a180156b6 Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Mikhail Glushenkov 91956aba03 The .inc file is auto-generated and must not be edited by hand.
llvm-svn: 130021
2011-04-22 22:05:29 +00:00
Rafael Espindola 6aea59268a Remove unused argument.
llvm-svn: 129955
2011-04-21 23:39:26 +00:00
Nick Lewycky 364c04ae01 Fix typo in comment.
llvm-svn: 129902
2011-04-21 01:54:08 +00:00
Daniel Dunbar c7f2f14478 llc: Fix a refacto, .loc support didn't work before 10.6.
llvm-svn: 129841
2011-04-20 00:47:19 +00:00
Daniel Dunbar cd01ed5bd6 ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OS
triple component.

llvm-svn: 129838
2011-04-20 00:14:25 +00:00
Daniel Dunbar 2b9b0e3748 ADT/Triple: Move a variety of clients to using isOSDarwin() and isOSWindows()
predicates.

llvm-svn: 129816
2011-04-19 21:14:45 +00:00
Daniel Dunbar ed3d5496dc llc: Eliminate a use of getDarwinMajorNumber().
- As before, there is a minor semantic change here (evidenced by the test
   change) for Darwin triples that have no version component. I debated changing
   the default behavior of isOSVersionLT, but decided it made more sense for
   triples to be explicit.

llvm-svn: 129805
2011-04-19 20:46:13 +00:00
Chris Lattner 0ab5e2cded Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Jim Grosbach 7cb41d787d Load multiple object files and link them via RuntimeDyld in llvm-rtdyld.
Relocations between the object modules are properly resolved, as in the
following trivial example:

$ cat t.c
int foo();
int main() {
    return foo();
}
$ cat foo.c
int foo() {
    return 65;
}
$ clang -c t.c -fno-asynchronous-unwind-tables
$ clang -c foo.c -fno-asynchronous-unwind-tables
$ llvm-rtdyld t.o foo.o ; echo $?
loaded '_main' at: 0x10015c000
65

llvm-svn: 129448
2011-04-13 15:49:40 +00:00
Jim Grosbach d35159a177 Allow user-specified program entry point for llvm-rtdyld.
llvm-svn: 129446
2011-04-13 15:38:30 +00:00
Jim Grosbach 733d305fee MCJIT lazy relocation resolution and symbol address re-assignment.
Add handling for tracking the relocations on symbols and resolving them.
Keep track of the relocations even after they are resolved so that if
the RuntimeDyld client moves the object, it can update the address and any
relocations to that object will be updated.

For our trival object file load/run test harness (llvm-rtdyld), this enables
relocations between functions located in the same object module. It should
be trivially extendable to load multiple objects with mutual references.

As a simple example, the following now works (running on x86_64 Darwin 10.6):


$ cat t.c
int bar() {
  return 65;
}

int main() {
  return bar();
}
$ clang t.c -fno-asynchronous-unwind-tables -o t.o -c
$ otool -vt t.o
t.o:
(__TEXT,__text) section
_bar:
0000000000000000  pushq %rbp
0000000000000001  movq  %rsp,%rbp
0000000000000004  movl  $0x00000041,%eax
0000000000000009  popq  %rbp
000000000000000a  ret
000000000000000b  nopl  0x00(%rax,%rax)
_main:
0000000000000010  pushq %rbp
0000000000000011  movq  %rsp,%rbp
0000000000000014  subq  $0x10,%rsp
0000000000000018  movl  $0x00000000,0xfc(%rbp)
000000000000001f  callq 0x00000024
0000000000000024  addq  $0x10,%rsp
0000000000000028  popq  %rbp
0000000000000029  ret
$ llvm-rtdyld t.o -debug-only=dyld ; echo $?
Function sym: '_bar' @ 0
Function sym: '_main' @ 16
Extracting function: _bar from [0, 15]
    allocated to 0x100153000
Extracting function: _main from [16, 41]
    allocated to 0x100154000
Relocation at '_main' + 16 from '_bar(Word1: 0x2d000000)
Resolving relocation at '_main' + 16 (0x100154010) from '_bar (0x100153000)(pcrel, type: 2, Size: 4).
loaded '_main' at: 0x100154000
65
$

llvm-svn: 129388
2011-04-12 21:20:41 +00:00
Jim Grosbach 3ed03f18d1 Tidy up a bit now that we're using the MemoryManager interface.
llvm-svn: 129328
2011-04-12 00:23:32 +00:00
Jay Foad 7c14a558fe Don't include Operator.h from InstrTypes.h.
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Sean Callanan 7ccf375622 Moved an access to an object past a NULL check,
making the MC disassembler tester more robust.

llvm-svn: 129175
2011-04-09 00:21:04 +00:00
Jim Grosbach 18b81c52bb Refactor MCJIT 32-bit section loading.
Teach 32-bit section loading to use the Memory Manager interface, just like
the 64-bit loading does. Tidy up a few other things here and there.

llvm-svn: 129138
2011-04-08 17:31:24 +00:00
Rafael Espindola ece7c9c282 If present, use gold's support for getting a file view. This prevents having
to map the file both in the linker and in the plugin.

llvm-svn: 129109
2011-04-07 21:11:00 +00:00
Jim Grosbach 23de2437bd RuntimeDyld should use the memory manager API.
Start teaching the runtime Dyld interface to use the memory manager API
for allocating space. Rather than mapping directly into the MachO object,
we extract the payload for each object and copy it into a dedicated buffer
allocated via the memory manager. For now, just do Segment64, so this works
on x86_64, but not yet on ARM.

llvm-svn: 128973
2011-04-06 01:11:05 +00:00
Chris Lattner 706754c1f2 remove graphprinter support for domfrontier.
llvm-svn: 128938
2011-04-05 21:43:56 +00:00
Andrew Trick 12004013ef Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The
current implementation isn't perfect but handles most kinds of
options. This is nice to have when decomposing the stages of
compilation and moving between different drivers. It's also a good
sanity check when comparing results produced by different command line
invocations that are expected to produce the comparable results.

Note: This is not an attempt to prolong the life of cl::Option. On the
contrary, it's a placeholder for a feature that must exist when
cl::Option is replaced by a more appropriate framework. A new
framework needs: a central option registry, dynamic name lookup,
non-global containers of option values (e.g. per-module,
per-function), *and* the ability to print options values and their defaults at
any point during compilation.

llvm-svn: 128910
2011-04-05 18:54:36 +00:00
Andrew Trick b826ae8310 whitespace
llvm-svn: 128905
2011-04-05 18:41:31 +00:00
Oscar Fuentes d8a6dd6c99 Rename LLVMConfig.cmake to LLVM-Config.cmake. The *Config.cmake naming
scheme is used by the functionality related to find_package.

llvm-svn: 128889
2011-04-05 17:02:48 +00:00
Jim Grosbach 2dcef0505f Layer the memory manager between the JIT and the runtime Dyld.
The JITMemory manager references LLVM IR constructs directly, while the
runtime Dyld works at a lower level and can handle objects which may not
originate from LLVM IR. Introduce a new layer for the memory manager to
handle the interface between them. For the MCJIT, this layer will be almost
entirely simply a call-through w/ translation between the IR objects and
symbol names.

llvm-svn: 128851
2011-04-04 23:04:39 +00:00
Devang Patel 0abc463f5b Update BreakpointPrinter to emit original function names only.
llvm-svn: 128839
2011-04-04 19:51:17 +00:00
Eric Christopher 66c1c59bdb Remove unused function.
llvm-svn: 128834
2011-04-04 17:36:11 +00:00
Chris Lattner 2c6cefc9c3 silence an unused function warning.
llvm-svn: 128831
2011-04-04 17:17:57 +00:00
Eric Christopher 19ea5ae81a Start migrating mach-o dumping facilities to the object file out of a
separate executable.

llvm-svn: 128801
2011-04-03 23:51:47 +00:00
Oscar Fuentes 25ec0d38e1 CMake: remove debug code from previous commit.
llvm-svn: 128740
2011-04-01 21:39:38 +00:00
Oscar Fuentes cde00a55c8 Fix assignment of -fPIC to CMAKE_C_FLAGS. Configure llvm-config.in.in
with the contents of CMAKE_C(XX)_FLAGS too, else `llvm-config
--c(xx)flags' doesn't tell the absolute truth.

This comes from PR9603 and is based on a patch by Ryuta Suzuki!

llvm-svn: 128727
2011-04-01 19:36:06 +00:00
Devang Patel 22430f4141 Update CMakeLists.txt
Patch by arrowdoger.

llvm-svn: 128719
2011-04-01 18:03:58 +00:00
Michael J. Spencer 3df5c04fe4 Fix whitespace.
llvm-svn: 128631
2011-03-31 13:06:39 +00:00
Michael J. Spencer c60223ef6c Switch FileRemover from PathV1 to V2.
llvm-svn: 128630
2011-03-31 13:04:19 +00:00
Jay Foad 52131344a2 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad e0938d8a87 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Francois Pichet c68476480e Update CMake link dependency.
llvm-svn: 128503
2011-03-29 23:18:51 +00:00