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

6008 Commits

Author SHA1 Message Date
Mehdi Amini
be5a5fb8a7 Fix lli with OrcLazyJIT: the default DataLayout was used.
Set the correct one using the TargetMachine instead.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243664
2015-07-30 17:29:33 +00:00
David Majnemer
e5042e5d24 [COFF] Add IMAGE_SCN_TYPE_NOLOAD to SectionCharacteristics
llvm-svn: 243658
2015-07-30 16:47:56 +00:00
Frederic Riss
5d7809425a [dsymutil] Re-add command line option -v this time printing the version.
llvm-svn: 243584
2015-07-29 22:29:50 +00:00
Frederic Riss
21dc39920f [dsymutil] Use option categories.
Prevent all the unrelated LLVM options to appear in the -help output
by introducing a tool specific option category. As a drive-by improve
the wording of the help message.

llvm-svn: 243583
2015-07-29 22:29:46 +00:00
Frederic Riss
a4f8c32c95 [dsymutil] Rename -v option to -verbose
The dsymutil-classic -v option dumps the tool version rather than
putting it in verbose mode. Rename -v to -verbose and update the
tests that use it (in the process removing it from a few tests that
didn't require it anymore since the -dump-debug-map option was
introduced).
A followup commit will reintroduce the -v option that dumps the
version.

llvm-svn: 243582
2015-07-29 22:29:34 +00:00
Colin LeMahieu
022e50ae96 [llvm-objdump] Inverting logic to match the word "predicate". Returning true when we want it rather than when we want to discard it.
llvm-svn: 243558
2015-07-29 19:21:13 +00:00
Colin LeMahieu
cfafccba0c [llvm-objdump] Merging MachO DumpSections in to FilterSections. Simplifying some predicate logic.
llvm-svn: 243556
2015-07-29 19:08:10 +00:00
Colin LeMahieu
b3c79b1eeb [llvm-objdump] Added -j flag to filter sections that are operated on.
llvm-svn: 243526
2015-07-29 15:45:39 +00:00
Lang Hames
787b94fac7 [RuntimeDyld] Remove a memory-leak that was introduced in r243456. Thanks to Ben
Kramer for catching this.

llvm-svn: 243476
2015-07-28 20:51:53 +00:00
Lang Hames
8d59074fa2 [RuntimeDyld] Make LoadedObjectInfo::getLoadedSectionAddress take a SectionRef
rather than a string section name.

llvm-svn: 243456
2015-07-28 17:52:11 +00:00
JF Bastien
249f34fc9a Fix llvm-config to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components.
Summary:
When LLVM is configured to build shared libraries, CMake builds each component as it's own shared object, while autoconfig/make builds them statically and then links them all together to create a single shared object. This change adds compile time config flags to `llvm-config` so it can know whether LLVM's components are separated or not and act accordingly.

This fixes `llvm-config` instead of fixing the makefiles to behave like CMake because, AIUI, LLVM's autoconfig/make build system is on the way out anyway.

This change only affects `llvm-config` from builds that use autoconfig/make.

Reviewers: jfb

Subscribers: echristo, dschuff, llvm-commits

Differential Revision: http://reviews.llvm.org/D11392

llvm-svn: 243297
2015-07-27 18:26:30 +00:00
Tobias Grosser
db9fb1a6c9 bugpoint: make the number of trim iterations a compile-time constant
Around 10 year ago Chris limited this code to a single iteration by just
dropping a break into the loop body. We now make the number of trim iterations
a compile time constant to be able to play with it and see if this can
improve the bugpoint results. We currently use with '3' still a small and
conservative value, but this can be adjusted in the future, if needed.

I tried to look for a trivial test case, but did not succeed yet.

llvm-svn: 243247
2015-07-26 15:18:45 +00:00
Davide Italiano
5ccfedafe6 [llvm-dwarfump] Don't rely on global state, part 3.
Some tools used to rely on a global static variable to keep track of the 
return value for main(). I changed llvm-cxxdump to use exit(1)
and Rafael shortly after did the same with llvm-readobj. This is
(yet) another step towards the goal.

llvm-svn: 243240
2015-07-26 05:35:59 +00:00
Chandler Carruth
60c1597466 Update for r243115 which changed the DataLayout API on TargetMachine but
didn't update the gold-plugin.

llvm-svn: 243121
2015-07-24 17:23:09 +00:00
Mehdi Amini
9f0c09e5bf Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

Differential Revision: http://reviews.llvm.org/D11103

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243114
2015-07-24 16:04:22 +00:00
Frederic Riss
2dcf00e5cf [dsymutil] Implement support for universal mach-o object files.
This patch allows llvm-dsymutil to read universal (aka fat) macho object
files and archives. The patch touches nearly everything in the BinaryHolder,
but it is fairly mechinical: the methods that returned MemoryBufferRefs or
ObjectFiles now return a vector of those, and the high-level access function
takes a triple argument to select the architecture.

There is no support yet for handling fat executables and thus no support for
writing fat object files.

llvm-svn: 243096
2015-07-24 06:41:11 +00:00
Frederic Riss
956eb975ec [dsymutil] Make the triple detection more strict.
MachOObjectFile offers a method for detecting the correct triple, use
it instead of the previous approximation. This doesn't matter right
now, but it will become important for mach-o universal (fat) binaries.

llvm-svn: 243095
2015-07-24 06:41:04 +00:00
Frederic Riss
0368aec1e3 [dsymutil] Refactor BinaryHolder internals. NFC
Call a helper that resets all the internal state of the BinaryHolder
when we change the underlying memory buffer. Makes a followup patch
a tiny bit smaller.

llvm-svn: 243094
2015-07-24 06:40:59 +00:00
Mehdi Amini
3a4451076e Revert "Remove access to the DataLayout in the TargetMachine"
This reverts commit 0f720d984f419c747709462f7476dff962c0bc41.

It breaks clang too badly, I need to prepare a proper patch for clang
first.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243089
2015-07-24 03:36:55 +00:00
Davide Italiano
49b87c8eb7 [llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.
Just skip them otherwise.

llvm-svn: 243086
2015-07-24 02:14:20 +00:00
Mehdi Amini
30b6ee8541 Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

Differential Revision: http://reviews.llvm.org/D11103

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243083
2015-07-24 01:44:39 +00:00
Colin LeMahieu
61ec4be1a3 [llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all sections instead of just text sections.
llvm-svn: 243041
2015-07-23 20:58:49 +00:00
Rafael Espindola
1882d93848 Use helper function. NFC.
llvm-svn: 243012
2015-07-23 12:51:44 +00:00
Rafael Espindola
ccff4645d4 Add a version of getSymbol with an explicit symbol table. Use it. NFC.
llvm-svn: 243011
2015-07-23 12:49:40 +00:00
Rafael Espindola
6ee9519072 Support printing relocations in files with no section table.
llvm-svn: 242998
2015-07-23 09:11:05 +00:00
Rafael Espindola
61c30ffea6 Use typdef to simplify the code. NFC.
llvm-svn: 242995
2015-07-23 08:48:14 +00:00
Frederic Riss
ff48420998 [dsymutil] Check archive members timestamps.
The debug map contains the timestamp of the object files in references.
We do not check these in the general case, but it's really useful if
you have archives where different versions of an object file have been
appended. This allows llvm-dsymutil to find the right one.

llvm-svn: 242965
2015-07-22 23:24:00 +00:00
Rafael Espindola
60b9bc96e6 Delete ELFEntityIterator. NFC.
llvm-svn: 242901
2015-07-22 14:09:20 +00:00
Benjamin Kramer
8093dd522d [dsymutil] Remove extra semicolon. NFC.
llvm-svn: 242894
2015-07-22 11:54:19 +00:00
Frederic Riss
f2d69e9ab6 [dsymutil] Implement ODR uniquing for C++ code.
This optimization allows the DWARF linker to reuse definition of
types it has emitted in previous CUs rather than reemitting them
in each CU that references them. The size and link time gains are
huge. For example when linking the DWARF for a debug build of
clang, this generates a ~150M dwarf file instead of a ~700M one
(the numbers date back a bit and must not be totally accurate
these days).

As with all the other parts of the llvm-dsymutil codebase, the
goal is to keep bit-for-bit compatibility with dsymutil-classic.
The code is littered with a lot of FIXMEs that should be
addressed once we can get rid of the compatibilty goal.

llvm-svn: 242847
2015-07-21 22:41:43 +00:00
Rafael Espindola
824cff967b Don't iterate over the program headers in the constructor of ELFFile.
Not every program needs this information.

In particular, it is necessary and sufficient for a static linker to scan the
section table.

llvm-svn: 242833
2015-07-21 20:50:53 +00:00
Rafael Espindola
d5c4dc8c4d Make printValue a member function.
We were already passing 3 values it can get from ELFDumper.

llvm-svn: 242829
2015-07-21 19:57:43 +00:00
Rafael Espindola
af31ee4414 Remove always null argument.
llvm-svn: 242828
2015-07-21 19:38:32 +00:00
Rafael Espindola
244e468fc1 Remove getStaticSymbolName.
Every user now keeps track of the correct string table to use.

llvm-svn: 242818
2015-07-21 18:04:29 +00:00
Rafael Espindola
17485291ee Remove always false parameter.
llvm-svn: 242802
2015-07-21 16:42:01 +00:00
Rafael Espindola
bd637ca3df Use range loop. NFC.
llvm-svn: 242801
2015-07-21 16:40:14 +00:00
Rafael Espindola
baa0c22119 Replace the last uses of ELF::getSymbolName in llvm-readobj.
llvm-svn: 242798
2015-07-21 16:26:21 +00:00
Rafael Espindola
7c88e30437 Use helper function. NFC.
llvm-svn: 242795
2015-07-21 16:05:53 +00:00
Rafael Espindola
1a0b4be6e2 llvm-readobj: use the associated string table to print symbols. NFI.
This just removes some cases that require ELFFile to eagerly parse the ELF
file.

llvm-svn: 242794
2015-07-21 16:02:10 +00:00
Chris Bieneman
db73898a0e [CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified.
One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included.

llvm-svn: 242793
2015-07-21 15:53:09 +00:00
Rafael Espindola
403561d674 Simplify printing the soname. NFC.
llvm-svn: 242786
2015-07-21 13:48:41 +00:00
Rafael Espindola
8232c9117b Add missing c++ marker to .h file.
llvm-svn: 242784
2015-07-21 13:42:38 +00:00
Rafael Espindola
329a6aeab9 Remove duplicated code.
Both ELFObjectFile and ELFFile had an implementation of getLoadName.

llvm-svn: 242725
2015-07-20 22:41:44 +00:00
Rafael Espindola
0f258e6887 Simplify now that we can iterate backwards. NFC.
llvm-svn: 242715
2015-07-20 21:45:56 +00:00
Chris Bieneman
136e6dc16b [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Re-landing r242059 which re-landed r241621... I'm really bad at this.

Summary (r242059):
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Summary (r241621):
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

Differential Revision: http://reviews.llvm.org/D10665

llvm-svn: 242705
2015-07-20 20:36:06 +00:00
Rafael Espindola
1c58b24a44 Remove Elf_Rela_Iter and Elf_Rel_Iter.
Use just the pointers and check for invalid relocation sections.

llvm-svn: 242700
2015-07-20 20:07:50 +00:00
Rafael Espindola
0fb99d1c9a Simplify iterating over program headers and detect corrupt ones.
We now use a simple pointer and have range loops.

llvm-svn: 242669
2015-07-20 13:35:33 +00:00
Rafael Espindola
04bc262b8d llvm-readobj: Handle invalid references to the string table.
llvm-svn: 242658
2015-07-20 03:38:17 +00:00
Rafael Espindola
7c36fd7751 llvm-readobj: call exit(1) on error.
llvm-readobj exists for testing llvm. We can safely stop the program
the first time we know the input in corrupted.

This is in preparation for making it handle a few more broken files.

llvm-svn: 242656
2015-07-20 03:23:55 +00:00
Rafael Espindola
7dddead5a9 Refactor duplicated code. NFC.
llvm-svn: 242655
2015-07-20 03:01:49 +00:00
Davide Italiano
39f1c932a2 [llvm-cxxdump] Don't rely on global state
Differential Revision:	http://reviews.llvm.org/D11227

llvm-svn: 242509
2015-07-17 06:18:36 +00:00
Rafael Espindola
0901f8e543 Delete an unused function.
Patch by Xan López!

llvm-svn: 242429
2015-07-16 18:41:41 +00:00
Rafael Espindola
d304dca4c6 For new archive member we only need to store the full path.
We were storing both the path and the file name, which was redundant
and easy to get confused up with.

llvm-svn: 242347
2015-07-15 22:46:53 +00:00
Rafael Espindola
afc94ffbf8 Simplify a few uses of remove_filename by using parent_path instead.
llvm-svn: 242334
2015-07-15 21:24:07 +00:00
Rafael Espindola
cb9db3a66d Handle the error of trying to convert a regular archive to a thin one.
While at it, test that we can add to a thin archive.

llvm-svn: 242330
2015-07-15 20:45:56 +00:00
Rafael Espindola
71571d65a9 Initial support for writing thin archives.
llvm-svn: 242269
2015-07-15 05:47:46 +00:00
Rafael Espindola
fadf8cbec7 Add support for reading members out of thin archives.
For now the Archive owns the buffers of the thin archive members.
This makes for a simple API, but all the buffers are destructed
only when the archive is destructed. This should be fine since we
close the files after mmap so we should not hit an open file
limit.

llvm-svn: 242215
2015-07-14 22:18:43 +00:00
Rafael Espindola
1893c5e76b llvm-ar: Don't try to extract from thin archives.
This matches the gnu ar behavior.

llvm-svn: 242162
2015-07-14 16:55:13 +00:00
Rafael Espindola
e5753ae917 llvm-ar: print an error when the requested member is not found.
llvm-svn: 242156
2015-07-14 16:02:40 +00:00
Rafael Espindola
98eeaa500c Use a range loop. NFC.
llvm-svn: 242153
2015-07-14 15:22:42 +00:00
JF Bastien
0e7c6963b3 Revert "Fix llvm-config to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components."
This reverts commit 01446706b4c0a86bb64768f307079cab5c514aa3.

Causes breakage, seems to be related to 'svn' in the file's name:

  CC=gcc CXX=g++ \
  ../llvm/configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-shared \
    --enable-libffi \
    --enable-targets=all \
    --disable-assertions \
    --with-python=/usr/bin/python2 \
    --enable-optimized

  make REQUIRES_RTTI=1 ENABLE_PIC=1

results:
llvm[2]: Linking Release unit test Support (without symbols)
llvm[2]: ======= Finished Linking Release Unit test Support (without symbols)
make[3]: Entering directory '/build/llvm-svn/src/build/bindings/ocaml/llvm'
make[3]: *** No rule to make target '/build/llvm-
svn/src/build/Release/lib/ocaml/libLLVM-3.7.0svn.so', needed by 'build-
deplibs'.  Stop.
make[3]: *** Waiting for unfinished jobs....
llvm[3]: Compiling llvm_ocaml.c for Release build
make[3]: Leaving directory '/build/llvm-svn/src/build/bindings/ocaml/llvm'
/build/llvm-svn/src/llvm/Makefile.rules:880: recipe for target 'all' failed
/build/llvm-svn/src/llvm/Makefile.rules:965: recipe for target 'all' failed

Differential Revision: http://reviews.llvm.org/D10716

llvm-svn: 242152
2015-07-14 15:10:34 +00:00
Rafael Espindola
82f6b3c3c2 Use std::make_tuple to reduce code duplication.
Thanks to David Blaikie for the suggestion.

llvm-svn: 242074
2015-07-13 22:01:02 +00:00
Rafael Espindola
8be47bcf22 Add support deterministic output in llvm-ar and make it the default.
llvm-svn: 242061
2015-07-13 20:38:09 +00:00
Chris Bieneman
4f92ca8a9e Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now.

llvm-svn: 242060
2015-07-13 20:30:58 +00:00
Chris Bieneman
3076439d02 [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Summary:
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Original Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

Differential Revision: http://reviews.llvm.org/D10665

llvm-svn: 242059
2015-07-13 20:23:15 +00:00
Keno Fischer
8a0c75c731 [CMake] Add missing DebugInfo libraries to llvm-shlib
Reviewers: beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11128

llvm-svn: 242054
2015-07-13 19:41:51 +00:00
Pawel Bylica
58ac32c75f [llvm-stress] Remove unneeded llvm:: prefix. NFC.
llvm-svn: 242020
2015-07-13 11:25:56 +00:00
JF Bastien
f8aca827db Fix llvm-config to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components.
Summary:
This fixes `llvm-config` instead of fixing the makefiles because, AIUI, LLVM's autoconfig/make build system is on the way out anyway.

This change only affects builds that use autoconfig/make.

Reviewers: jfb

Subscribers: echristo, dschuff, llvm-commits

Differential Revision: http://reviews.llvm.org/D10716

llvm-svn: 241938
2015-07-10 20:24:17 +00:00
Pawel Bylica
e1178bca05 [llvm-stress] Enhance scalar type selection from command line.
llvm-stress command line options like -generate-x86-fp80 has been replaced with one list-like option -types. E.g. llvm-stress -types=x86_fp80,i100,i256,half. Default types (i1, i8, i16, i32, i64, float, double) are always added at the beginning of that list.

Reviewers: hfinkel

Differential Revision: http://reviews.llvm.org/D10667

llvm-svn: 241896
2015-07-10 10:01:47 +00:00
David Majnemer
80ac5e60bf Revert the new EH instructions
This reverts commits r241888-r241891, I didn't mean to commit them.

llvm-svn: 241893
2015-07-10 07:15:17 +00:00
Daniel Jasper
3b5f4720ce Add missing 'const'. I don't think this is strictly required, but some
compiler configuration is giving me an error and it seems to be
recommended anyway.

llvm-svn: 241892
2015-07-10 07:09:20 +00:00
David Majnemer
6310e08ce2 New EH representation for MSVC compatibility
Summary:
This introduces new instructions neccessary to implement MSVC-compatible
exception handling support.  Most of the middle-end and none of the
back-end haven't been audited or updated to take them into account.

Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11041

llvm-svn: 241888
2015-07-10 07:00:44 +00:00
Michael J. Spencer
bb17a74bbd [Object][ELF] Support dumping hash-tables from files with no section table.
This time without breaking the bots.

llvm-svn: 241869
2015-07-09 22:32:24 +00:00
Reid Kleckner
620d7274c1 Expose sjlj preparation through opt for my own debugging purposes
llvm-svn: 241864
2015-07-09 21:48:40 +00:00
Rafael Espindola
111ba6bab3 Create BSD archives by default on OS X.
They should probably be created on anything that is not windows or linux, but I will
test on freebsd before changing that.

With this it is possible to bootstrap with llvm-ar instead of ar+ranlib on OS X.

llvm-svn: 241849
2015-07-09 20:12:50 +00:00
Simon Atanasyan
a847de6456 [llvm-readobj] Print MIPS PLT table
Now the -mips-plt-got prints both MIPS GOT and PLT tables.

llvm-svn: 241836
2015-07-09 18:23:10 +00:00
Simon Atanasyan
901c8a500a [yaml2obj] Initialize sh_addralign field for the .symtab section
llvm-svn: 241835
2015-07-09 18:23:02 +00:00
David Majnemer
aa29c6dcca [llvm-readobj] Re-add sanity checking which was accidentally removed in r241764
llvm-svn: 241831
2015-07-09 18:14:31 +00:00
David Majnemer
40f539becd [llvm-objdump] Require that jump targets shown in -d are functions
Don't let the disassembler pick call <.text> if a function happens to
live at the start of the section by only using function symbols.

llvm-svn: 241830
2015-07-09 18:11:40 +00:00
Justin Bogner
a395151a4b llvm-readobj: Fix an unused variable after r241764
llvm-svn: 241783
2015-07-09 04:27:36 +00:00
Adrian Prantl
e71dc1d0ed Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.
llvm-svn: 241781
2015-07-09 02:14:49 +00:00
Michael J. Spencer
b5535ebef9 [Object][ELF] Support dumping hash-tables from files with no section table.
llvm-svn: 241765
2015-07-09 00:21:06 +00:00
David Majnemer
7357b5b4b1 [CodeView] Add support for emitting column information
Column information is present in CodeView when the line table subsection
has bit 0 set to 1 in it's flags field.  The column information is
represented as a pair of 16-bit quantities: a starting and ending
column.  This information is present at the end of the chunk, after all
the line-PC pairs.

llvm-svn: 241764
2015-07-09 00:19:51 +00:00
Rafael Espindola
aa281f8938 Disallow Archive::child_iterator that don't point to an archive.
NFC, just less error prone.

llvm-svn: 241747
2015-07-08 22:15:07 +00:00
Rafael Espindola
116995db75 Start adding support for writing archives in BSD format.
No support for the symbol table yet (but will hopefully add it today).
We always use the long filename format so that we can align the member,
which is an advantage of the BSD format.

llvm-svn: 241721
2015-07-08 20:47:32 +00:00
Simon Atanasyan
3a38a7bfad [yaml2obj] Align section content using AddressAlign field's value
Use AddressAlign field's value to properly align sections content in the
yaml2obj tool. Before this change the yaml2obj ignored AddressAlign and
always aligned section on 16 bytes boundary.

llvm-svn: 241674
2015-07-08 10:12:40 +00:00
NAKAMURA Takumi
4e774b69fd Revert r241621, "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
It broke the build that relies on LLVM_EXTERNAL_CLANG_*.

llvm-svn: 241663
2015-07-08 02:35:43 +00:00
Adrian Prantl
a86ebe165a llvm-objdump: Replace the -macho -raw option with a generic -raw-clang-ast
option that works with all object container formats.
Now that clang modules/PCH are object containers this option is useful to
to construct pipes like

  llvm-objdump -raw-clang-ast foo.pcm | llvm-bcanalyzer -

to inspect the AST contents in a PCH container.
Will be tested via clang.

Belatedly addresses review feedback for r233390.

llvm-svn: 241659
2015-07-08 02:04:15 +00:00
David Majnemer
9584e54586 [llvm-objdump] Print the call target next to the instruction
GNU binutils provides this behavior.  objdump -r doesn't really help
when you aren't dealing with relocation object files.

llvm-svn: 241631
2015-07-07 22:06:59 +00:00
Chris Bieneman
13e1693131 [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables
* removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

Reviewers: bogner, samsonov, chapuni, beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10665

llvm-svn: 241621
2015-07-07 20:24:55 +00:00
Rafael Espindola
a72622b9fa Fix the -DBUILD_SHARED_LIBS=ON build.
llvm-svn: 241608
2015-07-07 17:48:00 +00:00
Rafael Espindola
5590e08308 Delete UnknownAddress. It is a perfectly valid symbol value.
getSymbolValue now returns a value that in convenient for most callers:
* 0 for undefined
* symbol size for common symbols
* offset/address for symbols the rest

Code that needs something more specific can check getSymbolFlags.

llvm-svn: 241605
2015-07-07 17:12:59 +00:00
Rafael Espindola
0132d7c261 Common symbols don't have a value.
At least not in the interface exposed by ObjectFile. This matches what ELF and
COFF implement.

Adjust existing code that was expecting them to have values. No overall
functionality change intended.

Another option would be to change the interface and the ELF and COFF
implementations to say that the value of a common symbol is its size.

llvm-svn: 241593
2015-07-07 15:05:09 +00:00
Rafael Espindola
65d267277b llvm-nm: treat weak undefined as undefined.
This matches the behavior of gnu ld.

llvm-svn: 241512
2015-07-06 21:36:23 +00:00
Rafael Espindola
fd38a28754 Swap operands instead of using !.
This avoids returning true for A == B.

Thanks to Benjamin Kramer for noticing it.

llvm-svn: 241490
2015-07-06 19:24:40 +00:00
Rafael Espindola
7b0c357367 When sorting by address, undefined symbols go first.
This matches gnu nm.

llvm-svn: 241488
2015-07-06 19:21:04 +00:00
Rafael Espindola
e679aab0ed Reduce code duplication. NFC.
llvm-svn: 241484
2015-07-06 18:48:47 +00:00
Rafael Espindola
384e9f4564 Fix printing of common symbols.
Printing the symbol size matches the behavior or both gnu nm and freebsd nm.

llvm-svn: 241480
2015-07-06 18:18:44 +00:00
Alex Lorenz
6945ffc637 llc: Add a 'run-pass' option.
This commit adds a 'run-pass' option to llc, which instructs the compiler to run
one specific code generation pass only.

Llc already has the 'start-after' and the 'stop-after' options, and this new
option complements the other two by making it easier to write tests that want
to invoke a single pass only.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D10776

llvm-svn: 241476
2015-07-06 17:44:26 +00:00
Rafael Espindola
912c2c2a57 Simplify. NFC.
llvm-svn: 241458
2015-07-06 15:53:43 +00:00