Commit Graph

240783 Commits

Author SHA1 Message Date
Reid Kleckner dbaa61cbe3 [codeview] Remove redundant TypeTable lookup
As written, the code should assert if this lookup would have ever
succeeded.  Without looking through composite types, the type graph
should be acyclic.

llvm-svn: 280168
2016-08-30 21:48:14 +00:00
Kevin Enderby 36865d6abf Add a test file, macho-invalid-dysymtab-extreloff-nextrel,
I forgot to do an svn add on.

llvm-svn: 280167
2016-08-30 21:48:06 +00:00
Enrico Granata b9bddc4c7f Teach ValueObject::ReadPointedString how to read char[] in host memory
llvm-svn: 280166
2016-08-30 21:33:47 +00:00
Daniel Jasper d6a0078039 clang-format: Correctly calculate affected ranges when sorting #includes.
affectedRanges takes a start and an end offset, not offset and length.

llvm-svn: 280165
2016-08-30 21:33:41 +00:00
Enrico Granata befba52f89 Fix a typo/thinko - this was generating the wrong kind of array
llvm-svn: 280164
2016-08-30 21:33:29 +00:00
Lang Hames a9c929e18f [ORC][RPC] Fix some bugs in the callB primitive.
Still no unit test due to synchronization bugs on s390. These issues were
discovered in an out-of-tree utility.

llvm-svn: 280163
2016-08-30 21:29:48 +00:00
Chris Bieneman 6d54d55648 [CMake] Ensure that compiler-rt is added first
This will enable other runtime projects to detect the presence of sanitizer runtimes by referring to the sanitizer targets directly.

llvm-svn: 280162
2016-08-30 21:29:21 +00:00
Kevin Enderby dcbc504c47 Next set of additional error checks for invalid Mach-O files for bad LC_DYSYMTAB’s.
This contains the missing checks for LC_DYSYMTAB load command fields.

llvm-svn: 280161
2016-08-30 21:28:30 +00:00
Bruno Cardoso Lopes 6736e199c7 [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.
This adds support for modules that require (no-)gnu-inline-asm
environment, such as the compiler builtin cpuid submodule.

This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871

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

rdar://problem/26931199

llvm-svn: 280159
2016-08-30 21:25:42 +00:00
Saleem Abdulrasool c08f5de7bc llvm-readobj: speculative fix for MSVC
Use the typedef rather than using to type alias the typename.

llvm-svn: 280158
2016-08-30 21:21:07 +00:00
Richard Trieu 070937a1d4 Fix memory leak by storing returned pointer in std::unique_ptr
llvm-svn: 280157
2016-08-30 21:12:48 +00:00
Rafael Espindola cceb92a075 Pass Binding instead of IsWeak to addBitcode.
We were computing the binding on both the caller and callee.

llvm-svn: 280156
2016-08-30 20:53:26 +00:00
Tim Northover 991b12bf09 GlobalISel: combine extracts & sequences created for legalization
Legalization ends up creating many G_SEQUENCE/G_EXTRACT pairs which leads to
inefficient codegen (even for -O0), so add a quick pass over the function to
remove them again.

llvm-svn: 280155
2016-08-30 20:51:25 +00:00
Matt Arsenault a609e2d5ce AMDGPU: Relax SGPR asm constraint register class
s should be SReg_32 to be as general as possible. This can avoid a copy
from m0.

llvm-svn: 280154
2016-08-30 20:50:08 +00:00
Mike Aizatsky b077d3fef2 [libfuzzer] simplified unit truncation; do not write trunc items to disc
Differential Revision: https://reviews.llvm.org/D24049

llvm-svn: 280153
2016-08-30 20:49:07 +00:00
Hemant Kulkarni 1c852951a7 Revert "ELFDumper: Unversioned symbols must not have trailing @"
This reverts commit 8df7a877949e8782a3a28e3ecdb0770c1e444056.

Fixing other repositories and adding changes together.

llvm-svn: 280152
2016-08-30 20:42:46 +00:00
Enrico Granata 639392fe76 Add SBType::GetArrayType() such that - given a type - one can make an array (of a given size) of that type
This is currently only implemented for the clang-based TypeSystem, but other languages are welcome to jump in!

llvm-svn: 280151
2016-08-30 20:39:58 +00:00
Vedant Kumar b7df1e2148 [test] Pass a fake libLTO.dylib to a driver test which depends on it
This makes it possible to run 'check-clang' on Darwin without building
libLTO.dylib. See r280142 for more context.

llvm-svn: 280150
2016-08-30 20:36:50 +00:00
Vedant Kumar c56f8ceda8 Revert "[test] Add libLTO as a clang test dependency on Darwin"
This reverts commit r280142. Mehdi suggested a better way to fix up the
test: just create a fake libLTO.dylib and tell the driver where to find
it. Patch incoming...

llvm-svn: 280149
2016-08-30 20:36:48 +00:00
Michael Kuperstein 2954d1db77 [LoopVectorizer] Predicate instructions in blocks with several incoming edges
We don't need to limit predication to blocks that have a single incoming
edge, we just need to use the right mask.
This fixes PR30172.

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

llvm-svn: 280148
2016-08-30 20:22:21 +00:00
David Majnemer ac8cfab51f [COFFObjectFile] Ignore broken symbol table
When binaries are compressed by UPX, information about symbol table
offset and symbol count remain unchanged (but became invalid due to
compression).
This causes failure in the constructor and the rest of the binary cannot
be processed.

Instead, reset symbol related information (symbol/string table pointers,
sizes) - this should disable the related iterators and functions while
the rest of the binary can still be processed.

Patch by Bandzi Michal!

llvm-svn: 280147
2016-08-30 20:20:24 +00:00
Saleem Abdulrasool 000b071b07 stats: define WIN32_LEAN_AND_MEAN when including windows.h
Reduce the amount of the header that we end up including in the build.  The
additional definitions are not necessary.

llvm-svn: 280146
2016-08-30 20:15:46 +00:00
Saleem Abdulrasool 6ca511439d profile: add missing include for Windows
Add a missing Windows.h which is needed for the windows type usage in the TU
(e.g. HANDLE).

llvm-svn: 280145
2016-08-30 20:15:44 +00:00
Davide Italiano 35af5b3d21 [LTO] Fix the logic for dropping unnamed_addr.
Differential Revision:  https://reviews.llvm.org/D24037

llvm-svn: 280144
2016-08-30 20:15:03 +00:00
Daniel Berlin c943d72d94 IntrArgMemOnly is only defined (and current AA machinery only sanely supports) pointer arguments, and these intrinsics have vector of pointer arguments. Remove ArgMemOnly until we either have the machinery, define a new attribute, or something similar
llvm-svn: 280143
2016-08-30 19:58:48 +00:00
Vedant Kumar 139756308a [test] Add libLTO as a clang test dependency on Darwin
Running 'check-clang' on a stock checkout of llvm+clang doesn't work on
Darwin, because test/Driver/darwin-ld-lto.c can't find libLTO.dylib. Add
libLTO as a clang test dependency on Darwin to fix the problem.

Note: We don't have this issue with check-all because libLTO is in the
test-depends target.

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

llvm-svn: 280142
2016-08-30 19:57:40 +00:00
Lang Hames d63c865906 Re-instate recent RPC updates (r280016, r280017, r280027, r280051) with a
workaround for the limitations of MSVC 2013's std::future class.

llvm-svn: 280141
2016-08-30 19:56:15 +00:00
Hemant Kulkarni b2081648b2 ELFDumper: Unversioned symbols must not have trailing @
llvm-svn: 280140
2016-08-30 19:50:02 +00:00
Zachary Turner 2d240d00da A few minor stylistic cleanups in StringExtractor.
Makes Peek() return a StringRef instead of a const char*.

This leads to a few callers of Peek() being able to be made a
little nicer (for example using StringRef member functions instead
of c-style strncmp and related functions) and generally safer
usage.

llvm-svn: 280139
2016-08-30 19:47:05 +00:00
Jonathan Peyton 0af717970c Appease older gcc compilers for the many-microtask-args.c test
Older gcc compilers error out with the C99 syntax of: for (int i =...)
so this change just moves the int i; declaration up above.

llvm-svn: 280138
2016-08-30 19:28:58 +00:00
Zachary Turner 9cbc8db016 Use llvm to do endian conversions.
LLDB was rolling its own endian conversion code, but functions to
do this already exist in LLVM.  While the code was probably
correct, no point reinventing the wheel when we have well tested
equivalents in LLVM that are one-liners.

llvm-svn: 280137
2016-08-30 19:28:01 +00:00
Richard Smith 3fb1a8554d PR29166: when merging declarations with typedef names for linkage purposes,
don't assume that the anonymous struct will be part of the most recent
declaration of the typedef.

llvm-svn: 280136
2016-08-30 19:13:18 +00:00
Duncan P. N. Exon Smith 73b8dbdd94 CodeGen: Fixup for r280128, since GCC isn't as permissive as Clang
Fixes the bots, e.g.:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/10055

llvm-svn: 280135
2016-08-30 19:11:11 +00:00
Richard Smith dd4ad3d2ad Unrevert r280035 now that the clang-cl bug it exposed has been fixed by
r280133. Original commit message:

C++ Modules TS: driver support for building modules.

This works as follows: we add --precompile to the existing gamut of options for
specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag
specifies that an input is taken to the precompilation step and no further, and
this can be specified when building a .pcm from a module interface or when
building a .pch from a header file.

The .cppm extension (and some related extensions) are implicitly recognized as
C++ module interface files. If --precompile is /not/ specified, the file is
compiled (via a .pcm) to a .o file containing the code for the module (and then
potentially also assembled and linked, if -S, -c, etc. are not specified). We
do not yet suppress the emission of object code for other users of the module
interface, so for now this will only work if everything in the .cppm file has
vague linkage.

As with the existing support for module-map modules, prebuilt modules can be
provided as compiler inputs either via the -fmodule-file= command-line argument
or via files named ModuleName.pcm in one of the directories specified via
-fprebuilt-module-path=.

This also exposes the -fmodules-ts cc1 flag in the driver. This is still
experimental, and in particular, the concrete syntax is subject to change as
the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does
not enable support for implicitly loading module maps nor building modules via
the module cache, but those features can be turned on separately and used in
conjunction with the Modules TS support.

llvm-svn: 280134
2016-08-30 19:06:26 +00:00
Richard Smith 8cd452d471 PR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) input types.
llvm-svn: 280133
2016-08-30 18:55:16 +00:00
Tim Northover e5102de678 GlobalISel: forbid physical registers on generic MIs.
We're intending to move to a world where the type of a register is determined
by its (unique) def. This is incompatible with physregs, which are untyped.

It also means the other passes don't have to worry quite so much about
register-class compatibility and inserting COPYs appropriately.

llvm-svn: 280132
2016-08-30 18:52:46 +00:00
Saleem Abdulrasool 6a405448f3 llvm-readobj: add support for printing GNU Notes
Add support for printing the GNU Notes.  This allows an easy way to view the
build id for a binary built with the build id.  Currently, this only handles the
GNU notes, though it would be easy to extend for other note types (default,
FreeBSD, NetBSD, etc).  Only the GNU style is supported currently.

llvm-svn: 280131
2016-08-30 18:52:02 +00:00
Saleem Abdulrasool 2613d98f2a Support: add some more ELF constants
Add constants for additional GNU note types and the GNU Notes OS type id.  This
is needed to support printing the notes in ELF binaries.

llvm-svn: 280130
2016-08-30 18:51:59 +00:00
Zachary Turner 613c075237 Fix unit test after function name change.
llvm-svn: 280129
2016-08-30 18:45:32 +00:00
Duncan P. N. Exon Smith f947c3afe1 ADT: Split ilist_node_traits into alloc and callback, NFC
Many lists want to override only allocation semantics, or callbacks for
iplist.  Split these up to prevent code duplication.
- Specialize ilist_alloc_traits to change the implementations of
  deleteNode() and createNode().
- One common desire is to do nothing deleteNode() and disable
  createNode().  Specialize ilist_alloc_traits to inherit from
  ilist_noalloc_traits for that behaviour.
- Specialize ilist_callback_traits to use the addNodeToList(),
  removeNodeFromList(), and transferNodesFromList() callbacks.

As a drive-by, add some coverage to the callback-related unit tests.

llvm-svn: 280128
2016-08-30 18:40:47 +00:00
Etienne Bergeron 982a3bcc48 typo + indentation [NFC]
llvm-svn: 280127
2016-08-30 18:38:25 +00:00
Zachary Turner fc6e880d6d Rename ArrayRef::keep_front / keep_back to take_front / take_back.
The name decided on was take_, but I only updated it for StringRef
and forgot to do it for ArrayRef.

llvm-svn: 280126
2016-08-30 18:19:18 +00:00
Kyle Butt 61aca6ef79 TailDuplication: Extract Indirect-Branch block limit as option. NFC
The existing code hard-coded a limit of 20 instructions for duplication
when a block ended with an indirect branch. Extract this as an option.
No functional change intended.

llvm-svn: 280125
2016-08-30 18:18:54 +00:00
Zachary Turner eb666b7ac5 Add a few more unit tests for StringExtractor.
This is a NFC that adds more unit test coverage of the GetHex***
functions as well as the functions to extract numbers with a
specific endianness.

llvm-svn: 280124
2016-08-30 18:12:18 +00:00
Zachary Turner d08f09c113 Convert some StringExtractor functions to accept MutableArrayRefs.
MutableArrayRef<T> is essentially a safer version of passing around
(T*, length) pairs and provides some convenient functions for working
with the data without having to manually manipulate indices.

This is a minor NFC.

llvm-svn: 280123
2016-08-30 18:12:11 +00:00
Duncan P. N. Exon Smith b7668d5164 ADT: Guarantee transferNodesFromList is only called on transfers
Guarantee that ilist_traits<T>::transferNodesFromList is only called
when nodes are actually changing lists.

I also moved all the callbacks to occur *first*, before the operation.
This is the only choice for iplist<T>::merge, so we might as well be
consistent.  I expect this to have no effect in practice, although it
simplifies the logic in both iplist<T>::transfer and iplist<T>::insert.

llvm-svn: 280122
2016-08-30 18:00:45 +00:00
Niels Ole Salscheider 63f71057c0 configure.py: Add polaris10 and polaris11
llvm-svn: 280121
2016-08-30 18:00:41 +00:00
Niels Ole Salscheider c37d69f1ee Basic/Targets.cpp: Add polaris10 and polaris11 gpus
Differential Revision: https://reviews.llvm.org/D23746

llvm-svn: 280120
2016-08-30 18:00:22 +00:00
Eugene Zelenko 8899d52c18 [Release notes] Fix highlighting.
llvm-svn: 280119
2016-08-30 17:47:07 +00:00
Olivier Goffart b37a5e3a71 Fix colored diagnostics from tools
r271042 changed the way the diagnostic arguments are parsed. It assumes that
the diagnostics options were already parsed by the "Driver".
For tools using clang::Tooling, the diagnostics argument were not parsed.

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

llvm-svn: 280118
2016-08-30 17:42:29 +00:00