platform/upstream/llvm.git
8 years ago[AMDGPU] Expand vector mulhu/mulhs
Valery Pykhtin [Tue, 1 Nov 2016 10:26:48 +0000 (10:26 +0000)]
[AMDGPU] Expand vector mulhu/mulhs

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

llvm-svn: 285684

8 years ago[ELF] Remove unwanted typedef. NFC.
Eugene Leviant [Tue, 1 Nov 2016 10:16:52 +0000 (10:16 +0000)]
[ELF] Remove unwanted typedef. NFC.

llvm-svn: 285683

8 years agoConvert BuildIdSection to input section
Eugene Leviant [Tue, 1 Nov 2016 09:49:24 +0000 (09:49 +0000)]
Convert BuildIdSection to input section

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

llvm-svn: 285682

8 years ago[PowerPC] Implement vector shift builtins - llvm portion
Nemanja Ivanovic [Tue, 1 Nov 2016 09:42:32 +0000 (09:42 +0000)]
[PowerPC] Implement vector shift builtins - llvm portion

This patch corresponds to review https://reviews.llvm.org/D26095.
Committing on behalf of Tony Jiang.

llvm-svn: 285681

8 years agoAllow fetching source line, when multiple "AX" sections present
Eugene Leviant [Tue, 1 Nov 2016 09:17:50 +0000 (09:17 +0000)]
Allow fetching source line, when multiple "AX" sections present

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

llvm-svn: 285680

8 years ago[PPC] Add vec_absd functions to altivec.h
Nemanja Ivanovic [Tue, 1 Nov 2016 08:39:56 +0000 (08:39 +0000)]
[PPC] Add vec_absd functions to altivec.h

This patch corresponds to review https://reviews.llvm.org/D26073.
Committing on behalf of Sean Fertile.

llvm-svn: 285679

8 years agoAdd more conditions to check whether task waiting is necessary in kmp_omp_taskwait.
Andrey Churbanov [Tue, 1 Nov 2016 08:33:36 +0000 (08:33 +0000)]
Add more conditions to check whether task waiting is necessary in kmp_omp_taskwait.

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

Patch by Victor Campos

llvm-svn: 285678

8 years agoProtect tests that expect an exception for an unknown std::random_device
Roger Ferrer Ibanez [Tue, 1 Nov 2016 08:11:12 +0000 (08:11 +0000)]
Protect tests that expect an exception for an unknown std::random_device

Skip these tests under libcpp-no-exceptions.

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

llvm-svn: 285677

8 years agoAttempt to pacify buildbot
Serge Pavlov [Tue, 1 Nov 2016 07:52:10 +0000 (07:52 +0000)]
Attempt to pacify buildbot

llvm-svn: 285676

8 years agoAllow resolving response file names relative to including file
Serge Pavlov [Tue, 1 Nov 2016 06:53:29 +0000 (06:53 +0000)]
Allow resolving response file names relative to including file

If a response file included by construct @file itself includes a response file
and that file is specified by relative file name, current behavior is to resolve
the name relative to the current working directory. The change adds additional
flag to ExpandResponseFiles that may be used to resolve nested response file
names relative to including file. With the new mode a set of related response
files may be kept together and reference each other with short position
independent names.

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

llvm-svn: 285675

8 years agoclang-format: Fix bug in function reference qualifier detection.
Daniel Jasper [Tue, 1 Nov 2016 06:23:19 +0000 (06:23 +0000)]
clang-format: Fix bug in function reference qualifier detection.

Before:
  template <typename T>
      void F(T) &&
      = delete;

After:
  template <typename T>
  void F(T) && = delete;

llvm-svn: 285674

8 years agoclang-format: Fix incorrect pointer detection.
Daniel Jasper [Tue, 1 Nov 2016 06:23:14 +0000 (06:23 +0000)]
clang-format: Fix incorrect pointer detection.

Before:
  void f() { f(float{1}, a *a); }

After:
  void f() { f(float{1}, a * a); }

llvm-svn: 285673

8 years agoclang-format: [JS] Fix incorrect space when "as" is used as identifier.
Daniel Jasper [Tue, 1 Nov 2016 06:23:10 +0000 (06:23 +0000)]
clang-format: [JS] Fix incorrect space when "as" is used as identifier.

Before:
  aaaaa.as ();

After:
  aaaaa.as();

llvm-svn: 285672

8 years agoclang-format: Fix incorrect binary operator detection.
Daniel Jasper [Tue, 1 Nov 2016 06:23:05 +0000 (06:23 +0000)]
clang-format: Fix incorrect binary operator detection.

Before:
  int x = f(* + [] {});

After:
  int x = f(*+[] {});

llvm-svn: 285671

8 years agoclang-format: [JS] Fix formatting of generator functions.
Daniel Jasper [Tue, 1 Nov 2016 06:22:59 +0000 (06:22 +0000)]
clang-format: [JS] Fix formatting of generator functions.

Before:
  var x = {
    a: function*
() {
  //
}
  }

After:
  var x = {
    a: function*() {
      //
    }
  }

llvm-svn: 285670

8 years agoclang-format: [JS] Fix space when for is used as regular identifier.
Daniel Jasper [Tue, 1 Nov 2016 06:22:54 +0000 (06:22 +0000)]
clang-format: [JS] Fix space when for is used as regular identifier.

Before:
  x.for () = 1;

After:
  x.for() = 1;

llvm-svn: 285669

8 years ago[docs] remove more non-ascii stuff in the hopes to fix the bot
Kostya Serebryany [Tue, 1 Nov 2016 05:51:12 +0000 (05:51 +0000)]
[docs] remove more non-ascii stuff in the hopes to fix the bot

llvm-svn: 285668

8 years ago[AVX-512] Remove masked vector insert builtins and replace with native shufflevectors...
Craig Topper [Tue, 1 Nov 2016 05:47:56 +0000 (05:47 +0000)]
[AVX-512] Remove masked vector insert builtins and replace with native shufflevectors and selects.

Unfortunately, the backend currently doesn't fold masks into the instructions correctly when they come from these shufflevectors. I'll work on that in a future commit.

llvm-svn: 285667

8 years ago[index] Avoid using a RecursiveASTVisitor for SyntacticFormIndexer and iterate the...
Argyrios Kyrtzidis [Tue, 1 Nov 2016 04:29:39 +0000 (04:29 +0000)]
[index] Avoid using a RecursiveASTVisitor for SyntacticFormIndexer and iterate the DesignatedInitExprs of the InitListExpr directly.

This is more efficient, as per feedback by Richard.

llvm-svn: 285666

8 years ago[TBAA] Use wrapper objects instead of raw getOperand s; NFC
Sanjoy Das [Tue, 1 Nov 2016 02:58:30 +0000 (02:58 +0000)]
[TBAA] Use wrapper objects instead of raw getOperand s; NFC

This is intended to make the semantic intent clearer.

The wrapper objects are now generic to avoid `const_cast` s.  Since
`const` ness is part of the API of `MDNode::getMostGenericTBAA` (and
therefore I can't make things `const` all the way through without some
code churn outside TypeBasedAliasAnalysis.cpp), this seemed like the
cleanest solution.

llvm-svn: 285665

8 years agoImplement ABI proposal for throwing noexcept function pointers, per discussion
Richard Smith [Tue, 1 Nov 2016 01:34:46 +0000 (01:34 +0000)]
Implement ABI proposal for throwing noexcept function pointers, per discussion
on cxx-abi-dev (thread starting 2016-10-11). This is currently hidden behind a
cc1-only -m flag, pending discussion of how best to deal with language changes
that require use of new symbols from the ABI library.

llvm-svn: 285664

8 years agop0012: Teach resolving address of overloaded function with dependent exception
Richard Smith [Tue, 1 Nov 2016 01:31:23 +0000 (01:31 +0000)]
p0012: Teach resolving address of overloaded function with dependent exception
specification to resolve the exception specification as part of the type check,
in C++1z onwards. This is not actually part of P0012 / CWG1330 rules for when
an exception specification is "needed", but is necessary for sanity.

llvm-svn: 285663

8 years agoFix a bug where the EmulateInstructionARM64 handling of STP/LDP instructions
Jason Molenda [Tue, 1 Nov 2016 01:26:54 +0000 (01:26 +0000)]
Fix a bug where the EmulateInstructionARM64 handling of STP/LDP instructions
for floating point registers was not recording them correctly.  I needed to
change the EmulateInstructionARM64 unwind plans from using the DWARF
register numbering scheme to using the LLDB register numbering scheme
(because dwarf doesn't define register numbers for the 64-bit "d" registers).
Updated the EmulateInstructionARM64 unit tests to work with the LLDB
register numbering scheme and added a unit test to check the floating
point register spills & restores are correctly recorded.

https://reviews.llvm.org/D25864
<rdar://problem/28745483>

llvm-svn: 285662

8 years ago[TBAA] Rename accessors to be more idiomatic; NFC
Sanjoy Das [Tue, 1 Nov 2016 01:21:57 +0000 (01:21 +0000)]
[TBAA] Rename accessors to be more idiomatic; NFC

llvm-svn: 285661

8 years agoBitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.
Peter Collingbourne [Tue, 1 Nov 2016 01:18:57 +0000 (01:18 +0000)]
Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.

No block info block should need to define local abbreviations, so we can
always use a code width of 2.

Also change all block info block writers to use EnterBlockInfoBlock.

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

llvm-svn: 285660

8 years agoAMDGPU: Whitespace fixes
Matt Arsenault [Tue, 1 Nov 2016 00:55:14 +0000 (00:55 +0000)]
AMDGPU: Whitespace fixes

llvm-svn: 285659

8 years agoRemove executable bit on a source file
Stephane Sezer [Tue, 1 Nov 2016 00:21:57 +0000 (00:21 +0000)]
Remove executable bit on a source file

llvm-svn: 285658

8 years ago[ReachableCode] Skip over ExprWithCleanups in isConfigurationValue
Tim Shen [Tue, 1 Nov 2016 00:19:04 +0000 (00:19 +0000)]
[ReachableCode] Skip over ExprWithCleanups in isConfigurationValue

Summary: Fixes pr29152.

Reviewers: rsmith, pirama, krememek

Subscribers: cfe-commits

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

llvm-svn: 285657

8 years ago[DAG] disable nsw/nuw for add/sub/mul when simplifying based on demanded bits (PR30841)
Sanjay Patel [Mon, 31 Oct 2016 23:28:45 +0000 (23:28 +0000)]
[DAG] disable nsw/nuw for add/sub/mul when simplifying based on demanded bits (PR30841)

This bug was exposed by using nsw/nuw for more aggressive folds in:
https://reviews.llvm.org/rL284844

The changes mimic the IR demanded bits logic in InstCombiner::SimplifyDemandedUseBits(),
but we can't just flip flag bits in the DAG; we have to create a new node that has the
bits cleared.

This should fix:
https://llvm.org/bugs/show_bug.cgi?id=30841

llvm-svn: 285656

8 years ago[modules] Mark deleted functions as implicitly inline to allow merging
Eric Fiselier [Mon, 31 Oct 2016 23:07:15 +0000 (23:07 +0000)]
[modules] Mark deleted functions as implicitly inline to allow  merging

Summary: When merging definitions with ModulesLocalVisibility enabled it's important to make deleted definitions implicitly inline, otherwise they'll be diagnosed as a redefinition.

Reviewers: silvas, manmanren, rsmith

Subscribers: cfe-commits

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

llvm-svn: 285655

8 years ago[Hexagon] Garbage collect dead code.
Davide Italiano [Mon, 31 Oct 2016 22:56:56 +0000 (22:56 +0000)]
[Hexagon] Garbage collect dead code.

llvm-svn: 285654

8 years ago[clang-tidy] Update cert-err58-cpp to match its new generalised form.
Malcolm Parsons [Mon, 31 Oct 2016 22:47:04 +0000 (22:47 +0000)]
[clang-tidy] Update cert-err58-cpp to match its new generalised form.

Summary:
Aaron modified cert-err58-cpp to include all exceptions thrown before main()
Update the check to match.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 285653

8 years agoFix a typo.
Evgeniy Stepanov [Mon, 31 Oct 2016 22:42:39 +0000 (22:42 +0000)]
Fix a typo.

Found with PVS-Studio here: http://www.viva64.com/en/b/0446/

llvm-svn: 285652

8 years ago[CMake] Populate the build directory's framework
Chris Bieneman [Mon, 31 Oct 2016 22:31:07 +0000 (22:31 +0000)]
[CMake] Populate the build directory's framework

This ensures that the Resources and clang headers are properly symlinked in LLDB's framework. This should fix the modules-related tests when building on Darwin with CMake if you are building a framework.

I have another fix coming which gets them working on Darwin if you're building liblldb instead of a framework.

llvm-svn: 285651

8 years ago[cfi] Fix missing !type annotation.
Evgeniy Stepanov [Mon, 31 Oct 2016 22:28:10 +0000 (22:28 +0000)]
[cfi] Fix missing !type annotation.

CFI (only in the cross-dso mode) fails to set !type annotations when
a function is used before it is defined.

llvm-svn: 285650

8 years agoCodeGen: further loosen -O0 CG for WoA division
Saleem Abdulrasool [Mon, 31 Oct 2016 22:12:37 +0000 (22:12 +0000)]
CodeGen: further loosen -O0 CG for WoA division

Generate the slowest possible codepath for noopt CodeGen.  Even trying to be
clever with the negated jump can cause out-of-range jumps.  Use a wide branch
instead. Although the code is modelled simplistically, the later optimizations
would recombine the branching into `cbz` if possible.  This re-enables the
previous optimization as well as hopefully gives us working code in all cases.

Addresses PR30356!

llvm-svn: 285649

8 years ago[ThinLTO] Disable importing and other cross-module optis at -O0
Teresa Johnson [Mon, 31 Oct 2016 22:12:21 +0000 (22:12 +0000)]
[ThinLTO] Disable importing and other cross-module optis at -O0

Summary:
There is no point to importing at -O0, since we won't inline. We should
also disable other cross-module optimizations.

(Plan to backport this fix to the 3.9 branch to fix PR30774)

Reviewers: pcc

Subscribers: johanengelen, mehdi_amini

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

llvm-svn: 285648

8 years ago[index] Fix repeated visitation of the same InitListExpr for indexing.
Argyrios Kyrtzidis [Mon, 31 Oct 2016 22:12:12 +0000 (22:12 +0000)]
[index] Fix repeated visitation of the same InitListExpr for indexing.

It was visited multiple times unnecessarily.

rdar://28985038

llvm-svn: 285647

8 years ago[Test-Suite] Speculative fix for darwin bots
Chris Bieneman [Mon, 31 Oct 2016 22:06:52 +0000 (22:06 +0000)]
[Test-Suite] Speculative fix for darwin bots

When building with Xcode it looks like some of the logic in my test changes went haywire. This should fix it.

llvm-svn: 285646

8 years ago[Release notes] Highlight reset() as language/library artifact.
Eugene Zelenko [Mon, 31 Oct 2016 22:05:45 +0000 (22:05 +0000)]
[Release notes] Highlight reset() as language/library artifact.

llvm-svn: 285645

8 years ago[ASTMatcher] Add CXXNewExpr support to hasDeclaration
Malcolm Parsons [Mon, 31 Oct 2016 22:04:07 +0000 (22:04 +0000)]
[ASTMatcher] Add CXXNewExpr support to hasDeclaration

Reviewers: sbenza, lukasza, aaron.ballman, klimek

Subscribers: lukasza, sbenza, cfe-commits

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

llvm-svn: 285644

8 years agoA compound literal within a global lambda or block is still within
John McCall [Mon, 31 Oct 2016 21:56:26 +0000 (21:56 +0000)]
A compound literal within a global lambda or block is still within
the body of a function for the purposes of computing its storage
duration and deciding whether its initializer must be constant.

There are a number of problems in our current treatment of compound
literals.  C specifies that a compound literal yields an l-value
referring to an object with either static or automatic storage
duration, depending on where it was written; in the latter case,
the literal object has a lifetime tied to the enclosing scope (much
like an ObjC block), not the enclosing full-expression.  To get these
semantics fully correct in our current design, we would need to
collect compound literals on the ExprWithCleanups, just like we do
with ObjC blocks; we would probably also want to identify literals
like we do with materialized temporaries.  But it gets stranger;
GCC adds compound literals to C++ as an extension, but makes them
r-values, which are generally assumed to have temporary storage
duration.  Ignoring destructor ordering, the difference only matters
if the object's address escapes the full-expression, which for an
r-value can only happen with reference binding (which extends
temporaries) or array-to-pointer decay (which does not).  GCC then
attempts to lock down on array-to-pointer decay in ad hoc ways.
Arguably a far superior language solution for C++ (and perhaps even
array r-values in C, which can occur in other ways) would be to
propagate lifetime extension through array-to-pointer decay, so
that initializing a pointer object to a decayed r-value array
extends the lifetime of the complete object containing the array.
But this would be a major change in semantics which arguably ought
to be blessed by the committee(s).

Anyway, I'm not fixing any of that in this patch; I did try, but
it got out of hand.

Fixes rdar://28949016.

llvm-svn: 285643

8 years ago[NVPTX] Remove NVPTXFavorNonGenericAddrSpaces pass.
Justin Lebar [Mon, 31 Oct 2016 21:51:42 +0000 (21:51 +0000)]
[NVPTX] Remove NVPTXFavorNonGenericAddrSpaces pass.

Summary:
This has been replaced by the NVPTXInferAddressSpaces pass.  We've had
the new one as the default with the old one accessible via a flag for
some months now, and we've had no problems.

Reviewers: tra

Subscribers: llvm-commits, jholewinski, jingyue, mgorny

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

llvm-svn: 285642

8 years agoThe expr '.' is not absolute.
Rafael Espindola [Mon, 31 Oct 2016 21:36:23 +0000 (21:36 +0000)]
The expr '.' is not absolute.

With this patch we keep track of the fact that . is a position in the
file and therefore not absolute. This allow us to compute relative
relocations that involve symbol that are defined in linker scripts
with '.'.

This fixes https://llvm.org/bugs/show_bug.cgi?id=30406

There is still more work to track absoluteness over the various
expressions, but this should unblock linking the EFI bootloader.

llvm-svn: 285641

8 years ago[analyzer] Allow undefined values in performTrivialCopy.
Artem Dergachev [Mon, 31 Oct 2016 21:11:20 +0000 (21:11 +0000)]
[analyzer] Allow undefined values in performTrivialCopy.

Reading from a garbage pointer should be modeled as garbage,
and performTrivialCopy should be able to deal with any SVal input.

Patch by Ilya Palachev!

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

llvm-svn: 285640

8 years agodocs: trying to fix the docs bot by removing non-ASCII characters. The docs build...
Kostya Serebryany [Mon, 31 Oct 2016 21:10:26 +0000 (21:10 +0000)]
docs: trying to fix the docs bot by removing non-ASCII characters. The docs build fine on my machine, bot fail on the bot (lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/25/steps/docs-llvm-html/logs/stdio)

llvm-svn: 285639

8 years agoRe-commit r285607: Emit Section Map stream."
Rui Ueyama [Mon, 31 Oct 2016 21:09:21 +0000 (21:09 +0000)]
Re-commit r285607: Emit Section Map stream."

Removed some test fields that overspecified test conditions.

llvm-svn: 285638

8 years ago[analyzer] MacOSXAPIChecker: Improve warnings for __block vars in dispatch_once.
Artem Dergachev [Mon, 31 Oct 2016 21:04:54 +0000 (21:04 +0000)]
[analyzer] MacOSXAPIChecker: Improve warnings for __block vars in dispatch_once.

The checker already warns for __block-storage variables being used as a
dispatch_once() predicate, however it refers to them as local which is not quite
accurate, so we fix that.

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

llvm-svn: 285637

8 years agofix _dyld_find_unwind_sections() for pre-10.7. Patch by Jeremy Sequoia
Nick Kledzik [Mon, 31 Oct 2016 21:04:17 +0000 (21:04 +0000)]
fix _dyld_find_unwind_sections() for pre-10.7.  Patch by Jeremy Sequoia

llvm-svn: 285636

8 years ago[tsan] Enable the tsan/libcxx/ testcase(s) on Darwin
Kuba Brecka [Mon, 31 Oct 2016 20:50:15 +0000 (20:50 +0000)]
[tsan] Enable the tsan/libcxx/ testcase(s) on Darwin

Apparently, the std_shared_ptr.cc testcase works fine on Darwin, even without the instrumented libcxx. Let's enable it.

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

llvm-svn: 285634

8 years agoRemove llc -jump-table-type option, it hasn't been functional for years.
Joerg Sonnenberger [Mon, 31 Oct 2016 20:35:20 +0000 (20:35 +0000)]
Remove llc -jump-table-type option, it hasn't been functional for years.

llvm-svn: 285633

8 years agoMore additional error checks for invalid Mach-O files when
Kevin Enderby [Mon, 31 Oct 2016 20:29:48 +0000 (20:29 +0000)]
More additional error checks for invalid Mach-O files when
the offsets and sizes of an element of the file overlaps with
another element in the Mach-O file.

This shows the approach to this testing for three elements
and contains for tests for their overlap.  Checking for all the
remain elements will be added next.

llvm-svn: 285632

8 years agoAdd comment explaining this mysterious macro name.
Richard Smith [Mon, 31 Oct 2016 20:25:52 +0000 (20:25 +0000)]
Add comment explaining this mysterious macro name.

llvm-svn: 285631

8 years ago[tsan] Implement WriteMemoryProfile for Darwin
Kuba Brecka [Mon, 31 Oct 2016 20:17:13 +0000 (20:17 +0000)]
[tsan] Implement WriteMemoryProfile for Darwin

TSan’s memory usage profiling currently doesn’t work on Darwin. This patch implements measuring the amount of resident and dirty memory for each memory region. I also removed the GetShadowMemoryConsumption function, which seems to be unused.

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

llvm-svn: 285630

8 years agoRevert "Add a space to work around a Windows CPython / MSys quoting bug"
Reid Kleckner [Mon, 31 Oct 2016 20:13:41 +0000 (20:13 +0000)]
Revert "Add a space to work around a Windows CPython / MSys quoting bug"

This reverts commit r284768.

After LLVM r285237, the lit shell interpreter works around this bug for
us.

llvm-svn: 285629

8 years agoDelay computation of IsAbsolute.
Rafael Espindola [Mon, 31 Oct 2016 19:56:37 +0000 (19:56 +0000)]
Delay computation of IsAbsolute.

We parse linker scripts very early, but whether an expression is
absolute or not can depend on a symbol defined in a .o. Given that, we
have to delay the computation of IsAbsolute. We can do that by storing
an AST when parsing or by also making IsAbsolute a function like we do
for the expression value. This patch implements the second option.

llvm-svn: 285628

8 years ago[PPC] add absolute difference altivec instructions and matching intrinsics
Nemanja Ivanovic [Mon, 31 Oct 2016 19:47:52 +0000 (19:47 +0000)]
[PPC] add absolute difference altivec instructions and matching intrinsics

This patch corresponds to review https://reviews.llvm.org/D26072.
Committing on behalf of Sean Fertile.

llvm-svn: 285627

8 years agoDebugInfo: support for DW_TAG_atomic_type
Victor Leschuk [Mon, 31 Oct 2016 19:09:47 +0000 (19:09 +0000)]
DebugInfo: support for DW_TAG_atomic_type

Mark C11 _Atomic variables with DW_TAG_atomic_type tag.

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

llvm-svn: 285625

8 years agoDebugInfo: make DW_TAG_atomic_type valid
Victor Leschuk [Mon, 31 Oct 2016 19:09:38 +0000 (19:09 +0000)]
DebugInfo: make DW_TAG_atomic_type valid

DW_TAG_atomic_type was already included in Dwarf.defs and emitted correctly,
however Verifier didn't recognize it as valid.
Thus we introduce the following changes:

  * Make DW_TAG_atomic_type valid tag for IR and DWARF (enabled only with -gdwarf-5)
  * Add it to related docs
  * Add DebugInfo tests

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

llvm-svn: 285624

8 years agoNFC - Reorder test case names in a PPC test case
Nemanja Ivanovic [Mon, 31 Oct 2016 19:02:54 +0000 (19:02 +0000)]
NFC - Reorder test case names in a PPC test case

A few recent commits have messed up the order of some tests
in a PPC test case. This just reorders them in a sensible way.

llvm-svn: 285623

8 years agoFix per-processor model scheduler definition completeness check
Ulrich Weigand [Mon, 31 Oct 2016 18:59:52 +0000 (18:59 +0000)]
Fix per-processor model scheduler definition completeness check

The CodeGenSchedModels::checkCompleteness routine in TableGen/
CodeGenSchedule.cpp is supposed to verify for each processor
model that is marked as "complete" that it actually defines a
scheduling class for each instruction.

However, this did not work correctly due to an incorrect
check whether a scheduling class has an itinerary.

Reviewer: atrick
Differential revision: https://reviews.llvm.org/D26156

llvm-svn: 285622

8 years agoSimple numeric constants are absolute.
Rafael Espindola [Mon, 31 Oct 2016 18:56:02 +0000 (18:56 +0000)]
Simple numeric constants are absolute.

llvm-svn: 285621

8 years ago[asan] Move instrumented null-terminated strings to a special section, compiler-rt...
Kuba Brecka [Mon, 31 Oct 2016 18:52:32 +0000 (18:52 +0000)]
[asan] Move instrumented null-terminated strings to a special section, compiler-rt part

On Darwin, simple C null-terminated constant strings normally end up in the __TEXT,__cstring section of the resulting Mach-O binary. When instrumented with ASan, these strings are transformed in a way that they cannot be in __cstring (the linker unifies the content of this section and strips extra NUL bytes, which would break instrumentation), and are put into a generic __const section. This breaks some of the tools that we have: Some tools need to scan all C null-terminated strings in Mach-O binaries, and scanning all the contents of __const has a large performance penalty. This patch instead introduces a special section, __asan_cstring which will now hold the instrumented null-terminated strings.

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

llvm-svn: 285620

8 years ago[asan] Move instrumented null-terminated strings to a special section, LLVM part
Kuba Brecka [Mon, 31 Oct 2016 18:51:58 +0000 (18:51 +0000)]
[asan] Move instrumented null-terminated strings to a special section, LLVM part

On Darwin, simple C null-terminated constant strings normally end up in the __TEXT,__cstring section of the resulting Mach-O binary. When instrumented with ASan, these strings are transformed in a way that they cannot be in __cstring (the linker unifies the content of this section and strips extra NUL bytes, which would break instrumentation), and are put into a generic __const section. This breaks some of the tools that we have: Some tools need to scan all C null-terminated strings in Mach-O binaries, and scanning all the contents of __const has a large performance penalty. This patch instead introduces a special section, __asan_cstring which will now hold the instrumented null-terminated strings.

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

llvm-svn: 285619

8 years agoRevert r285607: Emit Section Map stream.
Rui Ueyama [Mon, 31 Oct 2016 18:50:13 +0000 (18:50 +0000)]
Revert r285607: Emit Section Map stream.

That change broke buildbots.

llvm-svn: 285618

8 years agoFixing problem with CodeGen/avx512-kconstraints-att_inline_asm.c
Michael Zuckerman [Mon, 31 Oct 2016 18:40:17 +0000 (18:40 +0000)]
Fixing problem with CodeGen/avx512-kconstraints-att_inline_asm.c

llvm-svn: 285617

8 years ago[MC] Make llvm-mc fail cleanly on invalid output asm variant.
Nirav Dave [Mon, 31 Oct 2016 18:36:31 +0000 (18:36 +0000)]
[MC] Make llvm-mc fail cleanly on invalid output asm variant.

Fixes PR28488.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

llvm-svn: 285616

8 years agoGlobalISel: allow truncating pointer casts on AArch64.
Tim Northover [Mon, 31 Oct 2016 18:31:09 +0000 (18:31 +0000)]
GlobalISel: allow truncating pointer casts on AArch64.

llvm-svn: 285615

8 years agoGlobalISel: translate stack protector intrinsics
Tim Northover [Mon, 31 Oct 2016 18:30:59 +0000 (18:30 +0000)]
GlobalISel: translate stack protector intrinsics

llvm-svn: 285614

8 years ago[tsan] Add support for GCD target queues
Kuba Brecka [Mon, 31 Oct 2016 18:28:02 +0000 (18:28 +0000)]
[tsan] Add support for GCD target queues

GCD (libdispatch) has a concept of “target queues”: Each queue has either an implicit or explicit target queue, where the task is handed over to when it’s time to execute it. For example, a concurrent queue can have a serial target queue (effectively making the first queue serial), or multiple queues can have the same serial target queue (which means tasks in all the queues are mutually excluded). Thus we need to acquire-release semantics on the full “chain” of target queues.

This patch changes the way we Acquire() and Release() when executing tasks in queues. Now we’ll walk the chain of target queues and synchronize on each queue that is serial (or when dealing with a barrier block). This should avoid false positives when using dispatch_set_target_queue().

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

llvm-svn: 285613

8 years agoAdd a warning flag for warn_alloca_align_alignof
David Majnemer [Mon, 31 Oct 2016 18:23:02 +0000 (18:23 +0000)]
Add a warning flag for warn_alloca_align_alignof

llvm-svn: 285612

8 years agoMark a few more expressions as absolute.
Rafael Espindola [Mon, 31 Oct 2016 18:20:34 +0000 (18:20 +0000)]
Mark a few more expressions as absolute.

llvm-svn: 285611

8 years agoWhen diagnosing that a defaulted function is ill-formed because it would be
Richard Smith [Mon, 31 Oct 2016 18:18:29 +0000 (18:18 +0000)]
When diagnosing that a defaulted function is ill-formed because it would be
implicitly deleted and overrides a non-deleted function, explain why the
function is deleted. For PR30844.

llvm-svn: 285610

8 years ago[Sema] Warn when alignof is used with __builtin_alloca_with_align
David Majnemer [Mon, 31 Oct 2016 18:07:57 +0000 (18:07 +0000)]
[Sema] Warn when alignof is used with __builtin_alloca_with_align

The second argument to __builtin_alloca_with_align is supposed to be in
bits, not bytes.  Using alignof there would be indicative of a bug.

llvm-svn: 285609

8 years agoMove IsAbsolute from SymbolAssignment to Expr.
Rafael Espindola [Mon, 31 Oct 2016 17:43:38 +0000 (17:43 +0000)]
Move IsAbsolute from SymbolAssignment to Expr.

And as a token of the new feature, make ALIGNOF always absolute.

This is a step in making it possible to have non absolute symbols out
of output sections.

llvm-svn: 285608

8 years agoEmit Section Map stream.
Rui Ueyama [Mon, 31 Oct 2016 17:40:40 +0000 (17:40 +0000)]
Emit Section Map stream.

This is how we use DbiStreamBuilder::addSectionMap.

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

llvm-svn: 285607

8 years agoDefine DbiStreamBuilder::addSectionMap.
Rui Ueyama [Mon, 31 Oct 2016 17:38:56 +0000 (17:38 +0000)]
Define DbiStreamBuilder::addSectionMap.

This change enables LLD to construct a Section Map stream in a PDB file.
I do not understand all these fields in the Section Map yet, but it seems
like a copy of a COFF section header in another format.

With this patch, DbiStreamBuilder can emit a Section Map which
llvm-pdbdump can dump.

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

llvm-svn: 285606

8 years ago[analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.
Artem Dergachev [Mon, 31 Oct 2016 17:27:26 +0000 (17:27 +0000)]
[analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.

Unlike global/static variables, calloc etc. functions that allocate ObjC
objects behave differently in terms of memory barriers, and hacks that make
dispatch_once as fast as it possibly could be start failing.

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

llvm-svn: 285605

8 years ago[x86][inline-asm][AVX512][clang][PART-1] Introducing "k" and "Yk" constraints for...
Michael Zuckerman [Mon, 31 Oct 2016 17:23:52 +0000 (17:23 +0000)]
[x86][inline-asm][AVX512][clang][PART-1] Introducing "k" and "Yk" constraints for extended inline assembly, enabling use of AVX512 masked vectorized instructions.

Commit on behalf of mharoush

Extending inline assembly support, compatible with GCC as folowing:
 "k" constraint hints the compiler to select any of AVX512 k0-k7 registers.
 "Yk" constraint is a subset of "k" excluding k0 which is not allowd to be used as a mask.

Reviewer: 1. rnk

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

llvm-svn: 285604

8 years agoSingleLinkedListIterator::operator++(int) shouldn't return a reference
David Majnemer [Mon, 31 Oct 2016 17:20:43 +0000 (17:20 +0000)]
SingleLinkedListIterator::operator++(int) shouldn't return a reference

The returned reference is to a local object.  Instead, make a copy.

Found by PVS-Studio.

llvm-svn: 285603

8 years agoRemove usages of TimeValue from gdb-remote process plugin
Pavel Labath [Mon, 31 Oct 2016 17:19:42 +0000 (17:19 +0000)]
Remove usages of TimeValue from gdb-remote process plugin

Summary:
Most of the changes are very straight-forward, the only tricky part was the
"packet speed-test" function, which is very time-heavy. As the function was
completely untested, I added a quick unit smoke test for it.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 285602

8 years agoAdd modernize-use-auto tests for casts inside macros
Malcolm Parsons [Mon, 31 Oct 2016 17:17:45 +0000 (17:17 +0000)]
Add modernize-use-auto tests for casts inside macros

llvm-svn: 285601

8 years ago[ASan] Initialize cloned dynamic runtime global variables earlier
Reid Kleckner [Mon, 31 Oct 2016 17:13:02 +0000 (17:13 +0000)]
[ASan] Initialize cloned dynamic runtime global variables earlier

Otherwise __asan_dynamic_memory_address will be zero during static
initialization and instrumented code will crash immediately.

Fixes PR30810

Patch by David Major

llvm-svn: 285600

8 years agoRemove a couple of old TODOs and don't make a new ConstString each time; none of...
Enrico Granata [Mon, 31 Oct 2016 17:12:16 +0000 (17:12 +0000)]
Remove a couple of old TODOs and don't make a new ConstString each time; none of this is super-critical since it applies to older versions of macOS (or OSX, I guess?) but still..

llvm-svn: 285599

8 years agoFix an unconditional break in checkMachOAndArchFlags
David Majnemer [Mon, 31 Oct 2016 17:11:31 +0000 (17:11 +0000)]
Fix an unconditional break in checkMachOAndArchFlags

Found by PVS-Studio.

llvm-svn: 285598

8 years agoSymbolRef::Type is not a bitfield and must be compared directly
David Majnemer [Mon, 31 Oct 2016 17:11:23 +0000 (17:11 +0000)]
SymbolRef::Type is not a bitfield and must be compared directly

Found by PVS-Studio.

llvm-svn: 285597

8 years agoAdd the new minidump plugin files to the Xcode project
Enrico Granata [Mon, 31 Oct 2016 17:00:54 +0000 (17:00 +0000)]
Add the new minidump plugin files to the Xcode project

llvm-svn: 285596

8 years agoUse toCharUnitsFromBits instead of TargetInfo::getCharWidth
David Majnemer [Mon, 31 Oct 2016 16:48:30 +0000 (16:48 +0000)]
Use toCharUnitsFromBits instead of TargetInfo::getCharWidth

llvm-svn: 285595

8 years agoModify DWARFFormValue to remember the DWARFUnit that it was decoded with.
Greg Clayton [Mon, 31 Oct 2016 16:46:02 +0000 (16:46 +0000)]
Modify DWARFFormValue to remember the DWARFUnit that it was decoded with.

Modifying DWARFFormValue to remember the DWARFUnit that it was encoded with can simplify the usage of instances of this class. Previously users would have to try and pass in the same DWARFUnit that was used to decode the form value and there was a possibility that a different DWARFUnit might be supplied to the functions that extract values (strings, CU relative references, addresses) and cause problems. This fixes this potential issue by storing the DWARFUnit inside the DWARFFormValue so that this mistake can't be made. Instances of DWARFFormValue are not stored permanently and are used as temporary values, so the increase in size of an instance of DWARFFormValue isn't a big deal. This makes decoding form values more bullet proof and is a change that will be used by future modifications.

https://reviews.llvm.org/D26052

llvm-svn: 285594

8 years agoImprove ".." handling in FileSpec normalization
Pavel Labath [Mon, 31 Oct 2016 16:22:07 +0000 (16:22 +0000)]
Improve ".." handling in FileSpec normalization

Summary:
.. handling for windows path was completely broken because the function was
expecting \ as path separators, but we were passing it normalized file paths,
where these have been replaced by forward slashes. Apart from this, the function
was incorrect for posix paths as well in some corner cases, as well as being
generally hard to follow.

The corner cases were:
- /../bar -> should be same as /bar
- /bar/.. -> should be same as / (slightly dodgy as the former depends on /bar actually
  existing, but since we're doing it in an abstract way, I think the
  transformation is reasonable)

I rewrite the function to fix these corner cases and handle windows paths more
correctly. The function should now handle the posix paths (modulo symlinks, but
we cannot really do anything about that without a real filesystem). For windows
paths, there are a couple of corner cases left, mostly to do with drive letter
handling, which cannot be fixed until the rest of the class understands drive
letters better.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 285593

8 years ago[lli] Don't strip away const qualifier. Unbreak the gcc6 build.
Davide Italiano [Mon, 31 Oct 2016 16:21:48 +0000 (16:21 +0000)]
[lli] Don't strip away const qualifier. Unbreak the gcc6 build.

llvm-svn: 285592

8 years ago[x86][inline-asm][AVX512][llvm][PART-2]
Michael Zuckerman [Mon, 31 Oct 2016 16:19:58 +0000 (16:19 +0000)]
[x86][inline-asm][AVX512][llvm][PART-2]
Introducing "k" and "Yk" constraints for extended inline assembly, enabling use of AVX512 masked vectorized instructions.

Commit on behalf of mharoush

Extending inline assembly support, compatible with GCC as folowing:
"k" constraint hints the compiler to select any of AVX512 k0-k7 registers.
"Yk" constraint is a subset of "k" excluding k0 which is not allowd to be used as a mask.

Reviewer: 1. rnk

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

llvm-svn: 285591

8 years ago[AMDGPU][MC][gfx8] Support 20-bit immediate offset in SMEM instructions.
Artem Tamazov [Mon, 31 Oct 2016 16:07:39 +0000 (16:07 +0000)]
[AMDGPU][MC][gfx8] Support 20-bit immediate offset in SMEM instructions.

Fixes Bug 30808.
Note that passing subtarget information to predicates seems too complicated, so gfx8-specific def smrd_offset_20 introduced.
Old gfx6/7-specific def renamed to smrd_offset_8 for clarity.
Lit tests updated.

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

llvm-svn: 285590

8 years ago[clang-tidy] Enhance modernize-make-unique to handle unique_ptr.reset()
Malcolm Parsons [Mon, 31 Oct 2016 15:48:01 +0000 (15:48 +0000)]
[clang-tidy] Enhance modernize-make-unique to handle unique_ptr.reset()

Summary:
Avoid naked new in unique_ptr.reset() by using make_unique

Fixes http://llvm.org/PR27383

Reviewers: alexfh, aaron.ballman

Subscribers: Prazek, cfe-commits

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

llvm-svn: 285589

8 years ago[Hexagon] Don't expand mux instructions with both sources identical
Krzysztof Parzyszek [Mon, 31 Oct 2016 15:45:09 +0000 (15:45 +0000)]
[Hexagon] Don't expand mux instructions with both sources identical

llvm-svn: 285588

8 years agoMinidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in...
Dimitar Vlahovski [Mon, 31 Oct 2016 15:35:18 +0000 (15:35 +0000)]
Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull

Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arches that this supports are x86_32 and x86_64.
This is because I have only written register contexts for those.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth

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

llvm-svn: 285587

8 years agoRecommit r285285 - [Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size...
George Rimar [Mon, 31 Oct 2016 15:33:00 +0000 (15:33 +0000)]
Recommit r285285 - [Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.

with fix: edited invalid-section-index2.elf input to pass the new check and
fail on the same place it was intended to fail.

Original commit message:
Elf.h already has code checking that section table does not go past end of file.
Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize
because of calculation overflow.

Parch fixes the issue.

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

llvm-svn: 285586

8 years ago[x86][inline-asm] Add support for curly brackets escape using "%" in extended inline...
Michael Zuckerman [Mon, 31 Oct 2016 15:27:54 +0000 (15:27 +0000)]
[x86][inline-asm] Add support for curly brackets escape using "%" in extended inline asm.

Commit on behalf of mharoush

After LGTM and check all:

This patch is a compatibility fix for clang, matching GCC support for charter escape when using extended in-line assembly (i.e, "%{" ,"%}" --> "{" ,"}" ).
 It is meant to enable support for advanced features such as AVX512 conditional\masked vector instructions/broadcast assembly syntax.

Reviewer: 1. rnk

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

llvm-svn: 285585

8 years agoMinidump plugin: Adding x86_32 register context converter
Dimitar Vlahovski [Mon, 31 Oct 2016 15:26:44 +0000 (15:26 +0000)]
Minidump plugin: Adding x86_32 register context converter

Summary:
This, like the x86_64 case, reads the register values from the minidump
file, and emits a binary buffer that is ordered using the offsets from
the RegisterInfoInterface argument. That way we can reuse an existing
register context.
Added unit tests.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, amccarth, lldb-commits

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

llvm-svn: 285584

8 years agoAdd -frtti for Windows buildbot.
Malcolm Parsons [Mon, 31 Oct 2016 15:15:00 +0000 (15:15 +0000)]
Add -frtti for Windows buildbot.

llvm-svn: 285583