platform/upstream/llvm.git
5 years ago[clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-namin...
Stephane Moore [Tue, 4 Dec 2018 23:40:42 +0000 (23:40 +0000)]
[clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-naming check ðŸ™ˆ

Summary: The google-objc-function-naming check applies to functions that are not namespaced and should not be applied to C++ member functions. Such function declarations should be ignored by the check to avoid false positives in Objective-C++ sources.

Reviewers: benhamilton, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 348317

5 years ago[asan] Split -asan-use-private-alias to -asan-use-odr-indicator
Vitaly Buka [Tue, 4 Dec 2018 23:17:41 +0000 (23:17 +0000)]
[asan] Split -asan-use-private-alias to -asan-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: mehdi_amini, kubamracek, hiraditya, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 348316

5 years ago[asan] Remove use_odr_indicator runtime flag
Vitaly Buka [Tue, 4 Dec 2018 23:17:32 +0000 (23:17 +0000)]
[asan] Remove use_odr_indicator runtime flag

Summary:
Flag was added for testing 3 years ago. Probably it's time
to simplify code and usage by removing it.

Reviewers: eugenis, m.ostapenko

Subscribers: mehdi_amini, kubamracek, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 348315

5 years agoFix LLDB build script.
Zachary Turner [Tue, 4 Dec 2018 22:46:01 +0000 (22:46 +0000)]
Fix LLDB build script.

A local patch was omitted from the original commit.  This makes
the tests pass.

llvm-svn: 348314

5 years agoFix crash if an in-class explicit function specialization has explicit
Richard Smith [Tue, 4 Dec 2018 22:26:32 +0000 (22:26 +0000)]
Fix crash if an in-class explicit function specialization has explicit
template arguments referring to template paramaeters.

llvm-svn: 348313

5 years ago[InstCombine] add tests for implied simplifications; NFC
Sanjay Patel [Tue, 4 Dec 2018 22:25:33 +0000 (22:25 +0000)]
[InstCombine] add tests for implied simplifications; NFC

Ideally, we would fold all of these in InstSimplify in a
similar way to rL347896, but this is a bit awkward when
we're trying to simplify a compare directly because the
ValueTracking API expects the compare as an input, but
in InstSimplify, we just have the operands of the compare.

Given that we can do transforms besides just simplifications,
we might as well just extend the code in InstCombine (which
already does simplifications with constant operands).

llvm-svn: 348312

5 years ago[ELF] Simplify getSectionPiece
Fangrui Song [Tue, 4 Dec 2018 22:25:05 +0000 (22:25 +0000)]
[ELF] Simplify getSectionPiece

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: grimar, emaste, arichardson, llvm-commits

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

llvm-svn: 348311

5 years agoAArch64: clean up some whitespace in Windows CC (NFC)
Saleem Abdulrasool [Tue, 4 Dec 2018 22:19:29 +0000 (22:19 +0000)]
AArch64: clean up some whitespace in Windows CC (NFC)

Drive by clean up for Windows ARM64 variadic CC (NFC).

llvm-svn: 348310

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Tue, 4 Dec 2018 21:50:08 +0000 (21:50 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for the definition data of C++ record objects as well as special member functions.

llvm-svn: 348309

5 years agoAdd tests for dumping base classes; NFC.
Aaron Ballman [Tue, 4 Dec 2018 21:49:24 +0000 (21:49 +0000)]
Add tests for dumping base classes; NFC.

llvm-svn: 348308

5 years ago[llvm-pdbutil] Remove the analyze subcommand.
Zachary Turner [Tue, 4 Dec 2018 21:49:04 +0000 (21:49 +0000)]
[llvm-pdbutil] Remove the analyze subcommand.

Nobody has used this since it was introduced, and it doesn't have
test coverage.

llvm-svn: 348307

5 years ago[PDB] Emit S_UDT records in LLD.
Zachary Turner [Tue, 4 Dec 2018 21:48:46 +0000 (21:48 +0000)]
[PDB] Emit S_UDT records in LLD.

Previously these were dropped.  We now understand them sufficiently
well to start emitting them.  From the debugger's perspective, this
now enables us to have debug info about typedefs (both global and
function-locally scoped)

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

llvm-svn: 348306

5 years ago[build.py] A few general improvements.
Zachary Turner [Tue, 4 Dec 2018 21:48:27 +0000 (21:48 +0000)]
[build.py] A few general improvements.

This makes -mode=compile support multiple inputs (and hence
multiple outputs).

It also makes the value of -arch for compiling inferiors default
to the architecture that LLDB is built in.  This can still be
overridden however.

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

llvm-svn: 348305

5 years ago[AVR] Silence fallthrough warning. NFC.
Nirav Dave [Tue, 4 Dec 2018 21:41:52 +0000 (21:41 +0000)]
[AVR] Silence fallthrough warning. NFC.

llvm-svn: 348304

5 years agoRevert "[ADT] Add zip_longest iterators"
Michael Kruse [Tue, 4 Dec 2018 21:38:55 +0000 (21:38 +0000)]
Revert "[ADT] Add zip_longest iterators"

This reverts commit r348301.

Compilation fails on buildbots with older versions of gcc and msvc.

llvm-svn: 348303

5 years ago[Documentation] Make options section in Clang-tidy readability-uppercase-literal...
Eugene Zelenko [Tue, 4 Dec 2018 21:19:08 +0000 (21:19 +0000)]
[Documentation] Make options section in Clang-tidy readability-uppercase-literal-suffix consistent with other checks.

llvm-svn: 348302

5 years ago[ADT] Add zip_longest iterators
Michael Kruse [Tue, 4 Dec 2018 21:06:16 +0000 (21:06 +0000)]
[ADT] Add zip_longest iterators

Like the already existing zip_shortest/zip_first iterators, zip_longest
iterates over multiple iterators at once, but has as many iterations as
the longest sequence.

This means some iterators may reach the end before others do.
zip_longest uses llvm::Optional's None value to mark a
past-the-end value.

zip_longest is not reverse-iteratable because the tuples iterated over
would be different for different length sequences (IMHO for the same
reason neither zip_shortest nor zip_first should be reverse-iteratable;
one can still reverse the ranges individually if that's the expected
behavior).

In contrast to zip_shortest/zip_first, zip_longest tuples contain
rvalues instead of references. This is because llvm::Optional cannot
contain reference types and the value-initialized default does not have
a memory location a reference could point to.

The motivation for these iterators is to use C++ foreach to compare two
lists of ordered attributes in D48100 (SemaOverload.cpp and
ASTReaderDecl.cpp).

Idea by @hfinkel.

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

llvm-svn: 348301

5 years agoAdd SBInitializerOptions.cpp.
Jason Molenda [Tue, 4 Dec 2018 20:34:23 +0000 (20:34 +0000)]
Add SBInitializerOptions.cpp.

llvm-svn: 348300

5 years ago[PowerPC] Make no-PIC default to match GCC - CLANG
Stefan Pintilie [Tue, 4 Dec 2018 20:15:37 +0000 (20:15 +0000)]
[PowerPC] Make no-PIC default to match GCC - CLANG

Make -fno-PIC default on PowerPC LE.

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

llvm-svn: 348299

5 years ago[PowerPC] Make no-PIC default to match GCC - LLVM
Stefan Pintilie [Tue, 4 Dec 2018 20:14:57 +0000 (20:14 +0000)]
[PowerPC] Make no-PIC default to match GCC - LLVM

Change the default for PowerPC LE to -fno-PIC.

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

llvm-svn: 348298

5 years agoFix sanitizer unit test
David Carlier [Tue, 4 Dec 2018 19:49:19 +0000 (19:49 +0000)]
Fix sanitizer unit test

llvm-svn: 348297

5 years ago[libcxx] Always enable availability in the lit test suite.
Louis Dionne [Tue, 4 Dec 2018 19:31:08 +0000 (19:31 +0000)]
[libcxx] Always enable availability in the lit test suite.

Summary:
Running the tests without availability enabled doesn't really make sense:
availability annotations allow catching errors at compile-time instead
of link-time. Running the tests without availability enabled allows
confirming that a test breaks at link-time under some configuration,
but it is more useful to instead check that it should fail at compile-time.

Always enabling availability in the lit test suite will greatly simplify
XFAILs and troubleshooting of failing tests, which is currently a giant
pain because we have these two levels of possible failure: link-time and
compile-time.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 348296

5 years agoUnbreak build due to style.
David Carlier [Tue, 4 Dec 2018 19:17:26 +0000 (19:17 +0000)]
Unbreak build due to style.

llvm-svn: 348295

5 years agoRemove unreachable code.
Rui Ueyama [Tue, 4 Dec 2018 19:00:56 +0000 (19:00 +0000)]
Remove unreachable code.

llvm-svn: 348294

5 years ago[Sanitizer] intercept part of sysctl Api
David Carlier [Tue, 4 Dec 2018 19:00:38 +0000 (19:00 +0000)]
[Sanitizer] intercept part of sysctl Api

- Distringuish what FreeBSD/NetBSD can and NetBSD specifics.
- Fixing page size value collection.

Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

llvm-svn: 348293

5 years ago[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC
Sanjay Patel [Tue, 4 Dec 2018 18:53:27 +0000 (18:53 +0000)]
[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC

The old function underspecified the return type, took an unused parameter,
and had a misleading name.

llvm-svn: 348292

5 years agoELF: allow non allocated sections to go into allocated sections
Rui Ueyama [Tue, 4 Dec 2018 18:47:44 +0000 (18:47 +0000)]
ELF: allow non allocated sections to go into allocated sections

Patch from Andrew Kelley.

For context, see https://bugs.llvm.org/show_bug.cgi?id=39862

The use case is embedded / OS programming where the kernel wants
access to its own debug info via mapped dwarf info. I have a proof of
concept of this working, using this linker script snippet:

  .rodata : ALIGN(4K) {
    *(.rodata)
    __debug_info_start = .;
    KEEP(*(.debug_info))
    __debug_info_end = .;
    __debug_abbrev_start = .;
    KEEP(*(.debug_abbrev))
    __debug_abbrev_end = .;
    __debug_str_start = .;
    KEEP(*(.debug_str))
    __debug_str_end = .;
    __debug_line_start = .;
    KEEP(*(.debug_line))
    __debug_line_end =
    .;
    __debug_ranges_start
    = .;
    KEEP(*(.debug_ranges))
    __debug_ranges_end
    = .;
  }

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

llvm-svn: 348291

5 years agoMove llc-start-stop-instance to x86
Matt Arsenault [Tue, 4 Dec 2018 18:19:08 +0000 (18:19 +0000)]
Move llc-start-stop-instance to x86

Avoid bot failures where the host pass
setup might not have 2 dead-mi-elimination runs

llvm-svn: 348290

5 years ago[Reproducers] Only creaate the bottom-most dir
Jonas Devlieghere [Tue, 4 Dec 2018 18:16:49 +0000 (18:16 +0000)]
[Reproducers] Only creaate the bottom-most dir

As Pavel noted on the mailing list we should only create the bottom-most
directory if it doesn't exist. This should also fix the test case on
Windows as we can use lit's temp directory.

llvm-svn: 348289

5 years ago[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.
Nirav Dave [Tue, 4 Dec 2018 17:59:43 +0000 (17:59 +0000)]
[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.

llvm-svn: 348288

5 years ago[FileSystem] Migrate CommandCompletions
Jonas Devlieghere [Tue, 4 Dec 2018 17:58:21 +0000 (17:58 +0000)]
[FileSystem] Migrate CommandCompletions

Make use of the convenience helpers from FileSystem.

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

llvm-svn: 348287

5 years agoAMDGPU: Add f32 vectors to SGPR register classes
Matt Arsenault [Tue, 4 Dec 2018 17:51:36 +0000 (17:51 +0000)]
AMDGPU: Add f32 vectors to SGPR register classes

llvm-svn: 348286

5 years agoMIR: Add method to stop after specific runs of passes
Matt Arsenault [Tue, 4 Dec 2018 17:45:12 +0000 (17:45 +0000)]
MIR: Add method to stop after specific runs of passes

Currently if you use -{start,stop}-{before,after}, it picks
the first instance with the matching pass name. If you run
the same pass multiple times, there's no way to distinguish them.

Allow specifying a run index wih ,N to specify which you mean.

llvm-svn: 348285

5 years ago[InstCombine] rearrange foldICmpWithDominatingICmp; NFC
Sanjay Patel [Tue, 4 Dec 2018 17:44:24 +0000 (17:44 +0000)]
[InstCombine] rearrange foldICmpWithDominatingICmp; NFC

Move it out from under the constant check, reorder
predicates, add comments. This makes it easier to
extend to handle the non-constant case.

llvm-svn: 348284

5 years ago[dsymutil] Ensure we're comparing time stamps with the same precision.
Jonas Devlieghere [Tue, 4 Dec 2018 17:15:23 +0000 (17:15 +0000)]
[dsymutil] Ensure we're comparing time stamps with the same precision.

After TimePoint's precision was increased in LLVM we started seeing
failures because the modification times didn't match. This adds a time
cast to ensure that we're comparing TimePoints with the same amount of
precision.

llvm-svn: 348283

5 years ago[X86][SSE] Add SimplifyDemandedBitsForTargetNode handling for MOVMSK
Simon Pilgrim [Tue, 4 Dec 2018 16:52:32 +0000 (16:52 +0000)]
[X86][SSE] Add SimplifyDemandedBitsForTargetNode handling for MOVMSK

Moves existing SimplifyDemandedBits call out of combineMOVMSK and add SimplifyDemandedVectorElts call based on the sign bits we need.

llvm-svn: 348282

5 years ago[AST] Assert that no type class is polymorphic
Bruno Ricci [Tue, 4 Dec 2018 16:36:28 +0000 (16:36 +0000)]
[AST] Assert that no type class is polymorphic

Add a static_assert checking that no type class is polymorphic.
People should use LLVM style RTTI instead.

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

Reviewed By: aaron.ballman

llvm-svn: 348281

5 years agoRevert "Avoid emitting redundant or unusable directories in DIFile metadata entries."
Ilya Biryukov [Tue, 4 Dec 2018 16:30:45 +0000 (16:30 +0000)]
Revert "Avoid emitting redundant or unusable directories in DIFile metadata entries."

This reverts commit r348154 and follow-up commits r348211 and r3248213.
Reason: the original commit broke compiler-rt tests and a follow-up fix
(r348203) broke our integrate and was reverted.

llvm-svn: 348280

5 years agoRevert "Adapt gcov to changes in CFE."
Ilya Biryukov [Tue, 4 Dec 2018 16:30:31 +0000 (16:30 +0000)]
Revert "Adapt gcov to changes in CFE."

This reverts commit r348203.
Reason: this produces absolute paths in .gcno files, breaking us
internally as we rely on them being consistent with the filenames passed
in the command line.

Also reverts r348157 and r348155 to account for revert of r348154 in
clang repository.

llvm-svn: 348279

5 years ago[AST] Assert that no statement/expression class is polymorphic
Bruno Ricci [Tue, 4 Dec 2018 16:04:19 +0000 (16:04 +0000)]
[AST] Assert that no statement/expression class is polymorphic

Add a static_assert checking that no statement/expression class
is polymorphic. People should use LLVM style RTTI instead.

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

Reviewed By: aaron.ballman

llvm-svn: 348278

5 years ago[X86][SSE] Add MOVMSK demandedbits/elts tests
Simon Pilgrim [Tue, 4 Dec 2018 16:01:25 +0000 (16:01 +0000)]
[X86][SSE] Add MOVMSK demandedbits/elts tests

llvm-svn: 348277

5 years ago[AST][NFC] Make ArrayTypeTraitExpr non polymorphic
Bruno Ricci [Tue, 4 Dec 2018 16:01:24 +0000 (16:01 +0000)]
[AST][NFC] Make ArrayTypeTraitExpr non polymorphic

ArrayTypeTraitExpr is the only expression class which is polymorphic.
As far as I can tell this is completely pointless.

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

Reviewed By: aaron.ballman

llvm-svn: 348276

5 years ago[Hexagon] Update builtin definitions
Krzysztof Parzyszek [Tue, 4 Dec 2018 15:47:07 +0000 (15:47 +0000)]
[Hexagon] Update builtin definitions

llvm-svn: 348275

5 years ago[InstCombine] auto-generate full checks for icmp overflow tests; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:41:34 +0000 (15:41 +0000)]
[InstCombine] auto-generate full checks for icmp overflow tests; NFC

llvm-svn: 348274

5 years ago[InstCombine] add helper for icmp with dominator; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:35:17 +0000 (15:35 +0000)]
[InstCombine] add helper for icmp with dominator; NFC

There's a potential small enhancement to this code that could
solve the cases currently under proposal in D54827 via SimplifyCFG.

Whether instcombine should be doing this kind of semi-non-local
analysis in the first place is an open question, but separating
the logic out can only help if/when we decide to move it to a
different pass.

AFAICT, any proposal to do this in SimplifyCFG could also be seen
as an overreach + it would be incomplete to start the fold from a
branch rather than an icmp.

There's another question here about the code for processUGT_ADDCST_ADD().
That part may be completely dead after rL234638 ?

llvm-svn: 348273

5 years ago[OPENMP][NVPTX]Fixed emission of the critical region.
Alexey Bataev [Tue, 4 Dec 2018 15:25:01 +0000 (15:25 +0000)]
[OPENMP][NVPTX]Fixed emission of the critical region.

Critical regions in NVPTX are the constructs, which, generally speaking,
are not supported by the NVPTX target. Instead we're using special
technique to handle the critical regions. Currently they are supported
only within the loop and all the threads in the loop must execute the
same critical region.
Inside of this special regions the regions still must be emitted as
critical, to avoid possible data races between the teams +
synchronization must use __kmpc_barrier functions.

llvm-svn: 348272

5 years ago[OPENMP][NVPTX]Mark __kmpc_barrier functions as convergent.
Alexey Bataev [Tue, 4 Dec 2018 15:03:25 +0000 (15:03 +0000)]
[OPENMP][NVPTX]Mark __kmpc_barrier functions as convergent.

__kmpc_barrier runtime functions must be marked as convergent to prevent
some dangerous optimizations. Also, for NVPTX target all barriers must
be emitted as simple barriers.

llvm-svn: 348271

5 years ago[InstCombine] auto-generate full checks for icmp dominator tests; NFC
Sanjay Patel [Tue, 4 Dec 2018 15:00:35 +0000 (15:00 +0000)]
[InstCombine] auto-generate full checks for icmp dominator tests; NFC

llvm-svn: 348270

5 years ago[Hexagon] Remove unused checker functions from asm parser
Krzysztof Parzyszek [Tue, 4 Dec 2018 14:58:14 +0000 (14:58 +0000)]
[Hexagon] Remove unused checker functions from asm parser

llvm-svn: 348269

5 years agoRemove reference to recently removed PTH Documentation.
Erich Keane [Tue, 4 Dec 2018 14:46:25 +0000 (14:46 +0000)]
Remove reference to recently removed PTH Documentation.

Removed in r348266

Change-Id: Icff0212f57c42ca84ec174ddd4366ae63a7923fa
llvm-svn: 348268

5 years ago[SimpleLoopUnswitch] Remove debug dump.
Alina Sbirlea [Tue, 4 Dec 2018 14:43:24 +0000 (14:43 +0000)]
[SimpleLoopUnswitch] Remove debug dump.

llvm-svn: 348267

5 years agoPTH-- Remove feature entirely-
Erich Keane [Tue, 4 Dec 2018 14:34:09 +0000 (14:34 +0000)]
PTH-- Remove feature entirely-

When debugging a boost build with a modified
version of Clang, I discovered that the PTH implementation
stores TokenKind in 8 bits. However, we currently have 368
TokenKinds.

The result is that the value gets truncated and the wrong token
gets picked up when including PTH files. It seems that this will
go wrong every time someone uses a token that uses the 9th bit.

Upon asking on IRC, it was brought up that this was a highly
experimental features that was considered a failure. I discovered
via googling that BoostBuild (mostly Boost.Math) is the only user of
this
feature, using the CC1 flag directly. I believe that this can be
transferred over to normal PCH with minimal effort:
https://github.com/boostorg/build/issues/367

Based on advice on IRC and research showing that this is a nearly
completely unused feature, this patch removes it entirely.

Note: I considered leaving the build-flags in place and making them
emit an error/warning, however since I've basically identified and
warned the only user, it seemed better to just remove them.

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

Change-Id: If32744275ef1f585357bd6c1c813d96973c4d8d9
llvm-svn: 348266

5 years agoAdd common check prefix. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 14:32:42 +0000 (14:32 +0000)]
Add common check prefix. NFCI.

llvm-svn: 348265

5 years ago[yaml2obj] Move redundant statements into a separate static function
Xing GUO [Tue, 4 Dec 2018 14:27:51 +0000 (14:27 +0000)]
[yaml2obj] Move redundant statements into a separate static function

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: jakehehrlich, llvm-commits

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

llvm-svn: 348264

5 years agoUpdate MemorySSA in SimpleLoopUnswitch.
Alina Sbirlea [Tue, 4 Dec 2018 14:23:37 +0000 (14:23 +0000)]
Update MemorySSA in SimpleLoopUnswitch.

Summary:
Teach SimpleLoopUnswitch to preserve MemorySSA.

Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits

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

llvm-svn: 348263

5 years agoFix "array must be initialized with a brace-enclosed initializer" build error.
Simon Pilgrim [Tue, 4 Dec 2018 14:07:29 +0000 (14:07 +0000)]
Fix "array must be initialized with a brace-enclosed initializer" build error.

Try to fix clang-bpf-build buildbot.

llvm-svn: 348262

5 years agoFix lldb-server unit tests for the MonitoringProcessLauncher refactor
Pavel Labath [Tue, 4 Dec 2018 14:04:27 +0000 (14:04 +0000)]
Fix lldb-server unit tests for the MonitoringProcessLauncher refactor

We now need to initialize the filesystem in these tests.

llvm-svn: 348261

5 years ago[SanitizerCommon] Test `CombinedAllocator::ForEachChunk()` in unit tests.
Dan Liew [Tue, 4 Dec 2018 14:03:55 +0000 (14:03 +0000)]
[SanitizerCommon] Test `CombinedAllocator::ForEachChunk()` in unit tests.

Summary:

Previously we weren't testing this function in the unit tests.

Reviewers: kcc, cryptoad, dvyukov, eugenis, kubamracek

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 348260

5 years ago[GN][NFC] Update readme example to functional command
Martell Malone [Tue, 4 Dec 2018 12:59:22 +0000 (12:59 +0000)]
[GN][NFC] Update readme example to functional command

`ninja -C out/gn check-lld` is not a valid command yet

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

llvm-svn: 348259

5 years ago[ELF] Allow discarding of .rela.plt
Martell Malone [Tue, 4 Dec 2018 12:37:56 +0000 (12:37 +0000)]
[ELF] Allow discarding of .rela.plt

When linking the linux kernel on ppc64le

ld.lld -EL -m elf64lppc -Bstatic --orphan-handling=warn --build-id -o
.tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive
built-in.a --no-whole-archive --start-group lib/lib.a --end-group
ld.lld: error: discarding .rela.plt section is not allowed

The linker script discards with the following matches
*(.glink .iplt .plt .rela* .comment)

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

llvm-svn: 348258

5 years ago[X86][NFC] Add more constant-size memcmp tests.
Clement Courbet [Tue, 4 Dec 2018 12:35:51 +0000 (12:35 +0000)]
[X86][NFC] Add more constant-size memcmp tests.

llvm-svn: 348257

5 years agoFix MSVC "unknown pragma" warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:31:52 +0000 (12:31 +0000)]
Fix MSVC "unknown pragma" warning. NFCI.

llvm-svn: 348256

5 years ago[PPC][PPC64] PPC_REL14 and PPC64_REL14 relocations
Martell Malone [Tue, 4 Dec 2018 12:26:21 +0000 (12:26 +0000)]
[PPC][PPC64] PPC_REL14 and PPC64_REL14 relocations

When linking the linux kernel on ppc64 and ppc
ld.lld: error: unrecognized reloc 11
11 is PPC_REL14 and PPC64_REL14

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

llvm-svn: 348255

5 years agoFix -Wparentheses warning. NFCI.
Simon Pilgrim [Tue, 4 Dec 2018 12:24:10 +0000 (12:24 +0000)]
Fix -Wparentheses warning. NFCI.

llvm-svn: 348254

5 years ago[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.
Simon Pilgrim [Tue, 4 Dec 2018 12:21:43 +0000 (12:21 +0000)]
[X86] Remove unnecessary peekThroughEXTRACT_SUBVECTORs call.

The GetSplatValue/IsSplatVector call will call this anyhow and the later code is just for a v2i64 type so doesn't need it.

llvm-svn: 348253

5 years ago[clangd] Partition include graph on auto-index.
Kadir Cetinkaya [Tue, 4 Dec 2018 11:31:57 +0000 (11:31 +0000)]
[clangd] Partition include graph on auto-index.

Summary:
Partitions include graphs in auto-index so that each shards contains
only part of the include graph related to itself.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 348252

5 years ago[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)
Simon Pilgrim [Tue, 4 Dec 2018 11:21:30 +0000 (11:21 +0000)]
[TargetLowering] expandFP_TO_UINT - avoid FPE due to out of range conversion (PR17686)

PR17686 demonstrates that for some targets FP exceptions can fire in cases where the FP_TO_UINT is expanded using a FP_TO_SINT instruction.

The existing code converts both the inrange and outofrange cases using FP_TO_SINT and then selects the result, this patch changes this for 'strict' cases to pre-select the FP_TO_SINT input and the offset adjustment.

The X87 cases don't need the strict flag but generates much nicer code with it....

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

llvm-svn: 348251

5 years ago[Expr] Fix `TestExprOptions` after r348240 on MacOS X
Aleksandr Urakov [Tue, 4 Dec 2018 11:08:02 +0000 (11:08 +0000)]
[Expr] Fix `TestExprOptions` after r348240 on MacOS X

Summary:
r348240 assumes that an expression contains the Objective C option if
Objective C Runtime is found. But on MacOS X it seems that the test application
process always contains Objective C Runtime, so the test fails when it assumes
that the language is C++ only. Skip this part on Darwin.

llvm-svn: 348250

5 years agoRevert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features
Simon Pilgrim [Tue, 4 Dec 2018 10:55:48 +0000 (10:55 +0000)]
Revert rL348121 from llvm/trunk: [NFC][AArch64] Split out backend features

This patch splits backend features currently
hidden behind architecture versions.

For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.

This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html

Reviewers: DavidSpickett, olista01, t.p.northover

Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio

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

........

This has been causing buildbots failures for the past 24 hours: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386

llvm-svn: 348249

5 years agoRevert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."
George Rimar [Tue, 4 Dec 2018 10:55:03 +0000 (10:55 +0000)]
Revert r348243 "[llvm-mc] - Do not crash when referencing undefined debug sections."

It broke msan and asan bots it seems:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/20993/steps/ninja%20check%201/logs/stdio

llvm-svn: 348248

5 years ago[SystemZ] Do not support __float128
Ulrich Weigand [Tue, 4 Dec 2018 10:51:36 +0000 (10:51 +0000)]
[SystemZ] Do not support __float128

As of rev. 268898, clang supports __float128 on SystemZ.  This seems to
have been in error.  GCC has never supported __float128 on SystemZ,
since the "long double" type on the platform is already IEEE-128. (GCC
only supports __float128 on platforms where "long double" is some other
data type.)

For compatibility reasons this patch removes __float128 on SystemZ
again.  The test case is updated accordingly.

llvm-svn: 348247

5 years ago[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes
Simon Pilgrim [Tue, 4 Dec 2018 10:41:06 +0000 (10:41 +0000)]
[TargetLowering] Add SimplifyDemandedVectorElts support to EXTEND opcodes

Add support for ISD::*_EXTEND and ISD::*_EXTEND_VECTOR_INREG opcodes.

The extra broadcast in trunc-subvector.ll will be fixed in an upcoming patch.

llvm-svn: 348246

5 years ago[Analyzer] Iterator Checker - Forbid decrements past the begin() and increments past...
Adam Balogh [Tue, 4 Dec 2018 10:27:27 +0000 (10:27 +0000)]
[Analyzer] Iterator Checker - Forbid decrements past the begin() and increments past the end() of containers

Previously, the iterator range checker only warned upon dereferencing of
iterators outside their valid range as well as increments and decrements of
out-of-range iterators where the result remains out-of-range. However, the C++
standard is more strict than this: decrementing begin() or incrementing end()
results in undefined behaviour even if the iterator is not dereferenced
afterwards. Coming back to the range once out-of-range is also undefined.

This patch corrects the behaviour of the iterator range checker: warnings are
given for any operation whose result is ahead of begin() or past the end()
(which is the past-end iterator itself, thus now we are speaking of past
past-the-end).

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

llvm-svn: 348245

5 years ago[Analyzer] Iterator Checkers - Use the region of the topmost base class for iterators...
Adam Balogh [Tue, 4 Dec 2018 10:22:28 +0000 (10:22 +0000)]
[Analyzer] Iterator Checkers - Use the region of the topmost base class for iterators stored in a region

If an iterator is represented by a derived C++ class but its comparison operator
is for its base the iterator checkers cannot recognize the iterators compared.
This results in false positives in very straightforward cases (range error when
dereferencing an iterator after disclosing that it is equal to the past-the-end
iterator).

To overcome this problem we always use the region of the topmost base class for
iterators stored in a region. A new method called getMostDerivedObjectRegion()
was added to the MemRegion class to get this region.

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

llvm-svn: 348244

5 years ago[llvm-mc] - Do not crash when referencing undefined debug sections.
George Rimar [Tue, 4 Dec 2018 10:10:50 +0000 (10:10 +0000)]
[llvm-mc] - Do not crash when referencing undefined debug sections.

MC has code that pre-creates few debug sections:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396

If users code has a reference to such section but does not redefine it,
MC code currently asserts, because still thinks they are normally defined.

The patch fixes the issue.

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

llvm-svn: 348243

5 years ago[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.
George Rimar [Tue, 4 Dec 2018 10:01:39 +0000 (10:01 +0000)]
[llvm-dwarfdump] - Dump the older versions of .eh_frame/.debug_frame correctly.

The issue is the following.

DWARF 2 used version 1 for .debug_frame.
(Appendix G, p. 416 http://dwarfstd.org/doc/DWARF5.pdf)

lib/MC now always sets version 1 for .eh_frame (and sets 1-4 versions for .debug_frame correctly):
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1530
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1562
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCDwarf.cpp#L1602

In version 1, return_address_register was defined as ubyte, while other versions
switched to uleb128.
(p 62, http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf)

Patch teaches llvm-dwarfdump about this difference.

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

llvm-svn: 348242

5 years agoExtend test for DependentSizedArrayType
Stephen Kelly [Tue, 4 Dec 2018 09:53:36 +0000 (09:53 +0000)]
Extend test for DependentSizedArrayType

Use a using declaration to force the type to appear in the -ast-dump
output.

llvm-svn: 348241

5 years ago[Expr] Check the language before ignoring Objective C keywords
Aleksandr Urakov [Tue, 4 Dec 2018 09:51:29 +0000 (09:51 +0000)]
[Expr] Check the language before ignoring Objective C keywords

Summary:
This patch adds the check of the language before ignoring names like `id` or
`Class`, which are reserved in Objective C, but are allowed in C++. It is needed
to make it possible to evaluate expressions in a C++ program containing names
like `id` or `Class`.

Reviewers: jingham, zturner, labath, clayborg

Reviewed By: jingham, clayborg

Tags: #lldb

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

llvm-svn: 348240

5 years ago[WIP][Sema] Improve static_assert diagnostics for type traits.
Clement Courbet [Tue, 4 Dec 2018 07:59:57 +0000 (07:59 +0000)]
[WIP][Sema] Improve static_assert diagnostics for type traits.

Summary:
In our codebase, `static_assert(std::some_type_trait<Ts...>::value, "msg")`
(where `some_type_trait` is an std type_trait and `Ts...` is the
appropriate template parameters) account for 11.2% of the `static_assert`s.

In these cases, the `Ts` are typically not spelled out explicitly, e.g.
`static_assert(std::is_same<SomeT::TypeT, typename SomeDependentT::value_type>::value, "message");`

The diagnostic when the assert fails is typically not very useful, e.g.
`static_assert failed due to requirement 'std::is_same<SomeT::TypeT, typename SomeDependentT::value_type>::value' "message"`

This change makes the diagnostic spell out the types explicitly , e.g.
`static_assert failed due to requirement 'std::is_same<int, float>::value' "message"`

See tests for more examples.

After this is submitted, I intend to handle
`static_assert(!std::some_type_trait<Ts...>::value, "msg")`,
which is another 6.6% of static_asserts.

Subscribers: cfe-commits

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

llvm-svn: 348239

5 years agoRemove unnecessary include.
Richard Trieu [Tue, 4 Dec 2018 04:53:18 +0000 (04:53 +0000)]
Remove unnecessary include.

llvm-svn: 348238

5 years ago[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.
Craig Topper [Tue, 4 Dec 2018 04:51:07 +0000 (04:51 +0000)]
[X86] Remove custom DAG combine for SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG.

We only needed this because it provided really aggressive constant folding even through constant pool entries created from build_vectors. The main case was for vXi8 MULH legalization which was happening as part of legalize DAG instead of as part of legalize vector ops. Now its part of vector op legalization and we've added special handling for build vectors of all constants there. This has removed the need for this code on the list tests we have.

llvm-svn: 348237

5 years ago[compiler-rt] Use the new zx_futex_wait for Fuchsia sanitizer runtime
Petr Hosek [Tue, 4 Dec 2018 04:07:43 +0000 (04:07 +0000)]
[compiler-rt] Use the new zx_futex_wait for Fuchsia sanitizer runtime

This finishes the soft-transition to the new primitive that implements
priority inheritance.

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

llvm-svn: 348236

5 years ago[analyzer] MoveChecker: Add more common state resetting methods.
Artem Dergachev [Tue, 4 Dec 2018 03:38:08 +0000 (03:38 +0000)]
[analyzer] MoveChecker: Add more common state resetting methods.

Includes "resize" and "shrink" because they can reset the object to a known
state in certain circumstances.

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

llvm-svn: 348235

5 years ago[Sema] Provide -fvisibility-global-new-delete-hidden option
Petr Hosek [Tue, 4 Dec 2018 03:25:25 +0000 (03:25 +0000)]
[Sema] Provide -fvisibility-global-new-delete-hidden option

When the global new and delete operators aren't declared, Clang
provides and implicit declaration, but this declaration currently
always uses the default visibility. This is a problem when the
C++ library itself is being built with non-default visibility because
the implicit declaration will force the new and delete operators to
have the default visibility unlike the rest of the library.

The existing workaround is to use assembly to enforce the visiblity:
https://fuchsia.googlesource.com/zircon/+/master/system/ulib/zxcpp/new.cpp#108
but that solution is not always available, e.g. in the case of of
libFuzzer which is using an internal version of libc++ that's also built
with -fvisibility=hidden where the existing behavior is causing issues.

This change introduces a new option -fvisibility-global-new-delete-hidden
which makes the implicit declaration of the global new and delete
operators hidden.

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

llvm-svn: 348234

5 years agoFix -Wmismatched-tags to not warn on redeclarations of structs in system
Richard Smith [Tue, 4 Dec 2018 02:45:28 +0000 (02:45 +0000)]
Fix -Wmismatched-tags to not warn on redeclarations of structs in system
headers.

Previously, we would only check whether the new declaration is in a
system header, but that requires the user to be able to correctly guess
whether a declaration in a system header is declared as a struct or a
class when specializing standard library traits templates.

We now entirely ignore declarations for which the warning was disabled
when determining whether to warn on a tag mismatch.

Also extend the diagnostic message to clarify that
 a) code containing such a tag mismatch is in fact valid and correct,
    and
 b) the (non-coding-style) reason to emit such a warning is that the
    Microsoft C++ ABI is broken and includes the tag kind in decorated
    names,
as it seems a lot of users are confused by our diagnostic here (either
not understanding why we produce it, or believing that it represents an
actual language rule).

llvm-svn: 348233

5 years ago[PlatformDarwin] Simplify logic and use FileSystem
Jonas Devlieghere [Tue, 4 Dec 2018 02:23:16 +0000 (02:23 +0000)]
[PlatformDarwin] Simplify logic and use FileSystem

Simplify code path by using the FileSystem.

llvm-svn: 348232

5 years agoImprove the regerror(3) interceptor
Kamil Rytarowski [Tue, 4 Dec 2018 02:18:18 +0000 (02:18 +0000)]
Improve the regerror(3) interceptor

The res returned value might differ with REAL(strlen)(errbuf) + 1,
as the buffer's value is limited with errbuf_size.

Hot fix for D54584.

llvm-svn: 348231

5 years agoReverting r348215
Ranjeet Singh [Tue, 4 Dec 2018 02:03:53 +0000 (02:03 +0000)]
Reverting r348215

Causing failures on ubsan buildbot boxes.

llvm-svn: 348230

5 years ago[analyzer] MoveChecker: Improve warning and note messages.
Artem Dergachev [Tue, 4 Dec 2018 02:00:29 +0000 (02:00 +0000)]
[analyzer] MoveChecker: Improve warning and note messages.

The warning piece traditionally describes the bug itself, i.e.
"The bug is a _____", eg. "Attempt to delete released memory",
"Resource leak", "Method call on a moved-from object".

Event pieces produced by the visitor are usually in a present tense, i.e.
"At this moment _____": "Memory is released", "File is closed",
"Object is moved".

Additionally, type information is added into the event pieces for STL objects
(in order to highlight that it is in fact an STL object), and the respective
event piece now mentions that the object is left in an unspecified state
after it was moved, which is a vital piece of information to understand the bug.

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

llvm-svn: 348229

5 years agoAdd interceptors for the sysctl(3) API family from NetBSD
Kamil Rytarowski [Tue, 4 Dec 2018 01:51:06 +0000 (01:51 +0000)]
Add interceptors for the sysctl(3) API family from NetBSD

Summary:
Add new interceptors for:

 - sysctl
 - sysctlbyname
 - sysctlgetmibinfo
 - sysctlnametomib
 - asysctl
 - asysctlbyname

Cover the API with a new test file TestCases/NetBSD/sysctl.cc.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: devnexen, kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348228

5 years agoAdd interceptors for the fts(3) API family from NetBSD
Kamil Rytarowski [Tue, 4 Dec 2018 01:45:52 +0000 (01:45 +0000)]
Add interceptors for the fts(3) API family from NetBSD

Summary:
fts(3) is API to traverse a file hierarchy.
Cover this interface with interceptors.

Add a test to validate the interface reading
the number of regular files in /etc.

Based on original work by Yang Zheng.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348227

5 years ago[TableGen] Improve the formatting of the emitted predicates (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:22 +0000 (01:43 +0000)]
[TableGen] Improve the formatting of the emitted predicates (NFC)

llvm-svn: 348226

5 years ago[TableGen] Fix typo in emitted comment (NFC)
Evandro Menezes [Tue, 4 Dec 2018 01:43:19 +0000 (01:43 +0000)]
[TableGen] Fix typo in emitted comment (NFC)

llvm-svn: 348225

5 years agoAdd new interceptor for regex(3) in NetBSD
Kamil Rytarowski [Tue, 4 Dec 2018 01:41:42 +0000 (01:41 +0000)]
Add new interceptor for regex(3) in NetBSD

Summary:
Add interceptors for the NetBSD style of regex(3) present inside libc:

 - regcomp
 - regexec
 - regerror
 - regfree
 - regnsub
 - regasub

Add a dedicated test verifying the installed interceptors.

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348224

5 years ago[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.
Lang Hames [Tue, 4 Dec 2018 00:55:15 +0000 (00:55 +0000)]
[ExecutionEngine] Change NotifyObjectEmitted/NotifyObjectFreed API.

This patch renames both methods (NotifyObjectEmitted -> notifyObjectLoaded, and
NotifyObjectFreed -> notifyObjectFreed), adds an abstract "ObjectKey" (uint64_t)
parameter to notifyObjectLoaded, and replaces the ObjectFile parameter for
notifyObjectFreed with an ObjectKey. Using an ObjectKey to track identify
events, rather than a reference to the ObjectFile, allows us to free the
ObjectFile after notifyObjectLoaded is called, saving memory.

https://reviews.llvm.org/D53773

llvm-svn: 348223

5 years ago[ARM64][Windows] Fix local stack size for funclets
Sanjin Sijaric [Tue, 4 Dec 2018 00:54:52 +0000 (00:54 +0000)]
[ARM64][Windows] Fix local stack size for funclets

The comment was misplaced, and the code didn't do what the comment indicated,
namely ignoring the varargs portion when computing the local stack size of a
funclet in emitEpilogue.  This results in incorrect offset computations within
funclets that are contained in vararg functions.

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

llvm-svn: 348222

5 years ago[asan] Reduce binary size by using unnamed private aliases
Vitaly Buka [Tue, 4 Dec 2018 00:36:14 +0000 (00:36 +0000)]
[asan] Reduce binary size by using unnamed private aliases

Summary:
--asan-use-private-alias increases binary sizes by 10% or more.
Most of this space was long names of aliases and new symbols.
These symbols are not needed for the ODC check at all.

Reviewers: eugenis

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 348221

5 years ago[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo
Jessica Paquette [Tue, 4 Dec 2018 00:31:55 +0000 (00:31 +0000)]
[MachineOutliner] Move stack instr check logic to getOutliningCandidateInfo

This moves the stack check logic into a lambda within getOutliningCandidateInfo.

This allows us to be less conservative with stack checks. Whether or not a
stack instruction is safe to outline is dependent on the frame variant and call
variant of the outlined function; only in cases where we modify the stack can
these be unsafe.

So, if we move that logic later, when we're looking at an individual candidate,
we can make better decisions here.

This gives some code size savings as a result.

llvm-svn: 348220

5 years ago[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic
Jessica Paquette [Tue, 4 Dec 2018 00:31:47 +0000 (00:31 +0000)]
[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic

If we dropped too many candidates to be beneficial when dropping candidates
that modify the stack, there's no reason to check for other cost model
qualities.

llvm-svn: 348219

5 years agoNFC: Make this test kinder on downstream forks
Erik Pilkington [Tue, 4 Dec 2018 00:31:31 +0000 (00:31 +0000)]
NFC: Make this test kinder on downstream forks

Downstream forks that have their own attributes often run into this
test failing when a new attribute is added to clang because the
number of supported attributes no longer match. This is redundant
information for this test, so we can get by without it.

rdar://46288577

llvm-svn: 348218