Commit Graph

242838 Commits

Author SHA1 Message Date
Dmitry Vyukov cc1f318b5a tsan: support pie binaries on newer kernels
4.1+ Linux kernels map pie binaries at 0x55:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d1fd836dcf00d2028c700c7e44d2c23404062c90
Currently tsan does not support app memory at 0x55 (https://github.com/google/sanitizers/issues/503).
Older kernels also map pie binaries at 0x55 when ASLR is disables (most notably under gdb).

This change extends tsan mapping for linux/x86_64 to cover 0x554-0x568 app range and fixes both 4.1+ kernels and gdb.

This required to slightly shrink low and high app ranges and move heap. The mapping become even more non-linear, since now we xor lower bits. Now even a continuous app range maps to split, intermixed shadow ranges. This breaks ShadowToMemImpl as it assumes linear mapping at least within a continuous app range (however it turned out to be already broken at least on arm64/42-bit vma as uncovered by r281970). So also change ShadowToMemImpl to hopefully a more robust implementation that does not assume a linear mapping.

llvm-svn: 282152
2016-09-22 13:42:02 +00:00
Teresa Johnson 9e05266dcb Second attempt to fix Sphinx bot
The fix in r282148 was not enough to fix the following error:
/home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338:
WARNING: unknown option: -flto=full

on the sphinx bot:
  http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313

(not reproducible locally).

This time, simply remove the option reference.

llvm-svn: 282151
2016-09-22 13:41:10 +00:00
Anna Thomas 82c3717f54 [RS4GC] Remat in presence of phi and use live value
Summary:

Reviewers:

Subscribers:

llvm-svn: 282150
2016-09-22 13:13:06 +00:00
Rafael Espindola a940e5396b Fix VA computation for tbss.
llvm-svn: 282149
2016-09-22 12:35:44 +00:00
Aaron Ballman 9bd12f4b3a Fixing sphinx build due to diagnostic:
/opt/llvm/build.attributes.src/tools/clang/docs/CommandGuide/clang.rst:338: WARNING: unknown option: -flto=full

llvm-svn: 282148
2016-09-22 12:15:18 +00:00
Rafael Espindola 7252ae52cf Handle multiple .tbss sections.
llvm-svn: 282147
2016-09-22 12:00:08 +00:00
Eric Liu 12068d86c3 [change-namespace] fix qualifier of function references.
Reviewers: hokein

Subscribers: cfe-commits

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

llvm-svn: 282146
2016-09-22 11:54:00 +00:00
Artem Tamazov 2146a0a90e [AMDGPU][mc] Add support for absolute expressions in DPP modifiers.
Also added range checking for DPP attributes.
Assembler tests added as well.

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

llvm-svn: 282145
2016-09-22 11:47:21 +00:00
Nemanja Ivanovic e78ffede6f [PowerPC] Remove LE patterns matching generic stores/loads to VSX permuting ops
This patch corresponds to:
https://reviews.llvm.org/D21409

The LXVD2X, LXVW4X, STXVD2X and STXVW4X instructions permute the two doublewords
in the vector register when in little-endian mode. Custom code ensures that the
necessary swaps are inserted for these. This patch simply removes the possibilty
that a load/store node will match one of these instructions in the SDAG as that
would not insert the necessary swaps.

llvm-svn: 282144
2016-09-22 10:32:03 +00:00
Nemanja Ivanovic 6e7879c5e6 [Power9] Add exploitation of non-permuting memory ops
This patch corresponds to review:
https://reviews.llvm.org/D19825

The new lxvx/stxvx instructions do not require the swaps to line the elements
up correctly. In order to select them over the lxvd2x/lxvw4x instructions which
require swaps, the patterns for the old instruction have a predicate that
ensures they won't be selected on Power9 and newer CPUs.

llvm-svn: 282143
2016-09-22 09:52:19 +00:00
Sagar Thakur 2ce2ab3a4d [ESan][MIPS] Fix tests struct-simple.cpp on MIPS
For mips assember '#' is the start of comment. We get assembler error messages if # is used in the struct names. Therefore using '$' which works for all architectures.

Differential: D24335
Reviewed by: zhaoqin

llvm-svn: 282142
2016-09-22 08:36:54 +00:00
Sagar Thakur e74eb4e7b9 [EfficiencySanitizer] Using '$' instead of '#' for struct counter name
For MIPS '#' is the start of comment line. Therefore we get assembler errors if # is used in the structure names.

Differential: D24334
Reviewed by: zhaoqin

llvm-svn: 282141
2016-09-22 08:33:06 +00:00
Dorit Nuzman d1247a684e Fix revision 281960
llvm-svn: 282139
2016-09-22 07:56:23 +00:00
Martin Probst 4210d2fd1e clang-format: [JS] reserved words in method names.
Summary:
Before:
    class X {
      delete () {
        ...
      }
    }

After:
    class X {
      delete() {
        ...
      }
    }

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 282138
2016-09-22 07:18:00 +00:00
Craig Topper 5fbabd77c7 [X86] Fix some illegal rounding modes in some builtin test cases to ones that would properly compile to valid assembly.
llvm-svn: 282137
2016-09-22 06:13:33 +00:00
Stephen Hines 90ced94b22 clang-format: Add an option to git-clang-format to diff between to commits
Summary:
When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits.

This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory.

There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead.

Patch by Luis Hector Chavez!

Reviewers: djasper, lodato

Subscribers: lodato, cfe-commits, srhines

Projects: #clang-c

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

llvm-svn: 282136
2016-09-22 05:52:55 +00:00
Ilia K a3174853b7 Fix parsing expressions to evaluate with spaces and optional args (MI)
Summary:
When extracting options for long options (starting with `--`), the use of
`MIUtilString::SplitConsiderQuotes` to split all the arguments was being
conditioned on the option type to be expected. This was wrong as this caused
other options to be parsed incorrectly since it was not taking into account the
presence of quotes.

Patch by Ed Munoz <edmunoz@microsoft.com>

Reviewers: edmunoz, ki.stfu

Subscribers: ki.stfu, lldb-commits

Projects: #lldb

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

llvm-svn: 282135
2016-09-22 05:08:41 +00:00
Marshall Clow c669522a26 Fix failure on 03 bot
llvm-svn: 282134
2016-09-22 03:25:22 +00:00
Craig Topper 202b453a8a [AVX-512] Add support for commuting VPTERNLOG instructions.
VPTERNLOG is a ternary instruction with an immediate specifying the logical operation to perform. For each bit position in the 3 source vectors the bit from each source is concatenated together and the resulting 3-bit value is used to select a bit in the immediate. This bit value is written to the result vector.

We can commute this by swapping operands and modifying the immediate. To modify the immediate we need to swap two pairs of bits. The pairs correspond to the locations in the immediate where the commuted operands bits have opposite values and the uncommuted operand has the same value. Bits 0 and 7 will never be swapped since the relevant bits from all sources are the same value.

This refactors and reuses parts of the FMA3 commuting code which is also a three operand instruction.

llvm-svn: 282132
2016-09-22 03:00:50 +00:00
Quentin Colombet 6a76323c64 [RegisterBankInfo] Move to statically allocated RegisterBank.
This commit is basically the first step toward what will
RegisterBankInfo look when it gets TableGen'ed.

It introduces a XXXGenRegisterBankInfo.def file that is what TableGen
will issue at some point. Moreover, the RegBanks field in
RegisterBankInfo changed to reflect the static (compile time) aspect of
the information.

llvm-svn: 282131
2016-09-22 02:10:37 +00:00
Quentin Colombet b202eb88aa [RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize.
When initializing an instance of OperandsMapper, instead of using
SmallVector::resize followed by std::fill, use the function that
directly does that in SmallVector.

llvm-svn: 282130
2016-09-22 02:10:32 +00:00
Kostya Serebryany 624f59f4d8 [libFuzzer] add 'features' to the corpus elements, allow mutations with Size > MaxSize, fix sha1 in corpus stats; various refactorings
llvm-svn: 282129
2016-09-22 01:34:58 +00:00
Todd Fiala 150aa321f7 fix Args function broken in r281942
The method was hard-coded to check only the 0th element of the array.
This manifested as NSLog messages behaving incorrectly on macOS.
(This is independent of the broken DarwinLog feature).

llvm-svn: 282128
2016-09-22 00:59:23 +00:00
Kostya Serebryany c9e3de35ed [libFuzzer] one more test
llvm-svn: 282127
2016-09-22 00:57:29 +00:00
Marshall Clow a48055cee3 Add missing _v traits. is_bind_expression_v, is_placeholder_v and uses_allocator_v
llvm-svn: 282126
2016-09-22 00:23:15 +00:00
Chris Bieneman 725acc4d85 [CMake] More robust handling for bootstrap variables
Checking defined isn't good enough we also need to handle defined to empty string.

llvm-svn: 282125
2016-09-22 00:18:12 +00:00
George Burgess IV d273aab55b [Sema] Fix PR30481: crash on checking printf args.
We were falling through from one case to another in a switch statement.
Oops.

llvm-svn: 282124
2016-09-22 00:00:26 +00:00
Ed Maste 2ce823d0d8 Fix typo in lldb --help
Patch by Yacine Belkadi

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

llvm-svn: 282123
2016-09-21 23:30:36 +00:00
Chris Bieneman 43a601d1ec [CMake] Check if passthrough variables are defined
Checking if they evaluate to true cases prevents passing values that evaluate to false cases. Instead we should check if the variables are defined.

llvm-svn: 282122
2016-09-21 23:24:15 +00:00
Kostya Serebryany 29bb664075 [libFuzzer] add stats to the corpus; more refactoring
llvm-svn: 282121
2016-09-21 22:42:17 +00:00
Ed Maste 0509203952 Fix for loop sign fix in r282112 for column = 0
llvm-svn: 282119
2016-09-21 22:36:51 +00:00
Rafael Espindola 24c073d1bb Once more unto the strict weak ordering, once more.
This should finally give a stable sorting over all implementations.

llvm-svn: 282118
2016-09-21 22:36:19 +00:00
Zachary Turner 4037780485 Fix an incorrect nullptr conversion.
llvm-svn: 282117
2016-09-21 22:33:30 +00:00
Zachary Turner 2aba5cfa57 =delete the StringRef(nullptr_t) constructor.
It's a guaranteed crash if you construct a StringRef with
nullptr, so might as well delete the constructor that allows
it.

llvm-svn: 282116
2016-09-21 22:29:36 +00:00
Kostya Serebryany 20801e1b8a [libFuzzer] more refactoring; don't compute sha1sum every time we mutate a unit from the corpus, use the stored one.
llvm-svn: 282115
2016-09-21 21:41:48 +00:00
Kostya Serebryany 8658618ea0 [libFuzzer] more refactoring
llvm-svn: 282113
2016-09-21 21:17:23 +00:00
Ed Maste ac77fe3b55 Fix integer sign warning from r282105
llvm-svn: 282112
2016-09-21 21:14:31 +00:00
Ed Maste 228e4abb63 Fix -Wcovered-switch-default warning in StackFrame.cpp
The switch coveres all possible values. If a new one is added in the
future the compiler will start warning, providing a notification that
the switch needs updating.

llvm-svn: 282111
2016-09-21 21:08:30 +00:00
Chris Bieneman d3199f5ed2 [CMake] Initial support for LLDB.framework
Summary:
This patch adds a CMake option LLDB_BUILD_FRAMEWORK, which builds libLLDB as a macOS framework instead of as a *nix shared library.

With this patch any LLDB executable that has the INCLUDE_IN_FRAMEWORK option set will be built into the Framework's resources directory, and a symlink to the exeuctable will be placed under the build directory's bin folder. Creating the symlinks allows users to run commands from the build directory without altering the workflow.

The framework generated by this patch passes the LLDB test suite, but has not been tested beyond that. It is not expected to be fully ready to ship, but it is a first step.

With this patch binaries that are placed inside the framework aren't being properly installed. Fixing that would increase the patch size significantly, so I'd like to do that in a follow-up.

Reviewers: zturner, tfiala

Subscribers: beanz, lldb-commits, mgorny

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

llvm-svn: 282110
2016-09-21 21:02:16 +00:00
Chris Bieneman 2c4d54f326 [CMake] Pass CLANG_VERSION_* variables into later stages
When supporting overriding clang versions we also need to pass those through to the next stage so they remain overridden.

llvm-svn: 282109
2016-09-21 20:43:43 +00:00
Albert Gutowski 8bfb2ef98f Add -Wignored-pragma-intrinsic flag
Summary: People might want to receive warnings about pragmas but not about intrinsics that are implemented in intrin.h.

Reviewers: thakis, hans

Subscribers: cfe-commits

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

llvm-svn: 282108
2016-09-21 20:19:21 +00:00
Filipe Cabecinhas a8b5f5e9d1 [asan] Reify ErrorGeneric
Summary:
Finish work on PR30351 (last one, after D24551, D24552, and D24554 land)

Also replace the old ReportData structure/variable with the current_error_ static
member of the ScopedInErrorReport class.

This has the following side-effects:
  - Move ASAN_ON_ERROR(); call to the start of the destructor, instead
    of in StartReporting().
      - We only generate the error structure after the
        ScopedInErrorReport constructor finishes, so we can't call
        ASAN_ON_ERROR() during the constructor. I think this makes more
        sense, since we end up never running two of the ASAN_ON_ERROR()
        callback. This also works the same way as error reporting, since
        we end up having a lock around it. Otherwise we could end up
        with the ASAN_ON_ERROR() call for error 1, then the
        ASAN_ON_ERROR() call for error 2, and then lock the mutex for
        reporting error 1.
  - The __asan_get_report_* functions will be able to, in the future,
    provide information about other errors that aren't a "generic
    error". But we might want to rethink that API, since it's too
    restricted. Ideally we teach lldb about the current_error_ member of
    ScopedInErrorReport.

Reviewers: vitalybuka, kcc, eugenis

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 282107
2016-09-21 20:18:18 +00:00
Jan Vesely 0a5aac3fc4 Provide vstore_half helper to workaround clc restrictions
clang won't accept half precision loads and stores without cl_khr_fp16 since r281904

llvm-svn: 282106
2016-09-21 20:15:55 +00:00
Todd Fiala 9666ba7526 add stop column highlighting support
This change introduces optional marking of the column within a source
line where a thread is stopped.  This marking will show up when the
source code for a thread stop is displayed, when the debug info
knows the column information, and if the optional column marking is
enabled.

There are two separate methods for handling the marking of the stop
column:

* via ANSI terminal codes, which are added inline to the source line
  display.  The default ANSI mark-up is to underline the column.

* via a pure text-based caret that is added in the appropriate column
  in a newly-inserted blank line underneath the source line in
  question.

There are some new options that control how this all works.

* settings set stop-show-column

  This takes one of 4 values:

  * ansi-or-caret: use the ANSI terminal code mechanism if LLDB
    is running with color enabled; if not, use the caret-based,
    pure text method (see the "caret" mode below).

  * ansi: only use the ANSI terminal code mechanism to highlight
    the stop line.  If LLDB is running with color disabled, no
    stop column marking will occur.

  * caret: only use the pure text caret method, which introduces
    a newly-inserted line underneath the current line, where
    the only character in the new line is a caret that highlights
    the stop column in question.

  * none: no stop column marking will be attempted.

* settings set stop-show-column-ansi-prefix

  This is a text format that indicates the ANSI formatting
  code to insert into the stream immediately preceding the
  column where the stop column character will be marked up.
  It defaults to ${ansi.underline}; however, it can contain
  any valid LLDB format codes, e.g.

      ${ansi.fg.red}${ansi.bold}${ansi.underline}

* settings set stop-show-column-ansi-suffix

  This is the text format that specifies the ANSI terminal
  codes to end the markup that was started with the prefix
  described above.  It defaults to: ${ansi.normal}.  This
  should be sufficient for the common cases.

Significant leg-work was done by Adrian Prantl.  (Thanks, Adrian!)

differential review: https://reviews.llvm.org/D20835

reviewers: clayborg, jingham
llvm-svn: 282105
2016-09-21 20:13:14 +00:00
Kevin Enderby e71e13c7d6 Next set of additional error checks for invalid Mach-O files for bad LC_UUID
load commands.  Added a missing check and made the check for more than
one like other other “more than one” checks.  And of course added test cases.

llvm-svn: 282104
2016-09-21 20:03:09 +00:00
Jim Ingham 1ac2f2c4d3 Probably should add the breakpoint names test directory as well...
llvm-svn: 282103
2016-09-21 19:21:38 +00:00
Filipe Cabecinhas 490f96cba6 [asan] Store full AddressDescription objects in ErrorInvalidPointerPair
Reviewers: kcc, vitalybuka, eugenis

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 282102
2016-09-21 19:21:01 +00:00
Chad Rosier 00eb8db3a1 [LoopInterchange] Track all dependencies, not just anti dependencies.
Currently, we give up on loop interchange if we encounter a flow dependency
anywhere in the loop list. Worse yet, we don't even track output dependencies.

This patch updates the dependency matrix computation to track flow and output
dependencies in the same way we track anti dependencies.

This improves an internal workload by 2.2x.

Note the loop interchange pass is off by default and it can be enabled with
'-mllvm -enable-loopinterchange'

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

llvm-svn: 282101
2016-09-21 19:16:47 +00:00
Teresa Johnson 3f212b8908 [ThinLTO] Emit files for distributed builds for all modules
With the new LTO API in r278338, we stopped emitting the individual
index files and imports files for some modules in the distributed backend
case (thinlto-index-only plugin option).

Specifically, this is when the linker decides not to include a module in the
link, because it was in an archive library and did not have a strong
reference to it. Not creating the expected output files makes the
distributed build system implementation more difficult, in terms of
checking for the expected outputs of the thin link, and scheduling the
backend jobs. To address this, the gold-plugin will write dummy empty
.thinlto.bc and .imports files for modules not included in the link
(which LTO never sees).

Augmented a gold v1.12+ test, since that version of gold has the handling
for notifying on modules not being included in the link.

llvm-svn: 282100
2016-09-21 19:12:05 +00:00
Rafael Espindola e746e52c7b Implement ONLY_IF_RO/ONLY_IF_RW like bfd.
The actual logic is to keep the output section if the output section
would have been ro/rw.

This is both simpler and more practical, as the intention is linker
scripts is to always keep of of a pair of ONLY_IF_RO/ONLY_IF_RW.

llvm-svn: 282099
2016-09-21 18:33:44 +00:00