platform/upstream/llvm.git
8 years agoTeach ValueObject::ReadPointedString how to read char[] in host memory
Enrico Granata [Tue, 30 Aug 2016 21:33:47 +0000 (21:33 +0000)]
Teach ValueObject::ReadPointedString how to read char[] in host memory

llvm-svn: 280166

8 years agoclang-format: Correctly calculate affected ranges when sorting #includes.
Daniel Jasper [Tue, 30 Aug 2016 21:33:41 +0000 (21:33 +0000)]
clang-format: Correctly calculate affected ranges when sorting #includes.

affectedRanges takes a start and an end offset, not offset and length.

llvm-svn: 280165

8 years agoFix a typo/thinko - this was generating the wrong kind of array
Enrico Granata [Tue, 30 Aug 2016 21:33:29 +0000 (21:33 +0000)]
Fix a typo/thinko - this was generating the wrong kind of array

llvm-svn: 280164

8 years ago[ORC][RPC] Fix some bugs in the callB primitive.
Lang Hames [Tue, 30 Aug 2016 21:29:48 +0000 (21:29 +0000)]
[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

8 years ago[CMake] Ensure that compiler-rt is added first
Chris Bieneman [Tue, 30 Aug 2016 21:29:21 +0000 (21:29 +0000)]
[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

8 years agoNext set of additional error checks for invalid Mach-O files for bad LC_DYSYMTAB’s.
Kevin Enderby [Tue, 30 Aug 2016 21:28:30 +0000 (21:28 +0000)]
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

8 years ago[Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.
Bruno Cardoso Lopes [Tue, 30 Aug 2016 21:25:42 +0000 (21:25 +0000)]
[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

8 years agollvm-readobj: speculative fix for MSVC
Saleem Abdulrasool [Tue, 30 Aug 2016 21:21:07 +0000 (21:21 +0000)]
llvm-readobj: speculative fix for MSVC

Use the typedef rather than using to type alias the typename.

llvm-svn: 280158

8 years agoFix memory leak by storing returned pointer in std::unique_ptr
Richard Trieu [Tue, 30 Aug 2016 21:12:48 +0000 (21:12 +0000)]
Fix memory leak by storing returned pointer in std::unique_ptr

llvm-svn: 280157

8 years agoPass Binding instead of IsWeak to addBitcode.
Rafael Espindola [Tue, 30 Aug 2016 20:53:26 +0000 (20:53 +0000)]
Pass Binding instead of IsWeak to addBitcode.

We were computing the binding on both the caller and callee.

llvm-svn: 280156

8 years agoGlobalISel: combine extracts & sequences created for legalization
Tim Northover [Tue, 30 Aug 2016 20:51:25 +0000 (20:51 +0000)]
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

8 years agoAMDGPU: Relax SGPR asm constraint register class
Matt Arsenault [Tue, 30 Aug 2016 20:50:08 +0000 (20:50 +0000)]
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

8 years ago[libfuzzer] simplified unit truncation; do not write trunc items to disc
Mike Aizatsky [Tue, 30 Aug 2016 20:49:07 +0000 (20:49 +0000)]
[libfuzzer] simplified unit truncation; do not write trunc items to disc

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

llvm-svn: 280153

8 years agoRevert "ELFDumper: Unversioned symbols must not have trailing @"
Hemant Kulkarni [Tue, 30 Aug 2016 20:42:46 +0000 (20:42 +0000)]
Revert "ELFDumper: Unversioned symbols must not have trailing @"

This reverts commit 8df7a877949e8782a3a28e3ecdb0770c1e444056.

Fixing other repositories and adding changes together.

llvm-svn: 280152

8 years agoAdd SBType::GetArrayType() such that - given a type - one can make an array (of a...
Enrico Granata [Tue, 30 Aug 2016 20:39:58 +0000 (20:39 +0000)]
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

8 years ago[test] Pass a fake libLTO.dylib to a driver test which depends on it
Vedant Kumar [Tue, 30 Aug 2016 20:36:50 +0000 (20:36 +0000)]
[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

8 years agoRevert "[test] Add libLTO as a clang test dependency on Darwin"
Vedant Kumar [Tue, 30 Aug 2016 20:36:48 +0000 (20:36 +0000)]
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

8 years ago[LoopVectorizer] Predicate instructions in blocks with several incoming edges
Michael Kuperstein [Tue, 30 Aug 2016 20:22:21 +0000 (20:22 +0000)]
[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

8 years ago[COFFObjectFile] Ignore broken symbol table
David Majnemer [Tue, 30 Aug 2016 20:20:24 +0000 (20:20 +0000)]
[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

8 years agostats: define WIN32_LEAN_AND_MEAN when including windows.h
Saleem Abdulrasool [Tue, 30 Aug 2016 20:15:46 +0000 (20:15 +0000)]
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

8 years agoprofile: add missing include for Windows
Saleem Abdulrasool [Tue, 30 Aug 2016 20:15:44 +0000 (20:15 +0000)]
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

8 years ago[LTO] Fix the logic for dropping unnamed_addr.
Davide Italiano [Tue, 30 Aug 2016 20:15:03 +0000 (20:15 +0000)]
[LTO] Fix the logic for dropping unnamed_addr.

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

llvm-svn: 280144

8 years agoIntrArgMemOnly is only defined (and current AA machinery only sanely supports) pointe...
Daniel Berlin [Tue, 30 Aug 2016 19:58:48 +0000 (19:58 +0000)]
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

8 years ago[test] Add libLTO as a clang test dependency on Darwin
Vedant Kumar [Tue, 30 Aug 2016 19:57:40 +0000 (19:57 +0000)]
[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

8 years agoRe-instate recent RPC updates (r280016, r280017, r280027, r280051) with a
Lang Hames [Tue, 30 Aug 2016 19:56:15 +0000 (19:56 +0000)]
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

8 years agoELFDumper: Unversioned symbols must not have trailing @
Hemant Kulkarni [Tue, 30 Aug 2016 19:50:02 +0000 (19:50 +0000)]
ELFDumper: Unversioned symbols must not have trailing @

llvm-svn: 280140

8 years agoA few minor stylistic cleanups in StringExtractor.
Zachary Turner [Tue, 30 Aug 2016 19:47:05 +0000 (19:47 +0000)]
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

8 years agoAppease older gcc compilers for the many-microtask-args.c test
Jonathan Peyton [Tue, 30 Aug 2016 19:28:58 +0000 (19:28 +0000)]
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

8 years agoUse llvm to do endian conversions.
Zachary Turner [Tue, 30 Aug 2016 19:28:01 +0000 (19:28 +0000)]
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

8 years agoPR29166: when merging declarations with typedef names for linkage purposes,
Richard Smith [Tue, 30 Aug 2016 19:13:18 +0000 (19:13 +0000)]
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

8 years agoCodeGen: Fixup for r280128, since GCC isn't as permissive as Clang
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 19:11:11 +0000 (19:11 +0000)]
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

8 years agoUnrevert r280035 now that the clang-cl bug it exposed has been fixed by
Richard Smith [Tue, 30 Aug 2016 19:06:26 +0000 (19:06 +0000)]
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

8 years agoPR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) input types.
Richard Smith [Tue, 30 Aug 2016 18:55:16 +0000 (18:55 +0000)]
PR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) input types.

llvm-svn: 280133

8 years agoGlobalISel: forbid physical registers on generic MIs.
Tim Northover [Tue, 30 Aug 2016 18:52:46 +0000 (18:52 +0000)]
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

8 years agollvm-readobj: add support for printing GNU Notes
Saleem Abdulrasool [Tue, 30 Aug 2016 18:52:02 +0000 (18:52 +0000)]
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

8 years agoSupport: add some more ELF constants
Saleem Abdulrasool [Tue, 30 Aug 2016 18:51:59 +0000 (18:51 +0000)]
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

8 years agoFix unit test after function name change.
Zachary Turner [Tue, 30 Aug 2016 18:45:32 +0000 (18:45 +0000)]
Fix unit test after function name change.

llvm-svn: 280129

8 years agoADT: Split ilist_node_traits into alloc and callback, NFC
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 18:40:47 +0000 (18:40 +0000)]
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

8 years agotypo + indentation [NFC]
Etienne Bergeron [Tue, 30 Aug 2016 18:38:25 +0000 (18:38 +0000)]
typo + indentation [NFC]

llvm-svn: 280127

8 years agoRename ArrayRef::keep_front / keep_back to take_front / take_back.
Zachary Turner [Tue, 30 Aug 2016 18:19:18 +0000 (18:19 +0000)]
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

8 years agoTailDuplication: Extract Indirect-Branch block limit as option. NFC
Kyle Butt [Tue, 30 Aug 2016 18:18:54 +0000 (18:18 +0000)]
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

8 years agoAdd a few more unit tests for StringExtractor.
Zachary Turner [Tue, 30 Aug 2016 18:12:18 +0000 (18:12 +0000)]
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

8 years agoConvert some StringExtractor functions to accept MutableArrayRefs.
Zachary Turner [Tue, 30 Aug 2016 18:12:11 +0000 (18:12 +0000)]
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

8 years agoADT: Guarantee transferNodesFromList is only called on transfers
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 18:00:45 +0000 (18:00 +0000)]
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

8 years agoconfigure.py: Add polaris10 and polaris11
Niels Ole Salscheider [Tue, 30 Aug 2016 18:00:41 +0000 (18:00 +0000)]
configure.py: Add polaris10 and polaris11

llvm-svn: 280121

8 years agoBasic/Targets.cpp: Add polaris10 and polaris11 gpus
Niels Ole Salscheider [Tue, 30 Aug 2016 18:00:22 +0000 (18:00 +0000)]
Basic/Targets.cpp: Add polaris10 and polaris11 gpus

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

llvm-svn: 280120

8 years ago[Release notes] Fix highlighting.
Eugene Zelenko [Tue, 30 Aug 2016 17:47:07 +0000 (17:47 +0000)]
[Release notes] Fix highlighting.

llvm-svn: 280119

8 years agoFix colored diagnostics from tools
Olivier Goffart [Tue, 30 Aug 2016 17:42:29 +0000 (17:42 +0000)]
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

8 years agoAppease buildbots after r280114.
Zachary Turner [Tue, 30 Aug 2016 17:38:28 +0000 (17:38 +0000)]
Appease buildbots after r280114.

llvm-svn: 280117

8 years agoIR: Appease MSVC after r280107 with an & or two
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 17:34:58 +0000 (17:34 +0000)]
IR: Appease MSVC after r280107 with an & or two

Fixes the bot:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15192

llvm-svn: 280116

8 years ago[InstCombine] replace divide-by-constant checks with asserts; NFC
Sanjay Patel [Tue, 30 Aug 2016 17:31:34 +0000 (17:31 +0000)]
[InstCombine] replace divide-by-constant checks with asserts; NFC

These folds already have tests for scalar and vector types, except
for the vector div-by-0 case, so I'm adding tests for that.

llvm-svn: 280115

8 years agoAdd StringRef::take_front and StringRef::take_back
Zachary Turner [Tue, 30 Aug 2016 17:29:59 +0000 (17:29 +0000)]
Add StringRef::take_front and StringRef::take_back

Reviewed By: majnemer, rnk
Differential Revision: https://reviews.llvm.org/D23965

llvm-svn: 280114

8 years agoAdd StringRef::contains()
Zachary Turner [Tue, 30 Aug 2016 17:29:46 +0000 (17:29 +0000)]
Add StringRef::contains()

llvm-svn: 280113

8 years ago[InstCombine] clean up foldICmpDivConstant; NFCI
Sanjay Patel [Tue, 30 Aug 2016 17:10:49 +0000 (17:10 +0000)]
[InstCombine] clean up foldICmpDivConstant; NFCI

1. Fix comments to match variable names
2. Remove redundant CmpRHS variable
3. Add FIXME to replace some checks with asserts

llvm-svn: 280112

8 years agoStart reifying error descriptions (Re-do of D23672 supporting VS2013)
Filipe Cabecinhas [Tue, 30 Aug 2016 17:08:55 +0000 (17:08 +0000)]
Start reifying error descriptions (Re-do of D23672 supporting VS2013)

Summary:
@kcc: I know you've accepted the other revision, but since this is a
non-trivial change, I'm updating it to show why D24029 would help.

This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kcc, llvm-commits, kubabrecka

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

llvm-svn: 280111

8 years agoSplit ScarinessScore between its "storage" (POD), and an initializing object.
Filipe Cabecinhas [Tue, 30 Aug 2016 17:08:47 +0000 (17:08 +0000)]
Split ScarinessScore between its "storage" (POD), and an initializing object.

Summary:
This is needed so we can use it for D23672 on VS2013, since this VS
version doesn't support unrestricted unions, and doesn't allow us to
uses an object without a trivial default constructor inside a union.

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 280110

8 years agoADT: Clean up docs and formatting for ilist_traits, NFC
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 17:01:05 +0000 (17:01 +0000)]
ADT: Clean up docs and formatting for ilist_traits, NFC

This is a prep commit before splitting up ilist_node_traits and
updating/simplifying call sites.
- Move to top of file (I considered moving to a different file,
  llvm/ADT/ilist_traits.h, but it's really not much code).
- Clang-format.
- Convert comments to doxygen, clean them up, and add TODOs for what I'm
  doing next.

llvm-svn: 280109

8 years ago[CMake] Copy headers relative to LLVM_BINARY_DIR
Chris Bieneman [Tue, 30 Aug 2016 16:51:34 +0000 (16:51 +0000)]
[CMake] Copy headers relative to LLVM_BINARY_DIR

Summary: This copy phase is only needed for in-tree builds, so we should be copying to the LLVM build directory's include dir instead of the sub-project include dir.

Reviewers: bogner, EricWF

Subscribers: cfe-commits

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

llvm-svn: 280108

8 years agoADT: Split out simple_ilist, a simple intrusive list
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 16:23:55 +0000 (16:23 +0000)]
ADT: Split out simple_ilist, a simple intrusive list

Split out a new, low-level intrusive list type with clear semantics.
Unlike iplist (and ilist), all operations on simple_ilist are intrusive,
and simple_ilist never takes ownership of its nodes.  This enables an
intuitive API that has the right defaults for intrusive lists.
- insert() takes references (not pointers!) to nodes (in iplist/ilist,
  passing a reference will cause the node to be copied).
- erase() takes only iterators (like std::list), and does not destroy
  the nodes.
- remove() takes only references and has the same behaviour as erase().
- clear() does not destroy the nodes.
- The destructor does not destroy the nodes.
- New API {erase,remove,clear}AndDispose() take an extra Disposer
  functor for callsites that want to call some disposal routine (e.g.,
  std::default_delete).

This list is not currently configurable, and has no callbacks.

The initial motivation was to fix iplist<>::sort to work correctly (even
with callbacks in ilist_traits<>).  iplist<> uses simple_ilist<>::sort
directly.  The new test in unittests/IR/ModuleTest.cpp crashes without
this commit.

Fixing sort() via a low-level layer provided a good opportunity to:
- Unit test the low-level functionality thoroughly.
- Modernize the API, largely inspired by other intrusive list
  implementations.

Here's a sketch of a longer-term plan:
- Create BumpPtrList<>, a non-intrusive list implemented using
  simple_ilist<>, and use it for the Token list in
  lib/Support/YAMLParser.cpp.  This will factor out the only real use of
  createNode().
- Evolve the iplist<> and ilist<> APIs in the direction of
  simple_ilist<>, making allocation/deallocation explicit at call sites
  (similar to simple_ilist<>::eraseAndDispose()).
- Factor out remaining calls to createNode() and deleteNode() and remove
  the customization from ilist_traits<>.
- Transition uses of iplist<>/ilist<> that don't need callbacks over to
  simple_ilist<>.

llvm-svn: 280107

8 years agoXFAIL cfi/stats.cpp on Windows until we fix our DIA usage
Reid Kleckner [Tue, 30 Aug 2016 16:13:07 +0000 (16:13 +0000)]
XFAIL cfi/stats.cpp on Windows until we fix our DIA usage

llvm-svn: 280106

8 years agoFixup r279618, instantiate *AnalysisManagerProxy<*AnalysisManager,LazyCallGraph:...
NAKAMURA Takumi [Tue, 30 Aug 2016 15:47:13 +0000 (15:47 +0000)]
Fixup r279618, instantiate *AnalysisManagerProxy<*AnalysisManager,LazyCallGraph::SCC>, instead of  *AnalysisManagerProxy<*AnalysisManager,LazyCallGraph::SCC,LazyCallGraph&>, for PassID.

Or they were not instantiated as expected;

  llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::Function>, llvm::LazyCallGraph::SCC>::PassID
  llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::Function>, llvm::LazyCallGraph::SCC>::PassID

llvm-svn: 280105

8 years agoDisable clang/test/SemaTemplate/instantiation-depth-default.cpp temporarily for targe...
NAKAMURA Takumi [Tue, 30 Aug 2016 15:38:18 +0000 (15:38 +0000)]
Disable clang/test/SemaTemplate/instantiation-depth-default.cpp temporarily for targeting mingw32. It crashes. Investigating.

llvm-svn: 280104

8 years agoconsistently add \n to log and trace messages
Ed Maste [Tue, 30 Aug 2016 15:38:10 +0000 (15:38 +0000)]
consistently add \n to log and trace messages

Previously most messages included a newline in the string, but a few of
them were missing. Fix these and simplify by just adding the newline in
the _LIBUNWIND_LOG macro itself.

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

llvm-svn: 280103

8 years agoRemove mention of autoconf from the build instructions
Tamas Berghammer [Tue, 30 Aug 2016 15:32:52 +0000 (15:32 +0000)]
Remove mention of autoconf from the build instructions

autoconf+make have been removed from LLVM and LLDB ~6month ago. We
shouldn't advertise it on the website as a valid way to build LLDB.

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

llvm-svn: 280102

8 years ago[AMDGPU] Refactor SOP instructions TD files.
Valery Pykhtin [Tue, 30 Aug 2016 15:20:31 +0000 (15:20 +0000)]
[AMDGPU] Refactor SOP instructions TD files.

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

llvm-svn: 280101

8 years agoRevert "[ORC][RPC] Make the future type of an Orc RPC call Error/Expected rather...
Reid Kleckner [Tue, 30 Aug 2016 15:12:58 +0000 (15:12 +0000)]
Revert "[ORC][RPC] Make the future type of an Orc RPC call Error/Expected rather than"

This reverts commit r280016, and the followups of r280017, r280027,
r280051, r280058, and r280059.

MSVC's implementation of std::promise does not get along with
llvm::Error. It uses its promised value too much like a normal value
type.

llvm-svn: 280100

8 years agolibunwind: fix X86 register numbers for FreeBSD/i386
Ed Maste [Tue, 30 Aug 2016 15:10:08 +0000 (15:10 +0000)]
libunwind: fix X86 register numbers for FreeBSD/i386

For historical reasons i386 has ebp and esp swapped in the eh_frame
register numbering on at least Darwin.  That is:

                 Darwin      FreeBSD
        Reg #    eh_frame    eh_frame    DWARF
        =====    ========    ========    =====
          4        ebp         esp        esp
          5        esp         ebp        ebp

Although the UNW_X86_* constants are not intended to be coupled with
DWARF / eh_frame numbering they are currently conflated in libunwind.

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

llvm-svn: 280099

8 years ago[libFuzzer] fix a bug when running a single unit of N bytes with -max_len=M, M<N...
Kostya Serebryany [Tue, 30 Aug 2016 14:52:05 +0000 (14:52 +0000)]
[libFuzzer] fix a bug when running a single unit of N bytes with -max_len=M, M<N, caused a buffer overflow

llvm-svn: 280098

8 years ago[OpenCL] Make is_valid_event, create_user_event overloadable.
Alexey Bader [Tue, 30 Aug 2016 14:42:54 +0000 (14:42 +0000)]
[OpenCL] Make is_valid_event, create_user_event overloadable.

Summary: Make is_valid_event and create_user_event overloadable like other built-ins.

Patch by Evgeniy Tyurin.

Reviewers: bader, yaxunl

Subscribers: Anastasia, cfe-commits

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

llvm-svn: 280097

8 years ago[libFuzzer] stop using bits for memcmp's value profile -- seems to blow up the corpus...
Kostya Serebryany [Tue, 30 Aug 2016 14:39:33 +0000 (14:39 +0000)]
[libFuzzer] stop using bits for memcmp's value profile -- seems to blow up the corpus too much

llvm-svn: 280096

8 years ago[clang-tidy docs] Fix build errors on Sphinx 1.4.6
Haojian Wu [Tue, 30 Aug 2016 14:29:36 +0000 (14:29 +0000)]
[clang-tidy docs] Fix build errors on Sphinx 1.4.6

llvm-svn: 280095

8 years agoFix typo in comment
Nico Weber [Tue, 30 Aug 2016 14:24:28 +0000 (14:24 +0000)]
Fix typo in comment

llvm-svn: 280094

8 years ago[Hexagon] Use handleTargetFeaturesGroup to process target-specific features
Krzysztof Parzyszek [Tue, 30 Aug 2016 14:17:10 +0000 (14:17 +0000)]
[Hexagon] Use handleTargetFeaturesGroup to process target-specific features

llvm-svn: 280093

8 years ago[MC] Move parser helper functions from Asmparser to MCAsmParser
Nirav Dave [Tue, 30 Aug 2016 14:15:43 +0000 (14:15 +0000)]
[MC] Move parser helper functions from Asmparser to MCAsmParser

NFC Intended.

llvm-svn: 280092

8 years agoRevert r280035 (and followups r280057, r280085), it caused PR30195
Nico Weber [Tue, 30 Aug 2016 14:12:06 +0000 (14:12 +0000)]
Revert r280035 (and followups r280057, r280085), it caused PR30195

llvm-svn: 280091

8 years ago[Reassociate] Add additional debug output. NFC.
Chad Rosier [Tue, 30 Aug 2016 13:58:35 +0000 (13:58 +0000)]
[Reassociate] Add additional debug output. NFC.

llvm-svn: 280090

8 years agoHandle -mlong-calls on Hexagon
Krzysztof Parzyszek [Tue, 30 Aug 2016 13:57:50 +0000 (13:57 +0000)]
Handle -mlong-calls on Hexagon

Differential Revision:://reviews.llvm.org/D22766

llvm-svn: 280089

8 years agoRevert "gdb-remote: Make the sequence mutex non-recursive"
Pavel Labath [Tue, 30 Aug 2016 13:56:11 +0000 (13:56 +0000)]
Revert "gdb-remote: Make the sequence mutex non-recursive"

This reverts commit r279725 as it breaks "dynamic register size" feature of mips.

llvm-svn: 280088

8 years agoFix darwin cmake build for r279997
Pavel Labath [Tue, 30 Aug 2016 13:18:46 +0000 (13:18 +0000)]
Fix darwin cmake build for r279997

llvm-svn: 280087

8 years agolibunwind: correct 'libuwind' typo
Ed Maste [Tue, 30 Aug 2016 13:08:21 +0000 (13:08 +0000)]
libunwind: correct 'libuwind' typo

There were several instances of libuwind (missing an "n"), dating to
the initial import of libunwind.

llvm-svn: 280086

8 years agoclang/test/Driver/modules-ts.cpp: Satisfy quoted filename.
NAKAMURA Takumi [Tue, 30 Aug 2016 13:07:53 +0000 (13:07 +0000)]
clang/test/Driver/modules-ts.cpp: Satisfy quoted filename.

On win32, backslashed filename is emitted like;

  -o "C:\\bb-win\\ninja-clang-i686-msc19-R\\build\\tools\\clang\\test\\Driver\\Output\\modules-ts.cpp.tmp.o"

llvm-svn: 280085

8 years ago[mips][tsan] XFAIL on every MIPS platform an x86_64-specific test.
Vasileios Kalintiris [Tue, 30 Aug 2016 13:01:04 +0000 (13:01 +0000)]
[mips][tsan] XFAIL on every MIPS platform an x86_64-specific test.

The map32bit.cc test uses the MMAP_32BIT flag which is supported only
on x86-64.

llvm-svn: 280084

8 years agoAdd forgotten image
Tobias Grosser [Tue, 30 Aug 2016 12:41:29 +0000 (12:41 +0000)]
Add forgotten image

llvm-svn: 280083

8 years agowww: homepage "Overview and News"
Tobias Grosser [Tue, 30 Aug 2016 12:41:08 +0000 (12:41 +0000)]
www: homepage "Overview and News"

llvm-svn: 280082

8 years agowww: shorten links in menu
Tobias Grosser [Tue, 30 Aug 2016 12:41:04 +0000 (12:41 +0000)]
www: shorten links in menu

llvm-svn: 280081

8 years agowww: link to github source mirror, drop the other old source viewers
Tobias Grosser [Tue, 30 Aug 2016 12:41:02 +0000 (12:41 +0000)]
www: link to github source mirror, drop the other old source viewers

llvm-svn: 280080

8 years agowww: improve formatting of external links
Tobias Grosser [Tue, 30 Aug 2016 12:40:59 +0000 (12:40 +0000)]
www: improve formatting of external links

llvm-svn: 280079

8 years agoclang-tools-extra/test/clang-tidy/misc-move-forwarding-reference.cpp: Appease ms...
NAKAMURA Takumi [Tue, 30 Aug 2016 12:34:03 +0000 (12:34 +0000)]
clang-tools-extra/test/clang-tidy/misc-move-forwarding-reference.cpp: Appease ms targets with -fno-delayed-template-parsing.

llvm-svn: 280078

8 years ago[clang-tidy] Add check 'misc-move-forwarding-reference'
Martin Bohme [Tue, 30 Aug 2016 12:11:12 +0000 (12:11 +0000)]
[clang-tidy] Add check 'misc-move-forwarding-reference'

Summary:
The check emits a warning if std::move() is applied to a forwarding reference, i.e. an rvalue reference of a function template argument type.

If a developer is unaware of the special rules for template argument deduction on forwarding references, it will seem reasonable to apply std::move() to the forwarding reference, in the same way that this would be done for a "normal" rvalue reference.

This has a consequence that is usually unwanted and possibly surprising: If the function that takes the forwarding reference as its parameter is called with an lvalue, that lvalue will be moved from (and hence placed into an indeterminate state) even though no std::move() was applied to the lvalue at the callsite.

As a fix, the check will suggest replacing the std::move() with a std::forward().

This patch requires D23004 to be submitted before it.

Reviewers: sbenza, aaron.ballman

Subscribers: klimek, etienneb, alexfh, aaron.ballman, Prazek, Eugene.Zelenko, mgehre, cfe-commits

Projects: #clang-tools-extra

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

llvm-svn: 280077

8 years agowww: Add links to Polly Labs and Polyhedral.info
Tobias Grosser [Tue, 30 Aug 2016 12:08:25 +0000 (12:08 +0000)]
www: Add links to Polly Labs and Polyhedral.info

llvm-svn: 280076

8 years agoSILoadStoreOptimizer.cpp: Fix a warning in r279991. [-Wunused-variable]
NAKAMURA Takumi [Tue, 30 Aug 2016 11:50:21 +0000 (11:50 +0000)]
SILoadStoreOptimizer.cpp: Fix a warning in r279991. [-Wunused-variable]

llvm-svn: 280075

8 years agoFix fallout from the GetNameColonValue() refactor (r280000)
Pavel Labath [Tue, 30 Aug 2016 11:17:00 +0000 (11:17 +0000)]
Fix fallout from the GetNameColonValue() refactor (r280000)

This fixes the linux test suite.

llvm-svn: 280074

8 years ago[SimplifyCFG] Properly CSE metadata in SinkThenElseCodeToEnd
James Molloy [Tue, 30 Aug 2016 10:56:08 +0000 (10:56 +0000)]
[SimplifyCFG] Properly CSE metadata in SinkThenElseCodeToEnd

This was missing, meaning the metadata in sunk instructions was potentially bogus and could cause miscompiles.

llvm-svn: 280072

8 years agodocs: mention that clobbering output regs in inline asm is illegal.
Peter Zotov [Tue, 30 Aug 2016 10:48:31 +0000 (10:48 +0000)]
docs: mention that clobbering output regs in inline asm is illegal.

I've found this out the hard way; LLVM will not normally catch this
error (unless -verify-machineinstrs is passed), and under certain
very specific circumstances (such as register scavenger running
under pressure) this would result in an opaque crash in codegen.

llvm-svn: 280071

8 years ago[ELF] - Linkerscript: implemented ADDR command.
George Rimar [Tue, 30 Aug 2016 09:54:01 +0000 (09:54 +0000)]
[ELF] - Linkerscript: implemented ADDR command.

ADDR(section)
Return the absolute address (the VMA) of the named section.

Used in the wild, eg.: https://searchcode.com/file/53617342/arch/x86/kernel/vmlinux.lds.S

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

llvm-svn: 280070

8 years ago[ELF] - Fix for: bug 29115 - linkerscript does not support non-wildcard filename...
George Rimar [Tue, 30 Aug 2016 09:46:59 +0000 (09:46 +0000)]
[ELF] - Fix for: bug 29115 - linkerscript does not support non-wildcard filename spec.

FreeBSD/mips script has non-wildcard filename specifications:
.text :
{
 start.o(.text*)

Patch adds support for that, this is PR29115.

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

llvm-svn: 280069

8 years ago[ELF] - Use early return. NFC.
George Rimar [Tue, 30 Aug 2016 09:39:36 +0000 (09:39 +0000)]
[ELF] - Use early return. NFC.

This addresses forgotten review comment for r280067:
"[ELF] - Versionscript: support wildcards for extern "c++" tag."

llvm-svn: 280068

8 years ago[ELF] - Versionscript: support wildcards for extern "c++" tag.
George Rimar [Tue, 30 Aug 2016 09:35:03 +0000 (09:35 +0000)]
[ELF] - Versionscript: support wildcards for extern "c++" tag.

Previously for extern keyword only names in quotes (exact match) was supported.
Patch adds support for wildcards, so next scripts can be handled properly:

LIBSAMPLE_1.0 {
   global:
     extern "C++" {
       foo*;
   };
 };

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

llvm-svn: 280067

8 years ago[ELF] - Cleanup of scanVersionScript(): do not change local Demangled variable. NFC.
George Rimar [Tue, 30 Aug 2016 09:29:37 +0000 (09:29 +0000)]
[ELF] - Cleanup of scanVersionScript(): do not change local Demangled variable. NFC.

llvm-svn: 280066

8 years agoFix for commit 280064 that break the build.
Sjoerd Meijer [Tue, 30 Aug 2016 08:56:00 +0000 (08:56 +0000)]
Fix for commit 280064 that break the build.

llvm-svn: 280065