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
Peter Collingbourne
db573c5328 LTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a Reloc::Model.
This allows us to remove a bunch of code in LTOCodeGenerator and llvm-lto
and has the side effect of improving error handling in the libLTO C API.

llvm-svn: 245756
2015-08-21 22:57:17 +00:00
Davide Italiano
256ba29add [llvm-readobj] Add support for MachO DataInCodeDataCommand.
Example output:

File: <stdin>
Format: Mach-O arm
Arch: arm
AddressSize: 32bit
DataInCode {
  Data offset: 300
  Data size: 32
  Data Regions [
    DICE {
      Index: 0
      Offset: 0
      Length: 4
      Kind: 1
    }
    DICE {
      Index: 1
      Offset: 4
      Length: 4
      Kind: 4
    }
    DICE {
      Index: 2
      Offset: 8
      Length: 2
      Kind: 3
    }
    DICE {
      Index: 3
      Offset: 10
      Length: 1
      Kind: 2
    }
  ]
}

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

llvm-svn: 245732
2015-08-21 20:28:30 +00:00
Peter Collingbourne
9092fbc31c llvm-lto: Re-order code.
This saves us from needing to asave a pointer, and will be needed for an
upcoming ownership change.

llvm-svn: 245722
2015-08-21 19:09:42 +00:00
Peter Collingbourne
96b0ffdce8 TransformUtils: Introduce module splitter.
The module splitter splits a module into linkable partitions. It will
be used to implement parallel LTO code generation.

This initial version of the splitter does not attempt to deal with the
somewhat subtle symbol visibility issues around module splitting. These
will be dealt with in a future change.

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

llvm-svn: 245662
2015-08-21 02:48:20 +00:00
David Majnemer
ee4740a5b5 Replace some calls to isa<LandingPadInst> with isEHPad()
No functionality change is intended.

llvm-svn: 245487
2015-08-19 19:54:02 +00:00
Chandler Carruth
bf271cc4e6 [PM/AA] Remove the last relics of the separate IPA library from LLVM,
folding the code into the main Analysis library.

There already wasn't much of a distinction between Analysis and IPA.
A number of the passes in Analysis are actually IPA passes, and there
doesn't seem to be any advantage to separating them.

Moreover, it makes it hard to have interactions between analyses that
are both local and interprocedural. In trying to make the Alias Analysis
infrastructure work with the new pass manager, it becomes particularly
awkward to navigate this split.

I've tried to find all the places where we referenced this, but I may
have missed some. I have also adjusted the C API to continue to be
equivalently functional after this change.

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

llvm-svn: 245318
2015-08-18 17:51:53 +00:00
Chris Bieneman
a1024936aa [CMake] Fix PR14200, llvm-config output misses -fno-rtti
This change adds RTTI and Exception flags to llvm-config's cxxflags. This solution is a minimal patch to solve the issue, and is recommended for the 3.7 release branch. Tom Stellard's outstanding work is the longer term solution.

Patch By: David Wiberg

llvm-svn: 245064
2015-08-14 16:20:31 +00:00
David Majnemer
d8399d92f8 [llvm-cxxdump] Correctly process relocations when given multiple files
Archive files wouldn't lead to us reprocessing the section relocations
for the new object files.

llvm-svn: 244932
2015-08-13 18:31:43 +00:00
Yaron Keren
9267630cbc Remove and forbid raw_svector_ostream::flush() calls.
After r244870 flush() will only compare two null pointers and return,
doing nothing but wasting run time. The call is not required any more
as the stream and its SmallString are always in sync.

Thanks to David Blaikie for reviewing.

llvm-svn: 244928
2015-08-13 18:12:56 +00:00
Yaron Keren
35b21efd71 Remove raw_svector_ostream::resync and users. It's no-op after r244870.
llvm-svn: 244888
2015-08-13 12:42:25 +00:00
Reid Kleckner
b6442713bb [llvm-symbolizer] Remove underscores and other C mangling on Windows
Summary:
This makes it so that reports symbolized after the fact with
llvm-symbolizer are more similar to the ones we generate at runtime with
in-process dbghelp.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244512
2015-08-10 21:47:11 +00:00
Rafael Espindola
d1fc658396 Don't iterate over all sections in the ELFFile constructor.
With this we finally have an ELFFile that is O(1) to construct. This is helpful
for programs like lld which have to do their own section walk.

llvm-svn: 244510
2015-08-10 21:29:35 +00:00
Rafael Espindola
6e87ed90fd Use higher level functions in llvm-objdump.
This matches the rest of llvm-objdump better and isolates it from upcoming
changes to ELFFile.

llvm-svn: 244500
2015-08-10 20:50:40 +00:00
Rafael Espindola
e12302b7c2 Delete getDotSymtabSec.
Another step in avoiding iterating over all sections in the ELFFile constructor.

llvm-svn: 244496
2015-08-10 20:25:04 +00:00
Rafael Espindola
29d199aa4d Use continue to reduce indentation. NFC.
llvm-svn: 244480
2015-08-10 18:57:42 +00:00
Yaron Keren
61f6d7c22d Recommit r244470+ r244471 together, the bot failed between them.
llvm-svn: 244476
2015-08-10 18:27:51 +00:00
Yaron Keren
88665eff12 Revert r244470 and 244471 while looking into it.
llvm-svn: 244472
2015-08-10 18:14:56 +00:00
Yaron Keren
47dad377e0 Second part of r244470 (source file was unsaved in editor).
llvm-svn: 244471
2015-08-10 18:06:01 +00:00
Yaron Keren
0093118b2a Really implement David Blaikie suggestion in full of seperating
variable initialization from its usage in the push_back making
collapse of the two statements unlikely even without a comment.

llvm-svn: 244470
2015-08-10 18:03:35 +00:00
Yaron Keren
ea9a1cc024 Fully apply David Blaikie suggestion and add comment explaining why.
llvm-svn: 244461
2015-08-10 16:53:30 +00:00
Yaron Keren
620d03e422 Modify r244405 to clearer code, per David Blaikie suggestion.
llvm-svn: 244455
2015-08-10 16:15:51 +00:00
Rafael Espindola
16999b6002 elf2yaml: Use existing section walk to find the symbol table. NFC.
llvm-svn: 244447
2015-08-10 14:27:50 +00:00
Yaron Keren
59a9ea3f96 Fix dangling reference in DwarfLinker.cpp. The original code
Seq.emplace_back(Seq.back());

does not work as planned, since Seq.back() may become a dangling reference
when emplace_back is called and possibly reallocates vector. To avoid this,
the vector allocation should be reserved first and only then used.

This broke test/tools/dsymutil/X86/custom-line-table.test with Visual C++ 2013.

llvm-svn: 244405
2015-08-08 21:03:19 +00:00
Rafael Espindola
088669ce42 Convert getSymbolSection to return an ErrorOr.
This function can actually fail since the symbol contains an index to the
section and that can be invalid.

llvm-svn: 244375
2015-08-07 23:27:14 +00:00
Rafael Espindola
731b9ea15f Don't look for a SHT_DYNSYM in the ELFFile's constructor.
Yet another step in not having it scan every section.

llvm-svn: 244353
2015-08-07 20:11:08 +00:00
Rafael Espindola
246909bb95 Remove the symbol iteration functions that don't take a symbol table.
Another step in making ELFFile's constructor not iterate over all sections.

llvm-svn: 244351
2015-08-07 20:07:27 +00:00
Rafael Espindola
0d29f912e2 Add dynamic_table iterators back to ELF.h.
In tree they are only used by llvm-readobj, but it is also used by
https://github.com/mono/CppSharp.

While at it, add some missing error checking.

llvm-svn: 244320
2015-08-07 15:25:20 +00:00
Frederic Riss
fd14836f8a [dsymutil] Use the new MCDwarfLineTableParams customization to emit linetables
llvm-dsymutil has to be able to process debug info produced by other compilers
which use different line table settings. The testcase wasn't generated by
another compiler, but by a modified clang.

llvm-svn: 244319
2015-08-07 15:14:13 +00:00
Tom Stellard
f76ed1f361 ELF: Add AMDGPU specific defintions
Reviewers: rafael

Subscribers: llvm-commits

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

llvm-svn: 244303
2015-08-07 01:35:24 +00:00
Davide Italiano
19ff587956 [llvm-readobj] Convert to range-loops.
llvm-svn: 244300
2015-08-07 00:35:28 +00:00
Rafael Espindola
833df2a833 Move to llvm-readobj code that is only used there.
lld might end up using a small part of this, but it will be in a much
refactored form. For now this unblocks avoiding the full section scan in the
ELFFile constructor.

This also has a (very small) error handling improvement.

llvm-svn: 244282
2015-08-06 21:54:37 +00:00
Frederic Riss
71ba5895ea [dsymutil] Implement dSYM bundle creation
A dSYM bundle is a file hierarchy that looks slike this:
 <bundle name>.dSYM/
     Contents/
        Info.plist
        Resources/
           DWARF/
              <DWARF file(s)>

This is the default output mode of dsymutil.

llvm-svn: 244270
2015-08-06 21:05:06 +00:00
Frederic Riss
6f453bc7af [dsymutil] Add (unimplemented) --flat option
dsymutil should by default generate dSYM bundles which are filesystem
hierarchies containing the debug info and an additional Info.plist.
Currently llvm-dsymutil emits raw binaries containing the debug info.
This is what we call the 'flat mode'. Add a -f/-flat option that is
supposed to enable that flat mode, but don't wire it for now, only
pass it to the tests that will need it to stay functional once we
do bundle generation by default.
This basically makes this commit NFC and removes the noise from the
actual commit that adds support for bundle generation.

llvm-svn: 244269
2015-08-06 21:05:01 +00:00
Davide Italiano
a8729a6752 [llvm-objdump] Add missing call to exit(1).
Reported by: Rafael Espindola.

llvm-svn: 244184
2015-08-06 00:18:52 +00:00
Frederic Riss
b41419e201 [dsymutil] Do not create temporary files in -no-output mode.
The files were never written to and then deleted, but they were created
nonetheless. To prevent that, create a wrapper around the 2 variants of
createUniqueFile and use the one that only does an access(Exists) call
to check for name unicity in -no-output mode.

llvm-svn: 244172
2015-08-05 23:33:50 +00:00
Frederic Riss
fe23421d3f [dsymutil] Add support for the -arch option.
This option allows to select a subset of the architectures when
performing a universal binary link. The filter is done completely
in the mach-o specific part of the code.

llvm-svn: 244160
2015-08-05 22:33:28 +00:00
Nick Lewycky
9475c2ee80 Replace &vector[0] with vector.data() to avoid invalid dereference caught by debug STL. Also move a '*' for consistency and fix an 80-col violation.
llvm-svn: 244134
2015-08-05 21:16:02 +00:00
David Blaikie
e067b013f7 -Wdeprecated clean by making LogBuilder move constructible so it can be returned by value (in DifferenceEngine::logf)
llvm-svn: 244129
2015-08-05 21:06:50 +00:00
Richard Diamond
1c21053d08 Revert "Fix llvm-config to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components."
It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch.

This reverts commit r243297 for causing PR#24154.

llvm-svn: 244108
2015-08-05 20:03:26 +00:00
Frederic Riss
3b4a7e46d7 [dsymutil] Implement support for handling mach-o universal binaries as main input/output.
The DWARF linker isn't touched by this, the implementation links
individual files and merges them together into a fat binary by
calling out to the 'lipo' utility.

The main change is that the MachODebugMapParser can now return
multiple debug maps for a single binary.

The test just verifies that lipo would be invoked correctly, but
doesn't actually generate a binary. This mimics the way clang
tests its external iplatform tools integration.

llvm-svn: 244087
2015-08-05 18:27:44 +00:00
Frederic Riss
28d017201b [dsymutil] Introduce exit helper. NFC.
llvm-dsymutil will start creating temporary files in a followup
commit. To ease the correct cleanup of this files, introduce a
helper called to exit dsymutil.

llvm-svn: 244086
2015-08-05 18:27:38 +00:00
Frederic Riss
ca9c0a8909 [dsymutil] Split some logic into a helper function. NFC
llvm-svn: 244085
2015-08-05 18:27:34 +00:00
Davide Italiano
4ad598d142 [llvm-objdump] Call exit(1) on error, i.e. fail early.
Previously we kept going on partly corrupted input, which might result
in garbage being printed, or even worse, random crashes.
Rafael mentioned that this is the GNU behavior as well, but after some
discussion we both agreed it's probably better to emit a reasonable
error message and exit. As a side-effect of this commit, now we don't
rely on global state for error codes anymore. objdump was the last tool
in the toolchain which needed to be converted. Hopefully the old behavior
won't sneak into the tree again.

llvm-svn: 244019
2015-08-05 07:18:31 +00:00
Davide Italiano
066da459c3 [llvm-objdump] Range-loopify. NFC intended.
llvm-svn: 243905
2015-08-03 21:46:32 +00:00
Frederic Riss
dca9bc0f6e [dwarfdump] Add support for dumping mach-o universal objectfiles
llvm-svn: 243862
2015-08-03 00:10:31 +00:00
Frederic Riss
69fcb9b38c [dwarfdump] Move dumping to a helper function NFC
llvm-svn: 243861
2015-08-03 00:10:25 +00:00
Duncan P. N. Exon Smith
68a61f4116 DwarfLinker: Use DIEValueList instead of DIE, NFC
Use `DIEValueList` as a pointer to either `DIEBlock` or `DIELoc` instead
of `DIE`, since soon they won't inherit from the latter.

llvm-svn: 243857
2015-08-02 20:48:47 +00:00
Simon Atanasyan
0fb481e702 [Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobj
llvm-svn: 243833
2015-08-01 12:02:02 +00:00
Frederic Riss
45a9df0fef [dsymutil] Support multiple input files on the command line
llvm-svn: 243777
2015-07-31 20:22:20 +00:00
David Majnemer
34ee3789f3 New EH representation for MSVC compatibility
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.

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

llvm-svn: 243766
2015-07-31 17:58:14 +00:00