1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

5936 Commits

Author SHA1 Message Date
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