1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
Commit Graph

10531 Commits

Author SHA1 Message Date
David Bolvansky
62403fa0bb [PDB] Fixed null pointer dereference
Reviewers: zturner, rnk

Reviewed By: rnk

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61279

llvm-svn: 359520
2019-04-29 23:57:20 +00:00
Lang Hames
4874bd6355 [ORC] Replace the LLJIT/LLLazyJIT Create methods with Builder utilities.
LLJITBuilder and LLLazyJITBuilder construct LLJIT and LLLazyJIT instances
respectively. Over time these will allow more configurable options to be
added while remaining easy to use in the default case, which for default
in-process JITing is now:

auto J = ExitOnErr(LLJITBuilder.create());

llvm-svn: 359511
2019-04-29 22:37:27 +00:00
Simon Pilgrim
8417364068 [llvm-pdbutil] FunctionDumper::dump(PDBSymbolTypeFunctionArg) - fix null dereference warning
Reported in https://www.viva64.com/en/b/0629/

llvm-svn: 359488
2019-04-29 19:40:12 +00:00
Quentin Colombet
fa1c8745ac [llvm-extract] Expose the group extraction feature of the BlockExtractor
This patch extends the `-bb` option to be able to use the group
extraction feature from the BlockExtractor.
In particular, `-bb=func:bb` is modified to support a list of basic
blocks per function: `-bb=func:bb1[;bb2...]` that will be extracted
together if at all possible (region must be single entry.)

Differential Revision: https://reviews.llvm.org/D60973

llvm-svn: 359464
2019-04-29 16:14:03 +00:00
George Rimar
9ac73f2dec [yaml2obj] - Simplify and reduce the code. NFC.
This inlines 2 single line static methods
and simplifies the code.

It is also possible to remove the `Is64Bit`
variable since it is used only once,
but I am not sure it will be better for readability.

llvm-svn: 359445
2019-04-29 12:25:01 +00:00
George Rimar
939c7a6a94 [yaml2obj] - Replace a loop with write_zeros(). NFCI.
This looks better.

llvm-svn: 359444
2019-04-29 12:05:53 +00:00
George Rimar
cea76be134 [yaml2obj] - Cleanup and simplify the code. NFCI.
The current code has the following problems:
`initSymtabSectionHeader` and `initStrtabSectionHeader` method
names saying us they are going to initialize the section headers.
Though for a few cases sh_flags field is initialized outside of them.
It does not look clean. This patch moves initialization of the
sh_flags inside these methods.

Also, it removes an excessive variable, what together with the above
change hopefully makes the code a bit more readable.

llvm-svn: 359443
2019-04-29 11:54:10 +00:00
Russell Gallop
0f863f5b92 vs integration: Use llvm-lib for librarian
This uses llvm-lib.exe for the librarian instead of Visual Studio
provided lib.exe. Without this it is not possible to create static
libraries with -flto using the plugin.

Original patch by Steven Noonan

This fixes: PR41147

Differential Revision: https://reviews.llvm.org/D61193

llvm-svn: 359430
2019-04-29 10:10:17 +00:00
Fangrui Song
3c007d0f01 [llvm-nm] Simplify and fix a buffer overflow
* char SymbolAddrStr[18] can't hold "%" PRIo64 which may need 22 characters.
* Use range-based for
* Delete unnecessary typedef
* format(...).print(Str, sizeof(Str)) + outs() << Str => outs() << format(...)
* Use cascading outs() << .. << ..
* Use iterator_range(Container &&c)
* (A & B) == B => A & B   if B is a power of 2
* replace null sentinel in constants with makeArrayRef

llvm-svn: 359416
2019-04-29 05:38:22 +00:00
Lang Hames
5f67a2381d [lli] Fix a typo in a cl::opt description.
Patch by Wasiher. Thanks Wasiher!

Differential Revision: https://reviews.llvm.org/D61135

llvm-svn: 359384
2019-04-27 16:13:53 +00:00
Fangrui Song
9e863883e1 [llvm-nm][llvm-readelf] Avoid single-dash -long-option in tests
llvm-svn: 359383
2019-04-27 16:12:14 +00:00
Fangrui Song
96f2149c99 [llvm-nm] Support section type 'u': STB_GNU_UNIQUE
llvm-svn: 359380
2019-04-27 15:32:53 +00:00
Lang Hames
338f540e7b [ORC] Add a 'plugin' interface to ObjectLinkingLayer for events/configuration.
ObjectLinkingLayer::Plugin provides event notifications when objects are loaded,
emitted, and removed. It also provides a modifyPassConfig callback that allows
plugins to modify the JITLink pass configuration.

This patch moves eh-frame registration into its own plugin, and teaches
llvm-jitlink to only add that plugin when performing execution runs on
non-Windows platforms. This should allow us to re-enable the test case that was
removed in r359198.

llvm-svn: 359357
2019-04-26 22:58:39 +00:00
Fangrui Song
dad20dc754 [llvm-nm] Revert inadvertently committed 'i' change in r359314
llvm-svn: 359315
2019-04-26 16:27:11 +00:00
Fangrui Song
a1b48835b2 [ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change
llvm-svn: 359314
2019-04-26 16:21:51 +00:00
Fangrui Song
b5061735b9 [llvm-nm] Generalize symbol types 'N', 'n' and '?'
llvm-svn: 359312
2019-04-26 16:03:31 +00:00
Fangrui Song
ef40253f3f [llvm-nm] Fix handling of symbol types 't' 'd' 'r'
In addition, fix and convert the two tests to yaml2obj based. This
allows us to delete two executables.

X86/weak.test: 'v' was not tested
X86/init-fini.test: symbol types of __bss_start _edata _end were wrong
  GNU nm reports __init_array_start as 't', and __preinit_array_start as 'd'.
  __init_array_start is 't' just because its section ".init_array" starts with ".init"

  'd' makes more sense and allows us to drop the weird SHT_INIT_ARRAY rule.
  So, change __init_array_start to 'd' instead.

llvm-svn: 359311
2019-04-26 16:01:48 +00:00
George Rimar
c8c53836a7 [yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.
No need to use SmallVector of char* here.
This simplifies the code.

llvm-svn: 359301
2019-04-26 13:09:11 +00:00
George Rimar
6c21a77667 [yaml2obj] - Remove excessive variable. NFC.
`auto &Strtab` was used only once.

llvm-svn: 359300
2019-04-26 12:45:54 +00:00
George Rimar
5ade28d422 [yaml2obj] - Make the code to match the LLVM style. NFCI.
This renames the variables to uppercase and
removes use of `auto` for unobvious type.

llvm-svn: 359298
2019-04-26 12:20:51 +00:00
George Rimar
7ff57f9164 [yaml2elf] - Cleanup the initSectionHeaders(). NFCI.
This encapsulates the section specific code inside the
corresponding writeSectionContent methods.
Making the code a bit more consistent.

llvm-svn: 359297
2019-04-26 12:15:32 +00:00
Nico Weber
f3b41bed60 Minor formatting tweak, no behavior change
llvm-svn: 359295
2019-04-26 11:44:10 +00:00
Fangrui Song
5d5e6023b2 Fix typos: (re)?sor?uce -> (re)?source
Closes: https://github.com/llvm/llvm-project/pull/10

In-collaboration-with:	Olivier Cochard-Labbé <olivier@FreeBSD.org>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>

Differential Revision: https://reviews.llvm.org/D61021

llvm-svn: 359277
2019-04-26 05:56:23 +00:00
Fangrui Song
95eab210ea [llvm-objcopy] Accept --long-option but not -long-option
Summary:

llvm-{objcopy,strip} (and many other LLVM binary utilities) accept
cl::opt style -long-option as well as many short options (e.g. -p -S
-x). People who use them as replacement of GNU binutils often use the
grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x,
-Wd => -W -d, -sj.text => -s -j.text

There is ambiguity if a long option starts with the character used by a
short option. Drop the support for -long-option to resolve the ambiguity.

This divergence from other utilities is accepted (other utilities
continue supporting -long-option).
https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola

Reviewed By: jakehehrlich, jhenderson, rupprecht

Subscribers: grimar, emaste, arichardson, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60439

llvm-svn: 359265
2019-04-26 02:10:10 +00:00
George Rimar
11c903934f [yaml2obj] - Don't crash on invalid inputs.
yaml2obj might crash on invalid input when unable to parse the YAML.

Recently a crash with a very similar nature was fixed for an empty files. 
This patch revisits the fix and does it in yaml::Input instead.
It seems to be more correct way to handle such situation.

With that crash for invalid inputs is also fixed now.

Differential revision: https://reviews.llvm.org/D61059

llvm-svn: 359178
2019-04-25 09:59:55 +00:00
Lang Hames
117eab5a8a [llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.
The --args option can now be used to pass arguments to code linked with
llvm-rtdyld. E.g.

$ llvm-rtdyld file1.o file2.o --args a b c

is equivalent to:

$ ld -o program file1.o file2.o
$ ./program a b c

This is the rtdyld counterpart to the jitlink change in r359115, and makes
benchmarking and comparison between the tools easier.

llvm-svn: 359168
2019-04-25 05:02:10 +00:00
Alina Sbirlea
a86692d883 Enable LoopVectorization by default.
Summary:
When refactoring vectorization flags, vectorization was disabled by default in the new pass manager.
This patch re-enables is for both managers, and changes the assumptions opt makes, based on the new defaults.
Comments in opt.cpp should clarify the intended use of all flags to enable/disable vectorization.

Reviewers: chandlerc, jgorbe

Subscribers: jlebar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61091

llvm-svn: 359167
2019-04-25 04:49:48 +00:00
Fangrui Song
689cfdda95 [llvm-objdump] errorToErrorCode+message -> toString
For test/Object/elf-invalid-phdr.test, the intended error message got lost due to errorToErrorCode().

llvm-svn: 359166
2019-04-25 04:31:26 +00:00
Nico Weber
757bf56762 llvm-cvtres: Make new dupe resource error a bit friendlier
For well-known type IDs, include the name of the type.

To not duplicate the ID->name map, make llvm-readobj call this new
function as well.  It has slightly different output, so this also
requires updating a few tests.

Differential Revision: https://reviews.llvm.org/D61086

llvm-svn: 359153
2019-04-24 23:26:30 +00:00
Nico Weber
ff5612e13e llvm-cvtres: Remove a default argument. No behavior change.
llvm-svn: 359128
2019-04-24 19:13:38 +00:00
Lang Hames
db5690ce56 [JITLink] Add support for passing arguments to jit-linked code.
The --args option can now be used to pass arguments to code linked with
llvm-jitlink. E.g.

$ llvm-jitlink file1.o file2.o --args a b c

is equivalent to:

$ ld -o program file1.o file2.o
$ ./program a b c

llvm-svn: 359115
2019-04-24 17:23:05 +00:00
Stanislav Mekhanoshin
6ab595bb2e [AMDGPU] Add gfx1010 target definitions
Differential Revision: https://reviews.llvm.org/D61041

llvm-svn: 359113
2019-04-24 17:03:15 +00:00
JF Bastien
8a7aab38c4 Revert "[llvm-objdump] errorToErrorCode+message -> toString"
Revert r359100

It breaks llvm/test/Object/elf-invalid-phdr.test

llvm-svn: 359110
2019-04-24 16:49:30 +00:00
Lang Hames
4c563335f4 [JITLink] Refer to FDE's CIE (not the most recent CIE) when parsing eh-frame.
Frame Descriptor Entries (FDEs) have a pointer back to a Common Information
Entry (CIE) that describes how the rest FDE should be parsed. JITLink had been
assuming that FDEs always referred to the most recent CIE encountered, but the
spec allows them to point back to any previously encountered CIE. This patch
fixes JITLink to look up the correct CIE for the FDE.

The testcase is a MachO binary with an FDE that refers to a CIE that is not the
one immediately proceeding it (the layout can be viewed wit
'dwarfdump --eh-frame <testcase>'. This test case had to be a binary as llvm-mc
now sorts FDEs (as of r356216) to ensure FDEs *do* point to the most recent CIE.

llvm-svn: 359105
2019-04-24 15:15:55 +00:00
Fangrui Song
0a5734f0fe [llvm-objdump] Delete redundant check
llvm-svn: 359102
2019-04-24 15:09:23 +00:00
George Rimar
859eb7e348 [obj2yamp] - Simplify and cleanup the code in ELFDumper<ELFT>::dumpGroup a bit. NFC.
This makes the variables naming to match LLVM style,
simplifies the code used to extract the group members,
simplifies the loop and reorders the code around a bit.

llvm-svn: 359101
2019-04-24 15:03:53 +00:00
Fangrui Song
0d13435972 [llvm-objdump] errorToErrorCode+message -> toString
llvm-svn: 359100
2019-04-24 15:03:46 +00:00
Fangrui Song
f81abb362c [yaml2obj] Replace num_zeros with write_zeros
llvm-svn: 359091
2019-04-24 13:23:15 +00:00
George Rimar
8af01e13a9 [yaml2elf] - Replace a loop with write_zeros(). NFC.
And apply clang-format to the method changed.

llvm-svn: 359090
2019-04-24 13:02:15 +00:00
Fangrui Song
ab080c1a07 [CommandLine] Provide parser<unsigned long> instantiation to allow cl::opt<uint64_t> on LP64 platforms
Summary:
And migrate opt<unsigned long long> to opt<uint64_t>

Fixes PR19665

Differential Revision: https://reviews.llvm.org/D60933

llvm-svn: 359068
2019-04-24 02:40:20 +00:00
Nico Weber
f33f2288a0 llvm-cvtres: Accept /? as help flag, like cvtres.exe
llvm-svn: 359064
2019-04-24 02:11:24 +00:00
Adrian Prantl
10f8971159 [dsymutil] Put Swift interface files into a per-arch subdirectory.
This was meant to be part of the original commit r358921, but somehow
got lost.

<rdar://problem/49751748>

llvm-svn: 359010
2019-04-23 16:42:35 +00:00
Adrian Prantl
44eb269e14 [dsymutil] Fix use-after-free when sys::path::append grows the buffer.
<rdar://problem/50117620>

llvm-svn: 359003
2019-04-23 15:44:22 +00:00
Adrian Prantl
45b8490525 Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."
llvm-svn: 359002
2019-04-23 15:44:19 +00:00
Adrian Prantl
deeb82a603 [dsymutil] Fix use-after-free when sys::path::append grows the buffer.
<rdar://problem/50117620>

llvm-svn: 359001
2019-04-23 15:39:13 +00:00
Adrian Prantl
a8b770e5ab Fully qualify llvm::Optional, some compilers complain otherwise.
llvm-svn: 358933
2019-04-22 22:51:34 +00:00
Adrian Prantl
0d28c48cbe Try to work around compile errors with older versions of GCC.
llvm-svn: 358927
2019-04-22 22:40:37 +00:00
Adrian Prantl
120d9370f9 [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.
When a Swift module built with debug info imports a library without
debug info from a textual interface, the textual interface is
necessary to reconstruct types defined in the library's interface. By
recording the Swift interface files in DWARF dsymutil can collect them
and LLDB can find them.

This patch teaches dsymutil to look for DW_TAG_imported_modules and
records all references to parseable Swift ingterfrace files and copies
them to

  a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface

<rdar://problem/49751748>

llvm-svn: 358921
2019-04-22 21:33:22 +00:00
Fangrui Song
056369f3a7 Use llvm::stable_sort. NFC
llvm-svn: 358897
2019-04-22 15:53:43 +00:00
Nico Weber
0b8b46725e Attemp get llvm-jitlink building on Windows
By removing an include of dlfcn.h that looks unused.

And clang-format a too-long line while here.

llvm-svn: 358864
2019-04-21 23:50:24 +00:00