platform/upstream/llvm.git
8 years agoLoopLoadElimination should preserve GlobalsAA.
Eli Friedman [Fri, 16 Sep 2016 17:58:07 +0000 (17:58 +0000)]
LoopLoadElimination should preserve GlobalsAA.

Avoids losing GlobalsAA in the standard pass pipeline.

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

llvm-svn: 281757

8 years agoauto-generate checks
Sanjay Patel [Fri, 16 Sep 2016 17:54:52 +0000 (17:54 +0000)]
auto-generate checks

llvm-svn: 281756

8 years agoauto-generate checks
Sanjay Patel [Fri, 16 Sep 2016 17:48:16 +0000 (17:48 +0000)]
auto-generate checks

llvm-svn: 281755

8 years agoRecommit r281721 "[ELF] - Linkerscript: implement EXCLUDE_FILE in the middle of a...
George Rimar [Fri, 16 Sep 2016 17:42:10 +0000 (17:42 +0000)]
Recommit r281721 "[ELF] - Linkerscript: implement EXCLUDE_FILE in the middle of a input section description."

With fix for 2 bots. Details about the fix performed is on a review page.

Initial commit message:
This is PR30387:

From PR description:
We fail to parse

SECTIONS
{
  foo :
  {
    *(sec0 EXCLUDE_FILE (zed1.o) sec1  EXCLUDE_FILE (zed2.o) sec2 )
  }
}
The semantics according to bfd are:

Include sec1 from every file but zed1.o
Include sec2 from every file but zed2.o
Include sec0 from every file

Patch implements the support.

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

llvm-svn: 281754

8 years agoIntroduce inline assembly parsing test is PR30372.
Nirav Dave [Fri, 16 Sep 2016 17:42:02 +0000 (17:42 +0000)]
Introduce inline assembly parsing test is PR30372.

llvm-svn: 281753

8 years agoFix test after renaming -name-anon-functions pass to -name-anon-globals
Mehdi Amini [Fri, 16 Sep 2016 17:18:16 +0000 (17:18 +0000)]
Fix test after renaming -name-anon-functions pass to -name-anon-globals

llvm-svn: 281752

8 years ago[LTO] Use llvm-nm instead of nm in new tests
Teresa Johnson [Fri, 16 Sep 2016 17:12:48 +0000 (17:12 +0000)]
[LTO] Use llvm-nm instead of nm in new tests

The use of nm in the new tests added with r281725 caused a couple
of bot failures:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15701
http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/6939

Use llvm-nm instead.

llvm-svn: 281750

8 years agoActually remove the Mangler from the AsmPrinter and clean up the places it was "used...
Eric Christopher [Fri, 16 Sep 2016 17:07:23 +0000 (17:07 +0000)]
Actually remove the Mangler from the AsmPrinter and clean up the places it was "used" but not used.

llvm-svn: 281749

8 years agoFix a hidden use of grabbing the Mangler from the AsmPrinter and update
Eric Christopher [Fri, 16 Sep 2016 17:07:13 +0000 (17:07 +0000)]
Fix a hidden use of grabbing the Mangler from the AsmPrinter and update
accordingly.

llvm-svn: 281748

8 years agoRemove undefined weak hooks from dll thunk export list to really fix windows build
Reid Kleckner [Fri, 16 Sep 2016 17:05:40 +0000 (17:05 +0000)]
Remove undefined weak hooks from dll thunk export list to really fix windows build

llvm-svn: 281747

8 years ago[compiler-rt] Don't force ASAN_HAS_EXCEPTIONS to be true for all builds
Francis Ricci [Fri, 16 Sep 2016 16:59:31 +0000 (16:59 +0000)]
[compiler-rt] Don't force ASAN_HAS_EXCEPTIONS to be true for all builds

Summary:
This value is already defaulted to true in asan_internal.h.
Allow the value to be overriden in cases where exceptions are unavailable.

Reviewers: kcc, samsonov, compnerd

Subscribers: kubabrecka, dberris, beanz, mgorny, llvm-commits

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

llvm-svn: 281746

8 years agoRename NameAnonFunctions to NameAnonGlobals to match what it is doing (NFC)
Mehdi Amini [Fri, 16 Sep 2016 16:56:30 +0000 (16:56 +0000)]
Rename NameAnonFunctions to NameAnonGlobals to match what it is doing (NFC)

llvm-svn: 281745

8 years agoFix NameAnonFunctions pass: for ThinLTO we need to rename global variables as well
Mehdi Amini [Fri, 16 Sep 2016 16:56:25 +0000 (16:56 +0000)]
Fix NameAnonFunctions pass: for ThinLTO we need to rename global variables as well

A follow-up patch will rename this pass and the source file accordingly,
but I figured the non-NFC change will be easier to spot in isolation.

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

llvm-svn: 281744

8 years ago[InstCombine] add helper functions for visitICmpInst(); NFCI
Sanjay Patel [Fri, 16 Sep 2016 16:10:22 +0000 (16:10 +0000)]
[InstCombine] add helper functions for visitICmpInst(); NFCI

llvm-svn: 281743

8 years ago[IRObjectFile] Turn llvm_unreachable("foo") into something more explicative.
Davide Italiano [Fri, 16 Sep 2016 16:07:19 +0000 (16:07 +0000)]
[IRObjectFile] Turn llvm_unreachable("foo") into something more explicative.

llvm-svn: 281742

8 years ago[LTO] Prevent asm references to be dropped from the output.
Davide Italiano [Fri, 16 Sep 2016 16:05:25 +0000 (16:05 +0000)]
[LTO] Prevent asm references to be dropped from the output.

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

llvm-svn: 281741

8 years agoImprove handling ASSERT outside SECTIONS block
Eugene Leviant [Fri, 16 Sep 2016 15:30:47 +0000 (15:30 +0000)]
Improve handling ASSERT outside SECTIONS block

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

llvm-svn: 281740

8 years ago[AArch64][GlobalISel] Add default regbank mapping for int<>FP.
Ahmed Bougacha [Fri, 16 Sep 2016 15:12:46 +0000 (15:12 +0000)]
[AArch64][GlobalISel] Add default regbank mapping for int<>FP.

llvm-svn: 281739

8 years ago[AArch64][GlobalISel] Add default regbank mapping for G_FCMP.
Ahmed Bougacha [Fri, 16 Sep 2016 15:12:43 +0000 (15:12 +0000)]
[AArch64][GlobalISel] Add default regbank mapping for G_FCMP.

llvm-svn: 281738

8 years ago[AArch64][GlobalISel] Add default regbank mapping for FP ops.
Ahmed Bougacha [Fri, 16 Sep 2016 15:12:40 +0000 (15:12 +0000)]
[AArch64][GlobalISel] Add default regbank mapping for FP ops.

These should have all their operands - even scalars - go on FPR.

llvm-svn: 281737

8 years agoChange how we compute offsets with linker scripts.
Rafael Espindola [Fri, 16 Sep 2016 15:10:23 +0000 (15:10 +0000)]
Change how we compute offsets with linker scripts.

This fixes pr30367, but more importantly, it changes how we compute offsets.

Now offset computation in a walk over linker script commands, like the
rest of assignAddresses. IMHO this is simpler to understand and if we
ever have to create multiple outputsections or chunks to change how we
handle test/ELF/linkerscript/alternate-sections.s it should be easier
to do it.

llvm-svn: 281736

8 years ago[AArch64][GlobalISel] Test default regbank mapping for G_ICMP.
Ahmed Bougacha [Fri, 16 Sep 2016 14:44:54 +0000 (14:44 +0000)]
[AArch64][GlobalISel] Test default regbank mapping for G_ICMP.

Also relax a RegisterBankInfo verifier check that's incompatible with
1-bit mappings.

llvm-svn: 281735

8 years ago[AArch64][GlobalISel] Add default regbank mappings for mixed-type ops.
Ahmed Bougacha [Fri, 16 Sep 2016 14:44:51 +0000 (14:44 +0000)]
[AArch64][GlobalISel] Add default regbank mappings for mixed-type ops.

We used to only support instructions with same-type operands.
Instead, use the per-register type information to map each
operand more accurately.

llvm-svn: 281734

8 years ago[AArch64][GlobalISel] Add tests for default RegBank mappings. NFC.
Ahmed Bougacha [Fri, 16 Sep 2016 14:44:48 +0000 (14:44 +0000)]
[AArch64][GlobalISel] Add tests for default RegBank mappings. NFC.

llvm-svn: 281733

8 years agoReapplying r278731 after fixing the problem that caused it to be reverted.
David L Kreitzer [Fri, 16 Sep 2016 14:38:13 +0000 (14:38 +0000)]
Reapplying r278731 after fixing the problem that caused it to be reverted.

Enhance SCEV to compute the trip count for some loops with unknown stride.

Patch by Pankaj Chawla

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

llvm-svn: 281732

8 years ago[libcxx] Add missing c++98 xfail. NFC.
Asiri Rathnayake [Fri, 16 Sep 2016 14:32:19 +0000 (14:32 +0000)]
[libcxx] Add missing c++98 xfail. NFC.

This is the only test failing in c++98 mode at the moment.

llvm-svn: 281731

8 years agoCodeGen: use pointer rather than reference in range loop
Saleem Abdulrasool [Fri, 16 Sep 2016 14:24:26 +0000 (14:24 +0000)]
CodeGen: use pointer rather than reference in range loop

Address post-commit comments from Justin Bogner.  Explicitly indicate
that the dereferenced iterator provides a pointer rather than a
reference.  NFC.

llvm-svn: 281730

8 years ago[mips] Fix previous revert r281726.
Simon Dardis [Fri, 16 Sep 2016 14:16:23 +0000 (14:16 +0000)]
[mips] Fix previous revert r281726.

llvm-svn: 281729

8 years agoFix shared library build
Ismail Donmez [Fri, 16 Sep 2016 14:10:23 +0000 (14:10 +0000)]
Fix shared library build

llvm-svn: 281728

8 years agoPlace the lowered phi instruction(s) before the DEBUG_VALUE entry
Keith Walker [Fri, 16 Sep 2016 14:07:29 +0000 (14:07 +0000)]
Place the lowered phi instruction(s) before the DEBUG_VALUE entry

When a phi node is finally lowered to a machine instruction it is
important that the lowered "load" instruction is placed before the
associated DEBUG_VALUE entry describing the value loaded.

Renamed the existing SkipPHIsAndLabels to SkipPHIsLabelsAndDebug to
more fully describe that it also skips debug entries. Then used the
"new" function SkipPHIsAndLabels when the debug information should not
be skipped when placing the lowered "load" instructions so that it is
placed before the debug entries.

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

llvm-svn: 281727

8 years agoRevert "[mips] Fix aui/daui/dahi/dati for MIPSR6"
Simon Dardis [Fri, 16 Sep 2016 13:56:05 +0000 (13:56 +0000)]
Revert "[mips] Fix aui/daui/dahi/dati for MIPSR6"

This reverts r281724. Still need dsanders to accept this.

llvm-svn: 281726

8 years ago[LTO] Fix handling of mixed (regular and thin) mode LTO
Teresa Johnson [Fri, 16 Sep 2016 13:54:19 +0000 (13:54 +0000)]
[LTO] Fix handling of mixed (regular and thin) mode LTO

Summary:
In runThinLTO we start the task numbering for ThinLTO backend
tasks depending on whether there was also a regular LTO object
(CombinedModule). However, the CombinedModule is moved at
the end of runRegularLTO, so we need to save this information and
pass it into runThinLTO. Otherwise the AddOutput callback to the client
will use the same task number for both the regular LTO object
and the first ThinLTO object, which in gold-plugin caused only
one to be end up in the output filename array and therefore passed
back to gold for the final native link.

Reviewers: pcc, mehdi_amini

Subscribers: mehdi_amini, kromanova

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

llvm-svn: 281725

8 years ago[mips] Fix aui/daui/dahi/dati for MIPSR6
Simon Dardis [Fri, 16 Sep 2016 13:50:43 +0000 (13:50 +0000)]
[mips] Fix aui/daui/dahi/dati for MIPSR6

For compatiblity with binutils, define these instructions to take
two registers with a 16bit unsigned immediate. Both of the registers
have to be same for dahi and dati.

Reviewers: vkalintiris, dsanders, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D21473

llvm-svn: 281724

8 years agoReverted r281721 ("[ELF] - Linkerscript: implement EXCLUDE_FILE in the middle of...
George Rimar [Fri, 16 Sep 2016 13:30:18 +0000 (13:30 +0000)]
Reverted r281721 ("[ELF] - Linkerscript: implement EXCLUDE_FILE in the middle of a input section description.").

It broke build bot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/27508

llvm-svn: 281723

8 years agoReverting r281719, this is causing buildbot failures and timeouts again.
Sjoerd Meijer [Fri, 16 Sep 2016 13:16:52 +0000 (13:16 +0000)]
Reverting r281719, this is causing buildbot failures and timeouts again.

llvm-svn: 281722

8 years ago[ELF] - Linkerscript: implement EXCLUDE_FILE in the middle of a input section descrip...
George Rimar [Fri, 16 Sep 2016 13:07:02 +0000 (13:07 +0000)]
[ELF] - Linkerscript: implement EXCLUDE_FILE in the middle of a input section description.

This is PR30387:

From PR description:
We fail to parse

SECTIONS
{
  foo :
  {
    *(sec0 EXCLUDE_FILE (zed1.o) sec1  EXCLUDE_FILE (zed2.o) sec2 )
  }
}
The semantics according to bfd are:

Include sec1 from every file but zed1.o
Include sec2 from every file but zed2.o
Include sec0 from every file

Patch implements the support.

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

llvm-svn: 281721

8 years ago[AArch64][GlobalISel] Use the generic DefaultMapping as the default.
Ahmed Bougacha [Fri, 16 Sep 2016 12:33:34 +0000 (12:33 +0000)]
[AArch64][GlobalISel] Use the generic DefaultMapping as the default.

This lets generic logic handle the common case, instead of having to
implement applyMappingImpl for each instruction.

llvm-svn: 281720

8 years agoThis is an attempt to reapply r280808: [ARM] Lower UDIV+UREM to UDIV+MLS
Sjoerd Meijer [Fri, 16 Sep 2016 12:10:09 +0000 (12:10 +0000)]
This is an attempt to reapply r280808: [ARM] Lower UDIV+UREM to UDIV+MLS
(and the same for SREM)

This was causing buildbot failures earlier (time outs in the LNT suite).
However, we haven't been able to reproduce this and are suspecting this
was caused by another (reverted) patch.

llvm-svn: 281719

8 years agoTrying to fix Mangler memory leak in TargetLoweringObjectFile.
Eric Liu [Fri, 16 Sep 2016 11:50:57 +0000 (11:50 +0000)]
Trying to fix Mangler memory leak in TargetLoweringObjectFile.

Summary:
`TargetLoweringObjectFile` can be re-used and thus `TargetLoweringObjectFile::Initialize()`
can be called multiple times causing `Mang` pointer memory leak.

Reviewers: echristo

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 281718

8 years ago[RenderScript] Support tracking and dumping reduction kernels
Luke Drummond [Fri, 16 Sep 2016 11:28:12 +0000 (11:28 +0000)]
[RenderScript] Support tracking and dumping reduction kernels

Initial implementation of support for tracking
[RenderScript Reductions](https://developer.android.com/guide/topics/renderscript/compute.html#reduction-in-depth)

With this patch, `language renderscript module dump` properly lists reductions
that are part of loaded RenderScript modules as well the the consituent
functions and their roles, within the reduction.

This support required new tracking mechanisms for the `#pragma(reduce)`
mechanism, and extension of `RSModuleDescriptor::ParseRSInfo` to support
the metadata output by `bcc`. This work was also an opportunity to
refactor/improve parse code:

- `RSModuleDescriptor::ParseExportReduceCount` now has a complete
  implementation and the debugger can correctly track reductions on
  receipt of a module hook.
- `RSModuleDescriptor::Dump` now dumps Reductions as well as `ForEach`
  kernels. Also, fixed indentation of the output, and made indentation
  groupings in the source clearer.
- `RSModuleDescriptor::ParseRSInfo` now returns true if the `".rs.info"`
  packet has nonzero linecount, rather than rejecting RenderScripts that
  don't contain kernels (an unlikely situation, but possibly valid). This
  was changed because scripts that only contained reductions were not
  being tracked in `RenderScriptRuntime::LoadModule`.
- Refactor `RSModuleInfo::ParseRSInfo` and add reduction spec parser stub
 - Prepared ParseRSInfo to more easily be able to add new parser types
 - Use llvm::StringRef and llvm::StringMap helpers to make the parsing code cleaner
 - factor out forEachCount, globalVarCount, and pragmaCount parsing block to their own methods
 - Add ExportReduceCount Parser
 - Use `llvm::StringRef` in `RSKernelDescriptor` constructor
 - removed now superfluous `MAXLINE` macros as we've switched from `const
   char *` to `llvm::StringRef`

llvm-svn: 281717

8 years ago[LCG] Redesign the lazy post-order iteration mechanism for the
Chandler Carruth [Fri, 16 Sep 2016 10:20:17 +0000 (10:20 +0000)]
[LCG] Redesign the lazy post-order iteration mechanism for the
LazyCallGraph to support repeated, stable iterations, even in the face
of graph updates.

This is particularly important to allow the CGSCC pass manager to walk
the RefSCCs (and thus everything else) in a module more than once. Lots
of unittests and other tests were hard or impossible to write because
repeated CGSCC pass managers which didn't invalidate the LazyCallGraph
would conclude the module was empty after the first one. =[ Really,
really bad.

The interesting thing is that in many ways this simplifies the code. We
can now re-use the same code for handling reference edge insertion
updates of the RefSCC graph as we use for handling call edge insertion
updates of the SCC graph. Outside of adapting to the shared logic for
this (which isn't trivial, but is *much* simpler than the DFS it
replaces!), the new code involves putting newly created RefSCCs when
deleting a reference edge into the cached list in the correct way, and
to re-formulate the iterator to be stable and effective even in the face
of these kinds of updates.

I've updated the unittests for the LazyCallGraph to re-iterate the
postorder sequence and verify that this all works. We even check for
using alternating iterators to trigger the lazy formation of RefSCCs
after mutation has occured.

It's worth noting that there are a reasonable number of likely
simplifications we can make past this. It isn't clear that we need to
keep the "LeafRefSCCs" around any more. But I've not removed that mostly
because I want this to be a more isolated change.

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

llvm-svn: 281716

8 years ago[ARM] Promote small global constants to constant pools
James Molloy [Fri, 16 Sep 2016 10:17:04 +0000 (10:17 +0000)]
[ARM] Promote small global constants to constant pools

If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

This recommit contains fixes for a nasty bug related to fast-isel fallback - because
fast-isel doesn't know about this optimization, if it runs and emits references to
a string that we inline (because fast-isel fell back to SDAG) we will end up
with an inlined string and also an out-of-line string, and we won't emit the
out-of-line string, causing backend failures.

It also contains fixes for emitting .text relocations which made the sanitizer
bots unhappy.

llvm-svn: 281715

8 years agoImprove handling of floating point literals in OpenCL to only use double precision...
Neil Hickey [Fri, 16 Sep 2016 10:15:06 +0000 (10:15 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64

https://reviews.llvm.org/D24235

llvm-svn: 281714

8 years ago[clang-tidy] Bugfix for readability-redundant-control-flow check
Kirill Bobyrev [Fri, 16 Sep 2016 10:12:08 +0000 (10:12 +0000)]
[clang-tidy] Bugfix for readability-redundant-control-flow check

This check did not create FixItHints when the statement before the redundant
control flow was not followed by a semicolon.

Patch by Malcolm Parsons!

Reviewers: alexfh

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

llvm-svn: 281713

8 years agoTouch up [[clang::require_constant_initialization]] docs
Eric Fiselier [Fri, 16 Sep 2016 10:04:38 +0000 (10:04 +0000)]
Touch up [[clang::require_constant_initialization]] docs

* Fix an egregious comma usage.
* Remove the `static` keyword in the example since the variables should have
  external linkage.
* Use C++11 attributes in the example.

llvm-svn: 281712

8 years agoTesting commit rights. Removing trailing white space from test file.
Neil Hickey [Fri, 16 Sep 2016 09:38:11 +0000 (09:38 +0000)]
Testing commit rights. Removing trailing white space from test file.

llvm-svn: 281711

8 years ago[clang-rename] Merge rename-{at|all} & optimise.
Kirill Bobyrev [Fri, 16 Sep 2016 08:45:19 +0000 (08:45 +0000)]
[clang-rename] Merge rename-{at|all} & optimise.

Having both rename-at and rename-all both seems confusing and introduces
unneeded difficulties. After merging rename-at and rename-all maintaining main
function wrappers and custom help becomes redundant while CLI becomes less
confusing.

D24224 (which was the original patch causing buildbot failures) wasn't aware of
bugs caused by passing both -offset and -qualified-name. After D24224 was landed
it caused buildbot failures and therefor I just reverted it.

Two things that make this patch different from D24224 are:

* unittests/clang-rename was deleted, because it is unmaintained and doesn't do
much.
* Passing both `-offset` and `-qualified-name` isn't allowed anymore for the
sake of preventing bugs.

This patch is a trivial enhancement of accepted D24224 revision.

Tested with `ninja check-all`.

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

llvm-svn: 281710

8 years agoFix side effect in assertion
Eric Fiselier [Fri, 16 Sep 2016 08:16:07 +0000 (08:16 +0000)]
Fix side effect in assertion

llvm-svn: 281709

8 years agoMove the Mangler from the AsmPrinter down to TLOF and clean up the
Eric Christopher [Fri, 16 Sep 2016 07:33:15 +0000 (07:33 +0000)]
Move the Mangler from the AsmPrinter down to TLOF and clean up the
TLOF API accordingly.

llvm-svn: 281708

8 years agoRemove unused function getMang().
Eric Christopher [Fri, 16 Sep 2016 07:32:58 +0000 (07:32 +0000)]
Remove unused function getMang().

llvm-svn: 281707

8 years agoFix unused result from sign extending an Offset.
Stephen Hines [Fri, 16 Sep 2016 07:21:24 +0000 (07:21 +0000)]
Fix unused result from sign extending an Offset.

Summary:
Offset was doubled in size, but the assignment was missing. We just need
to reassign to the original variable in this case to fix it.

Reviewers: cfe-commits, echristo

Subscribers: meikeb

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

llvm-svn: 281706

8 years agoUpdate CFGPrinter -> CFGPrinterLegacyPass
Tobias Grosser [Fri, 16 Sep 2016 05:48:09 +0000 (05:48 +0000)]
Update CFGPrinter -> CFGPrinterLegacyPass

.. to match recent changes in LLVM that broke the Polly compilation.

llvm-svn: 281705

8 years agoUse functions in DebugInfoPDB to create dummy PDB file.
Rui Ueyama [Fri, 16 Sep 2016 04:32:33 +0000 (04:32 +0000)]
Use functions in DebugInfoPDB to create dummy PDB file.

I don't think we are creating valid PDB file here,
but it is okay because we have never created valid PDBs before.

llvm-svn: 281704

8 years ago[CUDA] [doc] Note that you can use std::min/max from device code with C++14.
Justin Lebar [Fri, 16 Sep 2016 04:14:02 +0000 (04:14 +0000)]
[CUDA] [doc] Note that you can use std::min/max from device code with C++14.

llvm-svn: 281702

8 years agoDemangle symbols in "undefined symbol" error message.
Rui Ueyama [Fri, 16 Sep 2016 03:52:45 +0000 (03:52 +0000)]
Demangle symbols in "undefined symbol" error message.

llvm-svn: 281698

8 years agoAttempt to fix Sphinx build
Eric Fiselier [Fri, 16 Sep 2016 03:47:53 +0000 (03:47 +0000)]
Attempt to fix Sphinx build

llvm-svn: 281697

8 years agoadd availability check to DarwinLog event tests
Todd Fiala [Fri, 16 Sep 2016 03:07:14 +0000 (03:07 +0000)]
add availability check to DarwinLog event tests

The pexpect-based tests properly checked for the stub reporting
DarwinLog support.  The event-based ones did not.  This is fixed
here.  Swift CI bots are not currently building debugserver on
macOS, so they don't have the DarwinLog support even when they
pass the macOS 10.12 check.

llvm-svn: 281696

8 years agoUpdate _LIBCPP_EXCEPTION_ABI doc with @mclow's feedback
Eric Fiselier [Fri, 16 Sep 2016 02:51:26 +0000 (02:51 +0000)]
Update _LIBCPP_EXCEPTION_ABI doc with @mclow's feedback

llvm-svn: 281695

8 years agoAdd a test for r280191
David Majnemer [Fri, 16 Sep 2016 02:43:36 +0000 (02:43 +0000)]
Add a test for r280191

llvm-svn: 281694

8 years agoAlter the iOS/tvOS ARM64 C++ ABI to ignore the upper half of the
John McCall [Fri, 16 Sep 2016 02:40:45 +0000 (02:40 +0000)]
Alter the iOS/tvOS ARM64 C++ ABI to ignore the upper half of the
virtual table offset in a member function pointer.

We are reserving this space for future ABI use relating to alternative
v-table configurations.  In the meantime, continue to zero-initialize
this space when actually emitting a member pointer literal.

This will successfully interoperate with existing compilers.
Future versions of the compiler may place additional data in
this location, and at that point, code emitted by compilers
prior to this patch will fail if exposed to such a member pointer.
This is therefore a somewhat hard ABI break.  However, because
it is limited to an uncommon case of an uncommon language feature,
and especially because interoperation with the standard library
does not depend on member pointers, we believe that with a
sufficiently advance compiler change the impact of this break
will be minimal in practice.

llvm-svn: 281693

8 years agoMove _LIBCPP_INLINE_VISIBILITY to first declaration in <propagate_const>
Eric Fiselier [Fri, 16 Sep 2016 02:16:23 +0000 (02:16 +0000)]
Move _LIBCPP_INLINE_VISIBILITY to first declaration in <propagate_const>

llvm-svn: 281692

8 years agoMove _LIBCPP_INLINE_VISIBILITY to first declaration in sstream.
Eric Fiselier [Fri, 16 Sep 2016 02:09:26 +0000 (02:09 +0000)]
Move _LIBCPP_INLINE_VISIBILITY to first declaration in sstream.

llvm-svn: 281691

8 years agoFirst tests for serializing breakpoints.
Jim Ingham [Fri, 16 Sep 2016 01:41:27 +0000 (01:41 +0000)]
First tests for serializing breakpoints.

Plus a few bug fixes I found along the way.

llvm-svn: 281690

8 years agoRevert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"
Vitaly Buka [Fri, 16 Sep 2016 01:38:46 +0000 (01:38 +0000)]
Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous state"

This approach is not good enough. Working on the new solution.

This reverts commit r280907.

llvm-svn: 281689

8 years agoRevert "[asan] Add flag to allow lifetime analysis of problematic allocas"
Vitaly Buka [Fri, 16 Sep 2016 01:38:43 +0000 (01:38 +0000)]
Revert "[asan] Add flag to allow lifetime analysis of problematic allocas"

This approach is not good enough. Working on the new solution.

This reverts commit r281126.

llvm-svn: 281688

8 years ago[asan] Remove the test as the fix is going to be removed
Vitaly Buka [Fri, 16 Sep 2016 01:37:17 +0000 (01:37 +0000)]
[asan] Remove the test as the fix is going to be removed

Summary:
I need to redu solution, existing is not good enough.

PR28267

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281687

8 years agoDo not warn about format strings that are indexed string literals.
Stephen Hines [Fri, 16 Sep 2016 01:07:04 +0000 (01:07 +0000)]
Do not warn about format strings that are indexed string literals.

Summary:
The warning for a format string not being a string literal and therefore
being potentially insecure is overly strict for indices into string
literals. This fix checks if the index into the string literal is
precomputable. If that's the case it will check if the suffix of that
string literal is a valid format string string literal. It will still
issue the aforementioned warning for out of range indices into the
string literal.

Patch by Meike Baumgärtner (meikeb)

Reviewers: rsmith

Subscribers: srhines, cfe-commits

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

llvm-svn: 281686

8 years agoFix autoupgrade logic for Objective-C class properties module flag
Mehdi Amini [Fri, 16 Sep 2016 00:38:18 +0000 (00:38 +0000)]
Fix autoupgrade logic for Objective-C class properties module flag

Previous we were issuing an error when linking a module containing
the new Objective-C metadata structure for class properties with an
"old" one.
Now instead we downgrade the module flag so that the Objective-C
runtime does not expect the new metadata structure.

This is consistent with what ld64 is doing on binary files.

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

llvm-svn: 281685

8 years agoUse _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY in valarray to support attribute((inter...
Eric Fiselier [Fri, 16 Sep 2016 00:13:55 +0000 (00:13 +0000)]
Use _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY in valarray to support attribute((internal_linkage)).

The externally instantiated member functions must be declared using
_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY, not _LIBCPP_INLINE_VISIBILITY, in
order to be properly exported when using __attribute__((internal_linkage)).

Otherwise the explicit instantiations will obviously have internal linkage and
will not be exported from the dylib.

llvm-svn: 281684

8 years agoMove inline attributes in filesystem to first declaration
Eric Fiselier [Fri, 16 Sep 2016 00:07:16 +0000 (00:07 +0000)]
Move inline attributes in filesystem to first declaration

llvm-svn: 281683

8 years ago[CodeGen][ObjC] Block captures should inherit the type of the captured
Akira Hatanaka [Fri, 16 Sep 2016 00:02:06 +0000 (00:02 +0000)]
[CodeGen][ObjC] Block captures should inherit the type of the captured
field in the enclosing lambda or block.

This patch fixes a bug in code-gen where it uses the type of the
declared variable rather than the type of the capture of the enclosing
lambda or block for the block capture. For example, in the following
function, code-gen currently uses i32* for the block capture "a" because
"a" is passed to foo1 as a reference, but it should use i32 since the
enclosing lambda captures "a" by value.

void foo1(int &a) {
  auto lambda = [a]{
    auto block1 = ^{
      i = a;
    };
    block1();
  };
  lambda();
}

rdar://problem/18586386

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

llvm-svn: 281682

8 years ago[libc++] Add _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY to support GCC ABI compatibility
Eric Fiselier [Fri, 16 Sep 2016 00:00:48 +0000 (00:00 +0000)]
[libc++] Add _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY to support GCC ABI compatibility

Summary:
GCC and Clang handle visibility attributes on the out-of-line definition of externally instantiated templates differently. For example in the reproducer below Clang will emit both 'foo' and 'bar' with default visibility while GCC only emits a non-hidden 'foo'.

```
// RUN: g++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out
// RUN: clang++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out
#define INLINE_VISIBILITY __attribute__((visibility("hidden"), always_inline))

template <class T>
struct Foo {
  void foo();
  void bar();
};

template <class T>
void Foo<T>::foo() {}

template <class T>
inline INLINE_VISIBILITY
void Foo<T>::bar() {}

template struct Foo<int>;
```

This difference creates ABI incompatibilities between Clang and GCC built dylibs. Specifically GCC built dylibs lack definitions for various member functions of `basic_string`, `basic_istream`, `basic_ostream`, `basic_iostream`, and `basic_streambuf` (All of these types are externally instantiated).

Surprisingly these missing symbols don't cause many problems because the functions are marked `always_inline`  therefore the dylib definition is rarely needed. However when an out-of-line definition is required then GCC built dylibs will fail to link. For example [GCC built dylibs cannot build Clang](http://stackoverflow.com/questions/39454262/clang-build-errors).

This patch works around this issue by adding `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` which is used to mark externally instantiated member functions as always inline. When building the library `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` sets the symbol's visibility to "default" instead of "hidden", otherwise it acts exactly the same as `_LIBCPP_INLINE_VISIBILITY`.

After applying this patch GCC dylibs now contain:
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_`
  * `_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv`
  * `_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw`
  * `_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE`
  * `_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi`
  * `_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_`
  * `_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl`
  * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_`
  * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl`
  * `_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv`
  * `_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE`
  * `_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw`
  * `_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl`
  * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E`
  * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl`
  * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw`

This patch has no effect on Clang based builds.

Reviewers: mclow.lists, eugenis, danalbert, jroelofs, EricWF

Subscribers: beanz, cfe-commits, mgorny

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

llvm-svn: 281681

8 years ago[CUDA] Don't try to run sanitizers on NVPTX.
Justin Lebar [Thu, 15 Sep 2016 23:44:13 +0000 (23:44 +0000)]
[CUDA] Don't try to run sanitizers on NVPTX.

Summary:
Sanitizers aren't supported on NVPTX -- don't try to run them.

This lets you e.g. pass -fsanitize=address and get asan on your host
code.

Reviewers: kcc

Subscribers: cfe-commits, tra, jhen

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

llvm-svn: 281680

8 years ago[asan] fix window build
Kostya Serebryany [Thu, 15 Sep 2016 23:17:02 +0000 (23:17 +0000)]
[asan] fix window build

llvm-svn: 281679

8 years agoCheck /pdb output using llvm-pdbdump.
Rui Ueyama [Thu, 15 Sep 2016 23:14:40 +0000 (23:14 +0000)]
Check /pdb output using llvm-pdbdump.

test/COFF/rsds.test checks only RSDS directory in a DLL and
didn't check the validity of the PDF file produced.
(Technically the produced PDB is not valid because it is really
a stub, but this test is still good to have.)

llvm-svn: 281678

8 years ago[asan] provide dummy implementations for __sanitizer_cov_trace_pc_*
Kostya Serebryany [Thu, 15 Sep 2016 23:02:20 +0000 (23:02 +0000)]
[asan] provide dummy implementations for __sanitizer_cov_trace_pc_*

llvm-svn: 281677

8 years agobuild_llvm_package.bat: Update to VS2015 and include LLDB
Hans Wennborg [Thu, 15 Sep 2016 23:01:03 +0000 (23:01 +0000)]
build_llvm_package.bat: Update to VS2015 and include LLDB

llvm-svn: 281676

8 years ago[asan] Reenable 64-bit allocator on android/aarch64.
Evgeniy Stepanov [Thu, 15 Sep 2016 22:34:53 +0000 (22:34 +0000)]
[asan] Reenable 64-bit allocator on android/aarch64.

This is a re-commit of r281371, with updated tests.

llvm-svn: 281674

8 years ago[libc++] Fix and document visibility attributes for Clang, GCC and Windows.
Eric Fiselier [Thu, 15 Sep 2016 22:27:07 +0000 (22:27 +0000)]
[libc++] Fix and document visibility attributes for Clang, GCC and Windows.

Summary:
This patch fixes a number of problems with the visibility macros across GCC (on Unix) and Windows (DLL import/export semantics). All of the visibility macros are now documented under `DesignDocs/VisibilityMacros.rst`. Now I'll no longer forget the subtleties of each!

This patch adds two new visibility macros:

* `_LIBCPP_ENUM_VIS` for controlling the typeinfo of enum types. Only Clang supports this.
* `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` for redefining visibility on explicit instantiation declarations. Clang and Windows require this.

After applying this patch GCC only emits one -Wattribute warning opposed to 30+.

Reviewers: mclow.lists, EricWF

Subscribers: beanz, mgorny, cfe-commits

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

llvm-svn: 281673

8 years ago[InstCombine] move folds for icmp (sh C2, Y), C1 in with other icmp+sh folds; NFCI
Sanjay Patel [Thu, 15 Sep 2016 22:26:31 +0000 (22:26 +0000)]
[InstCombine] move folds for icmp (sh C2, Y), C1 in with other icmp+sh folds; NFCI

llvm-svn: 281672

8 years agoFix old copy-n-paste errors.
Rui Ueyama [Thu, 15 Sep 2016 22:26:07 +0000 (22:26 +0000)]
Fix old copy-n-paste errors.

llvm-svn: 281671

8 years agoCreate PDB.h and move code to remove unnecessary #includes.
Rui Ueyama [Thu, 15 Sep 2016 22:24:51 +0000 (22:24 +0000)]
Create PDB.h and move code to remove unnecessary #includes.

llvm-svn: 281670

8 years ago[Sema] Allow shifting a scalar operand by a vector operand.
Akira Hatanaka [Thu, 15 Sep 2016 22:19:25 +0000 (22:19 +0000)]
[Sema] Allow shifting a scalar operand by a vector operand.

r278501 inadvertently introduced a bug in which it disallowed shifting
scalar operands by vector operands when not compiling for OpenCL. This
commit fixes it.

Patch by Vladimir Yakovlev.

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

llvm-svn: 281669

8 years ago[sanitizer] Fixup 2: Do not introduce __sanitizer namespace globally
Anna Zaks [Thu, 15 Sep 2016 22:18:36 +0000 (22:18 +0000)]
[sanitizer] Fixup 2: Do not introduce __sanitizer namespace globally

This got committed by mistake. Should fix some bots.

llvm-svn: 281668

8 years ago[libFuzzer] make caller-callee feedback work with trace-pc-guard
Kostya Serebryany [Thu, 15 Sep 2016 22:16:15 +0000 (22:16 +0000)]
[libFuzzer] make caller-callee feedback work with trace-pc-guard

llvm-svn: 281667

8 years agoSimplify Clang's version number configuration in CMake.
David L. Jones [Thu, 15 Sep 2016 22:12:26 +0000 (22:12 +0000)]
Simplify Clang's version number configuration in CMake.

Currently, the Clang version is computed as follows:

 1. LLVM defines major, minor, and patch versions, all statically set. Today,
    these are 4, 0, and 0, respectively.
 2. The static version numbers are combined into PACKAGE_VERSION along with a
    suffix, so the result today looks like "4.0.0svn".
 3. Clang extracts CLANG_VERSION from PACKAGE_VERSION using a regexp. The regexp
    allows the patch level to omitted, and drops any non-digit trailing values.
    Today, this result looks like "4.0.0".
 4. CLANG_VERSION is then split further into CLANG_VERSION_MAJOR and
    CLANG_VERSION_MINOR. Today, these resolve to 4 and 0, respectively.
 5. If CLANG_VERSION matches a regexp with three version components, then
    CLANG_VERSION_PATCHLEVEL is extracted and the CLANG_HAS_VERSION_PATCHLEVEL
    variable is set to 1. Today, these values are 0 and 1, respectively.
 6. The CLANG_VERSION_* variables (and CLANG_HAS_VERSION_PATCHLEVEL) are
    configured into [llvm/tools/clang/]include/clang/Basic/Version.inc
    verbatim by CMake.
 7. In [llvm/tools/clang/]include/clang/Basic/Version.h, macros are defined
    conditionally, based on CLANG_HAS_VERSION_PATCHLEVEL, to compute
    CLANG_VERSION_STRING as either a two- or three-level version number. Today,
    this value is "4.0.0", because despite the patchlevel being 0, it was
    matched by regexp and is thus "HAS"ed by the preprocessor. This string is
    then used wherever Clang's "version" is needed [*].

[*] Including, notably, by compiler-rt, for computing its installation path.

This change collapses steps 2-5 by defaulting Clang to use LLVM's (non-string)
version components for the Clang version (see [*] for why not PACKAGE_VERSION),
and collapses steps 6 and 7 by simply writing CLANG_VERSION_STRING into
Version.inc. The Clang version today always uses the patchlevel form, so the
collapsed Version.inc does not have logic for a version without a patch level.

Historically speaking, this technique began with the VER file in r82085 (which
survives in the form of the regexp in #3). The major, minor, and patchlevel
versions were introduced by r106863 (which remains in #4-6). The VER file itself
was deleted in favor of the LLVM version number in r106914. On the LLVM side,
the individual LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR, and PACKAGE_VERSION
weren't introduced for nearly two more years, until r150405.

llvm-svn: 281666

8 years ago[sanitizer-coverage] make trace-pc-guard and indirect-call work together
Kostya Serebryany [Thu, 15 Sep 2016 22:11:08 +0000 (22:11 +0000)]
[sanitizer-coverage] make trace-pc-guard and indirect-call work together

llvm-svn: 281665

8 years ago[codeview] Optimize the size of defranges with gaps
Reid Kleckner [Thu, 15 Sep 2016 22:05:08 +0000 (22:05 +0000)]
[codeview] Optimize the size of defranges with gaps

For small, discontiguous local variable regions, CodeView can use a
single defrange record with a gap, rather than having two defrange
records. I expect that this optimization will only have a minor impact
on debug info size.

llvm-svn: 281664

8 years ago[InstCombine] allow icmp (shr/shl) folds for vectors
Sanjay Patel [Thu, 15 Sep 2016 21:35:30 +0000 (21:35 +0000)]
[InstCombine] allow icmp (shr/shl) folds for vectors

These 2 helper functions were already using APInt internally, so just
change the API and caller to allow folds for splats. The scalar
regression tests look quite thorough, so I just added a couple of
tests to prove that vectors are handled too.

These folds should be grouped with the other cmp+shift folds though.
That can be an NFC follow-up.

llvm-svn: 281663

8 years agoAllow ArchSpec to take a StringRef.
Zachary Turner [Thu, 15 Sep 2016 21:32:57 +0000 (21:32 +0000)]
Allow ArchSpec to take a StringRef.

llvm-svn: 281662

8 years ago[cmake] Don't depend on lldb-server unless it's built.
Zachary Turner [Thu, 15 Sep 2016 21:32:51 +0000 (21:32 +0000)]
[cmake] Don't depend on lldb-server unless it's built.

llvm-svn: 281661

8 years agoError out instead of producing a corrupt PT_LOAD.
Rafael Espindola [Thu, 15 Sep 2016 21:22:11 +0000 (21:22 +0000)]
Error out instead of producing a corrupt PT_LOAD.

What bfd and gold do is give up in putting the headers in the PT_LOAD
and just start the PT_LOAD in the second page.

llvm-svn: 281660

8 years ago[sanitizer] Fixup: Do not introduce __sanitizer namespace globally
Anna Zaks [Thu, 15 Sep 2016 21:15:06 +0000 (21:15 +0000)]
[sanitizer] Fixup: Do not introduce __sanitizer namespace globally

Use the namespace in asan_win_dll_thunk.cc to fix the Windows bot.

llvm-svn: 281659

8 years ago[compiler-rt] Remove the system includes from __sanitizer namespace
Anna Zaks [Thu, 15 Sep 2016 21:02:22 +0000 (21:02 +0000)]
[compiler-rt] Remove the system includes from __sanitizer namespace

llvm-svn: 281658

8 years ago[compiler-rt] Do not introduce __sanitizer namespace globally
Anna Zaks [Thu, 15 Sep 2016 21:02:18 +0000 (21:02 +0000)]
[compiler-rt] Do not introduce __sanitizer namespace globally

The definitions in sanitizer_common may conflict with definitions from system headers because:

The runtime includes the system headers after the project headers (as per LLVM coding guidelines).
lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT
This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry.

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

llvm-svn: 281657

8 years ago[sanitizers] DLAddr Symbolizer should fail if demangle fails
Anna Zaks [Thu, 15 Sep 2016 21:02:09 +0000 (21:02 +0000)]
[sanitizers] DLAddr Symbolizer should fail if demangle fails

This can case crashes in high verbosity mode when demangling fails.
Not including a test case since this is hard to reproduce.

llvm-svn: 281656

8 years agoregenerate checks
Sanjay Patel [Thu, 15 Sep 2016 20:39:01 +0000 (20:39 +0000)]
regenerate checks

llvm-svn: 281655

8 years ago[SE] Fix config bug with CUDA tests
Jason Henline [Thu, 15 Sep 2016 20:26:28 +0000 (20:26 +0000)]
[SE] Fix config bug with CUDA tests

Summary:
It turns out CMake errors out if a processed directory contains source
files that are not used. This was causing an error with the CUDATest.cpp
file when configuring StreamExecutor with the CUDA platform disabled.

Moving CUDATest.cpp to its own directory fixes this problem.

Reviewers: jlebar, jprice

Subscribers: beanz, mgorny, jlebar, parallel_libs-commits

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

llvm-svn: 281654

8 years ago[GlobalOpt] Dead Eliminate declarations
Mehdi Amini [Thu, 15 Sep 2016 20:26:27 +0000 (20:26 +0000)]
[GlobalOpt] Dead Eliminate declarations

GlobalOpt is already dead-code-eliminating global definitions. With
this change it also takes care of declarations.
Hopefully this should make it now a strict superset of GlobalDCE.
This is important for LTO/ThinLTO as we don't want the linker to see
"undefined reference" when it processes the input files: it could
prevent proper internalization (or even load an extra file from a
static archive, changing the behavior of the program!).

llvm-svn: 281653

8 years agoFixing bot failures
Chris Bieneman [Thu, 15 Sep 2016 20:23:31 +0000 (20:23 +0000)]
Fixing bot failures

Need to only add debugserver as a test dependency on Darwin.

llvm-svn: 281652