1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

3664 Commits

Author SHA1 Message Date
Owen Anderson
7a9bb4d47f Expand relocation type field to 64 bits. MachO scattered relocations require 33 bits of type info.
llvm-svn: 143032
2011-10-26 17:08:49 +00:00
Michael J. Spencer
2ec1e8e92f llvm-nm: Use correct format string. Patch by Stepan Dyatkovskiy!
llvm-svn: 142984
2011-10-25 22:45:47 +00:00
Owen Anderson
69d98376b9 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.

llvm-svn: 142961
2011-10-25 20:35:53 +00:00
Owen Anderson
df9058b98c Fix off-by-one error when printing relocations inline with disassembly.
llvm-svn: 142952
2011-10-25 20:15:39 +00:00
Michael J. Spencer
f21a701890 llvm-objdump: Add static symbol table dumping.
llvm-svn: 142404
2011-10-18 19:32:17 +00:00
Daniel Dunbar
81780d9982 build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Daniel Dunbar
2299fff72b llvm-ar: Remove local test target, this is no longer useful.
llvm-svn: 142400
2011-10-18 19:27:10 +00:00
Daniel Dunbar
ff8a3694fe llvm-config: Add an all-targets pseudo-component.
llvm-svn: 142399
2011-10-18 19:27:08 +00:00
Michael J. Spencer
00c39291ef Revert "llvm-objdump: Add static symbol table dumping."
This reverts commit 0c30d4e4f5f9110c5a67bd0ca84444dc58697596.

llvm-svn: 142320
2011-10-18 00:17:04 +00:00
Michael J. Spencer
8c590fd08d llvm-objdump: Add static symbol table dumping.
llvm-svn: 142319
2011-10-17 23:55:22 +00:00
Nick Lewycky
c551c1c5f9 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.

llvm-svn: 142300
2011-10-17 23:05:28 +00:00
Owen Anderson
e607004d1b Rewrite most of MachODump to work through the generic libObject interfaces rather than accessing the MachO internals directly.
llvm-svn: 142263
2011-10-17 21:37:35 +00:00
Michael J. Spencer
277eaf9f19 llvm-objdump: Add -s, which prints the contents of each section.
llvm-svn: 142199
2011-10-17 17:13:22 +00:00
NAKAMURA Takumi
782601653d tools/CMakeLists.txt: Fixup r142103. I don't remember why I had missed the line.
llvm-svn: 142136
2011-10-16 11:50:37 +00:00
Chris Lattner
391d90c9a6 Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a
string, pass it around as an enum.

llvm-svn: 142107
2011-10-16 05:43:57 +00:00
Chris Lattner
321335142c 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.

llvm-svn: 142106
2011-10-16 04:47:35 +00:00
NAKAMURA Takumi
9ef901972f 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.
llvm-svn: 142103
2011-10-16 02:54:33 +00:00
NAKAMURA Takumi
3e8c737ac8 autoconf: Introduce --with-clang-srcdir, to build out-of-tree clang as tools/clang on tools/Makefile.
llvm-svn: 142102
2011-10-16 02:54:26 +00:00
Michael J. Spencer
4ee36e15ad llvm-object: Add inline relocation information to disassembly.
llvm-svn: 141897
2011-10-13 22:17:18 +00:00
Michael J. Spencer
309e0cb513 llvm-objdump: Fix whitespace.
llvm-svn: 141886
2011-10-13 20:37:20 +00:00
Michael J. Spencer
fa3f63c14a 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.

llvm-svn: 141885
2011-10-13 20:37:08 +00:00
NAKAMURA Takumi
bf2fb9b9e2 llvm-objdump.cpp: Use PRIx64 as format specifier for int64_t.
llvm-svn: 141664
2011-10-11 12:51:50 +00:00
Tanya Lattner
0ae574fe2b 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

llvm-svn: 141606
2011-10-11 00:24:54 +00:00
Nick Lewycky
73e4d372d0 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.

llvm-svn: 141579
2011-10-10 21:21:34 +00:00
Benjamin Kramer
05836b12fd llvm-objdump: Take ownership of MCInstrInfos.
llvm-svn: 141535
2011-10-10 13:10:09 +00:00
Benjamin Kramer
357893ba6f llvm-nm: Don't leak bitcode buffers.
llvm-svn: 141534
2011-10-10 13:10:04 +00:00
Michael J. Spencer
e497728e76 llvm-objdump: Add relocation and archive support.
llvm-svn: 141451
2011-10-08 00:18:30 +00:00
Michael J. Spencer
7037dc0b45 Fix a few changes I missed.
llvm-svn: 141392
2011-10-07 19:52:41 +00:00
Michael J. Spencer
3cc26e4c5e Fix GCC again.
llvm-svn: 141389
2011-10-07 19:46:12 +00:00
Michael J. Spencer
022d2639d9 Fix spelling in comment.
llvm-svn: 141386
2011-10-07 19:25:47 +00:00
Michael J. Spencer
34d76cf95b Change relocation API to be per section. This time without breaking GCC.
llvm-svn: 141385
2011-10-07 19:25:32 +00:00
Bill Wendling
ecbddb2b9e 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

llvm-svn: 141379
2011-10-07 18:25:37 +00:00
Michael J. Spencer
8c104f4259 Fix spelling in comment.
llvm-svn: 141377
2011-10-07 18:15:40 +00:00
Michael J. Spencer
14925a859b Change relocation API to be per section.
llvm-svn: 141376
2011-10-07 18:15:25 +00:00
Devang Patel
196ef2ac28 Update cmake list.
llvm-svn: 141104
2011-10-04 19:38:16 +00:00
Devang Patel
90c78f84f2 Put GCOVFile and other related interface in a common header so that llvm-cov tool can share it with GCOV writer.
llvm-svn: 141095
2011-10-04 17:24:48 +00:00
Peter Collingbourne
82881bd04b Exclude libLLVMTableGen.a from the shared library
Unbreaks tools for --enable-shared build.

llvm-svn: 141052
2011-10-04 00:30:34 +00:00
Devang Patel
e5a1e5b655 Simplify.
llvm-svn: 140789
2011-09-29 17:06:40 +00:00
Devang Patel
b1bef6ba30 Clarify comments.
llvm-svn: 140787
2011-09-29 16:52:53 +00:00
Devang Patel
0729c18444 Remove unnecessary and unused data member.
llvm-svn: 140786
2011-09-29 16:48:44 +00:00
Devang Patel
204df6030c Cosmetic changes, as per Nick's review.
llvm-svn: 140785
2011-09-29 16:46:47 +00:00
Andrew Trick
3f3416249a Fix build failures better.
llvm-svn: 140758
2011-09-29 01:22:31 +00:00
Daniel Dunbar
8b3e105420 Fix build failure.
llvm-svn: 140755
2011-09-29 01:14:42 +00:00
Michael J. Spencer
3b747b0b5d llvm-size: Apply Chris's code review fixes.
This doesn't use formated_raw_ostream because it doesn't support the
functionality needed.

llvm-svn: 140751
2011-09-29 00:59:18 +00:00
Michael J. Spencer
4dc1ab6c03 Fix cast.
llvm-svn: 140726
2011-09-28 21:24:44 +00:00
Michael J. Spencer
3e283fe7d4 Add llvm-size.
llvm-svn: 140722
2011-09-28 20:57:46 +00:00
Devang Patel
3605f8423f Introduce llvm-cov.
Add llvm-cov skeleton. It has initial support to read coverage info generated by GCOVProfiling.cpp. 
Today, you can do
prompt> clang a.c -ftest-coverage -fprofile-arcs -o a
prompt> ./a
prompt> llvm-cov -gcno a.gcno -gcda a.gcda 
a.c
 :	#include "a.h"
 :	
 :	int main() {
 :		int i = 0;
 :		if (i) {
1:			int j = 0;
1:			j = 1;
1:		} else {
 :			int k = 1;
 :			k = 2;
 :		}
1:		return 0;
 :	}
 :	
 :	

llvm-svn: 140712
2011-09-28 18:50:00 +00:00
Michael J. Spencer
89e83b38cd Add binary archive support to llvm-nm.
llvm-svn: 140627
2011-09-27 19:37:18 +00:00
Benjamin Kramer
e106715386 llvm-objdump: Detach symbol listing from section enumeration for mach-o.
This reduces memory usage as we don't add the same symbol multiple times anymore.

llvm-svn: 140278
2011-09-21 22:16:43 +00:00
Benjamin Kramer
abc83415a1 llvm-objdump: Take the data from the right object when there's no dSYM around.
llvm-svn: 140269
2011-09-21 18:18:53 +00:00
Benjamin Kramer
e55a93f3a1 llvm-objdump: Fix use after free.
llvm-svn: 140237
2011-09-21 04:01:19 +00:00
Benjamin Kramer
703be6434e llvm-objdump: Output line info next to the disassembly if available.
MachO-only at the moment, sorry.

Usage:
$ llvm-objdump -d -m -g -dsym=a.out.dSYM/Contents/Resources/DWARF/a.out a.out
_main:
100000e90:	55	pushq %rbp	## test.c:11:3
…

llvm-svn: 140224
2011-09-21 01:13:19 +00:00
Benjamin Kramer
c4ca0b476f llvm-objdump: factor code better, add comments.
llvm-svn: 140153
2011-09-20 17:53:01 +00:00
Eric Christopher
e34ce0c720 Remove llvmc from CMake as well.
llvm-svn: 140109
2011-09-20 00:13:13 +00:00
Eric Christopher
92ffa08e9a Remove llvmc and assorted build machinery for it.
The problems that llvmc solved have largely been subsumed with the
tasks that the clang driver can accomplish, but llvmc lacks flexibility
and depends too heavily on the EOL'd llvm-gcc.

llvm-svn: 140093
2011-09-19 23:22:41 +00:00
Benjamin Kramer
0f569dc6bf Nope, there's another one!
llvm-svn: 140045
2011-09-19 20:23:01 +00:00
Benjamin Kramer
804be3463c Missed one instance of implicit pointer conversion.
llvm-svn: 140044
2011-09-19 20:14:46 +00:00
Benjamin Kramer
06a87d562a Try to make MSVC 2010 happy.
llvm-svn: 140042
2011-09-19 20:08:52 +00:00
Benjamin Kramer
82df2a3e37 Add a MachO-specific "mode" to llvm-objdump, that, if enabled, gathers additional information that are only available on MachO.
- It can take FunctionStarts from a binary to find entry points more accurately.
- Symbol offsets in executables are correct now.

llvm-svn: 140028
2011-09-19 17:56:04 +00:00
Chad Rosier
01ea3b0adf Add -rfunc and -rglob options to llvm-extract to support regular
expression matching.

llvm-svn: 139945
2011-09-16 21:09:17 +00:00
Owen Anderson
e54c4beb5a Don't attach annotations to MCInst's. Instead, have the disassembler return, and the printer accept, an annotation string which can be passed through if the client cares about annotations.
llvm-svn: 139876
2011-09-15 23:38:46 +00:00
Ivan Krasin
de2d3cf093 use 64-bit types instead of off_t/size_t to avoid the issue when
gold plugin is built with Large File Support (sizeof(off_t) == 64 on i686)
and the rest of LLVM is built w/o Large File Support
(sizeof(off_t) == 32 on i686) which corrupts the stack.

llvm-svn: 139873
2011-09-15 23:13:00 +00:00
Benjamin Kramer
b5c3c42a54 llvm-dwarfdump: Add an option to print out line info for a specific address
Usage:
$ llvm-dwarfdump -address=0x0000000100000ed4 a.out.dSYM/Contents/Resources/DWARF/a.out 
xxx.c:6:0

llvm-svn: 139850
2011-09-15 21:17:40 +00:00
Benjamin Kramer
900209189c DWARF: wire up .debug_str dumping.
llvm-svn: 139799
2011-09-15 16:57:13 +00:00
Benjamin Kramer
ceca872d69 DWARF: Add basic support for line tables.
The llvm-dwarfdump output isn't very verbose yet.

llvm-svn: 139771
2011-09-15 02:12:05 +00:00
Benjamin Kramer
b08f6dc724 llvm-dwarfdump: Make the "is debug info section" heuristic stricter so it doesn't accidentaly picks up the wrong section.
Also add some validation code to the aranges section parser.

Fixes PR10926.

llvm-svn: 139701
2011-09-14 17:28:13 +00:00
Benjamin Kramer
52607b3842 Object: make the following changes into SymbolRef
- Add enum SymbolType and function getSymbolType()
- Add function isGlobal() - it's returns true for symbols that can be used in another objects, such as library functions.
- Rename function getAddress() to getOffset() and add new function getAddress(), because currently getAddress() returns section offset of symbol first byte. new getAddress() return symbol address.
- Change usage SymbolRef::getAddress() to getOffset() in tools/llvm-nm and tools/llvm-objdump.

Patch by Danil Malyshev!

llvm-svn: 139683
2011-09-14 01:22:52 +00:00
Benjamin Kramer
6b456ffb42 DWARF: Port support for parsing .debug_aranges section from LLDB and wire it up to llvm-dwarfdump.
This is only one half of it, the part that caches address ranges from the DIEs when .debug_aranges is
not available will be ported soon.

llvm-svn: 139680
2011-09-14 01:09:52 +00:00
Benjamin Kramer
c4e7a56915 Sketch out a DWARF parser.
This introduces a new library to LLVM: libDebugInfo. It will provide debug information
parsing to LLVM. Much of the design and some of the code is taken from the LLDB project.

It also contains an llvm-dwarfdump tool that can dump the abbrevs and DIEs from an
object file. It can be used to write tests for DWARF input and output easily.

llvm-svn: 139627
2011-09-13 19:42:23 +00:00
Ivan Krasin
6b8225fcda gold plugin: don't report error on non-bitcode (e.g. ELF) files.
llvm-svn: 139544
2011-09-12 21:47:50 +00:00
Ivan Krasin
19d51af328 gold plugin: report errors occured in lto_module_create_from_*
llvm-svn: 139340
2011-09-09 00:14:04 +00:00
Ivan Krasin
2f2f63807f lto/addAsmGlobalSymbols: fast path when no module level asm is present.
llvm-svn: 139284
2011-09-08 07:38:25 +00:00
Ivan Krasin
6d62a9f1b3 lto/addAsmGlobalSymbols: fail fracefully when the target does not define AsmParser.
llvm-svn: 139283
2011-09-08 07:36:39 +00:00
James Molloy
f781d3d8e9 Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= handling to llvm-mc. Reviewed by Owen Anderson.
llvm-svn: 139237
2011-09-07 17:24:38 +00:00
Chandler Carruth
b853fbc5d2 As a (rather delayed) followup to r136738 which stopped building the
edis shared library in the Makefile build, also stop building it in the
CMake build.

Patch by arrowdodger!

llvm-svn: 139108
2011-09-04 23:32:05 +00:00
Benjamin Kramer
bd939ad83e Don't drop alignment info on local common symbols.
- On COFF the .lcomm directive has an alignment argument.
- On ELF we fall back to .local + .comm

Based on a patch by NAKAMURA Takumi.

Fixes PR9337, PR9483 and PR10128.

llvm-svn: 138976
2011-09-01 23:04:27 +00:00
Benjamin Kramer
2ca7c2b2c7 Teach macho-dump to dump the uleb128s referred to by linkedit_data segments.
llvm-svn: 138836
2011-08-30 22:10:58 +00:00
Benjamin Kramer
de3a6db63c Teach macho-dump how to dump linkedit_data load commands.
llvm-svn: 138807
2011-08-30 18:33:37 +00:00
Evan Cheng
420bf5446c Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.

llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Evan Cheng
ed13551c1d Some refactoring so TargetRegistry.h no longer has to include any files
from MC.

llvm-svn: 138367
2011-08-23 20:15:21 +00:00
John Criswell
6df53156ad Fixed compilation warning on Linux by fixing the type of a return value.
llvm-svn: 137913
2011-08-18 01:19:05 +00:00
Owen Anderson
3146968039 Allow the MCDisassembler to return a "soft fail" status code, indicating an instruction that is disassemblable, but invalid. Only used for ARM UNPREDICTABLE instructions at the moment.
Patch by James Molloy.

llvm-svn: 137830
2011-08-17 17:44:15 +00:00
Jim Grosbach
a9a0c62719 Remove unused Target argument from AsmParser construction methods.
The argument is unused, and is a layering violation in any case.

llvm-svn: 137735
2011-08-16 18:33:49 +00:00
Nick Lewycky
4d55409980 Fix bugpoint fallout from the new type system.
llvm-svn: 137467
2011-08-12 17:25:45 +00:00
Duncan Sands
10a9e984bc Silence a bunch (but not all) "variable written but not read" warnings
when building with assertions disabled.

llvm-svn: 137460
2011-08-12 14:54:45 +00:00
Benjamin Kramer
8c3f23ec80 Add MCInstrAnalysis class. This allows the targets to specify own versions of MCInstrDescs functions.
- Add overrides for ARM.
- Teach llvm-objdump to use this instead of plain MCInstrDesc.

llvm-svn: 137059
2011-08-08 18:56:44 +00:00
Benjamin Kramer
d4dc8d86f4 llvm-objdump: disassembly enhancements
- Indent simple loops
- Print unreachable blocks as .byte directives

llvm-svn: 137058
2011-08-08 18:41:34 +00:00
Benjamin Kramer
26d5603f54 llvm-objdump: Use help of CFG to print assembly when --cfg is passed.
This way we can avoid printing unreachable code (data).

llvm-svn: 137057
2011-08-08 18:32:12 +00:00
Bill Wendling
fdea9930ac Remove the LowerSetJmp pass. It wasn't used effectively by any of the targets.
This is some of my original LLVM code. *wipes tear*

llvm-svn: 136821
2011-08-03 22:18:20 +00:00
Evan Cheng
5267dfefb3 Kill the export list as well.
llvm-svn: 136814
2011-08-03 21:07:01 +00:00
Evan Cheng
c4182308a3 lldb doesn't need the edis dylib any more.
llvm-svn: 136738
2011-08-02 22:53:48 +00:00
Rafael Espindola
2b0d064f3b Move methods in PassManagerBuilder offline.
llvm-svn: 136727
2011-08-02 21:50:27 +00:00
Rafael Espindola
73efcf56f6 move PassManagerBuilder.h to IPO. This is a non intuitive place to put it,
but it solves a layering violation since things in Support are not supposed to
use things in Transforms.

llvm-svn: 136726
2011-08-02 21:50:24 +00:00
Douglas Gregor
44009311c6 Switch the CMake edis build over to add_llvm_library_dependencies
llvm-svn: 136463
2011-07-29 15:41:39 +00:00
Chandler Carruth
f7890e34b9 Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.

I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.

This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.

This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.

Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.

This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.

llvm-svn: 136433
2011-07-29 00:14:25 +00:00
Evan Cheng
52a35d33ff Fix llvm-mc target detection code to match llc.
llvm-svn: 136115
2011-07-26 19:02:16 +00:00
Nick Lewycky
f3995084c9 Don't try to dereference syms[0] on an empty vector. Reported by Todd Jackson
and Jeffrey Bosboom!

llvm-svn: 136066
2011-07-26 08:40:36 +00:00
Evan Cheng
8e380354c4 Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.
llvm-svn: 136031
2011-07-26 00:42:34 +00:00
Evan Cheng
2e96785311 Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.
llvm-svn: 136027
2011-07-26 00:24:13 +00:00
Evan Cheng
2a0a4e1a73 Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
llvm-svn: 136010
2011-07-25 23:24:55 +00:00