platform/upstream/llvm.git
5 years ago[Support] Implement llvm::Registry::iterator via llvm_iterator_facade
Ilya Biryukov [Fri, 18 Jan 2019 17:30:49 +0000 (17:30 +0000)]
[Support] Implement llvm::Registry::iterator via llvm_iterator_facade

Summary:
Among other things, this allows using STL algorithms like 'find_if' over
llvm::Registry.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: kristina, llvm-commits

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

llvm-svn: 351566

5 years ago[clang][slh] add Clang attr no_speculative_load_hardening
Zola Bridges [Fri, 18 Jan 2019 17:20:46 +0000 (17:20 +0000)]
[clang][slh] add Clang attr no_speculative_load_hardening

Summary:
This attribute will allow users to opt specific functions out of
speculative load hardening. This compliments the Clang attribute
named speculative_load_hardening. When this attribute or the attribute
speculative_load_hardening is used in combination with the flags
-mno-speculative-load-hardening or -mspeculative-load-hardening,
the function level attribute will override the default during LLVM IR
generation. For example, in the case, where the flag opposes the
function attribute, the function attribute will take precendence.
The sticky inlining behavior of the speculative_load_hardening attribute
may cause a function with the no_speculative_load_hardening attribute
to be tagged with the speculative_load_hardening tag in
subsequent compiler phases which is desired behavior since the
speculative_load_hardening LLVM attribute is designed to be maximally
conservative.

If both attributes are specified for a function, then an error will be
thrown.

Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman

Subscribers: llvm-commits

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

llvm-svn: 351565

5 years agoMake sure to fill in the compiler register number so when we try to backtrace using...
Greg Clayton [Fri, 18 Jan 2019 17:06:01 +0000 (17:06 +0000)]
Make sure to fill in the compiler register number so when we try to backtrace using EH frame, it works.

Prior to this, backtraces could fail due to not being able to convert a EH frame register number to LLDB register number.

llvm-svn: 351564

5 years ago[clangd] Make background index less chatty
Ilya Biryukov [Fri, 18 Jan 2019 17:04:26 +0000 (17:04 +0000)]
[clangd] Make background index less chatty

Summary:
It is producing too much input in non-verbose mode,
i.e. a message per indexed file

Reviewers: sammccall, kadircet

Reviewed By: sammccall

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

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

llvm-svn: 351563

5 years ago[AMDGPU] Add some missing always-uniform values.
Neil Henning [Fri, 18 Jan 2019 16:39:27 +0000 (16:39 +0000)]
[AMDGPU] Add some missing always-uniform values.

This commit adds some missing intrinsics into the isAlwaysUniform list
for the AMDGPU backend.

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

llvm-svn: 351562

5 years agoRevert "Clang side support for @cc assembly operands."
Nirav Dave [Fri, 18 Jan 2019 16:03:08 +0000 (16:03 +0000)]
Revert "Clang side support for @cc assembly operands."

llvm-svn: 351561

5 years ago[LTO] Change test/tools/lto/no-bitcode.s requirement from arm to aarch64
Simon Pilgrim [Fri, 18 Jan 2019 15:57:59 +0000 (15:57 +0000)]
[LTO] Change test/tools/lto/no-bitcode.s requirement from arm to aarch64

Set the test to properly require aarch64 instead of arm. Otherwise, this test fails with LLVM_TARGETS_TO_BUILD='ARM;X86'

bin/llvm-mc: : error: unable to get target for 'arm64-apple-ios7.0.0'

Committed on behalf of @easyaspi314 (Devin)

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

llvm-svn: 351560

5 years agoClang side support for @cc assembly operands.
Nirav Dave [Fri, 18 Jan 2019 15:57:23 +0000 (15:57 +0000)]
Clang side support for @cc assembly operands.

llvm-svn: 351559

5 years ago[SelectionDAGBuilder] Cleanup InlineAsm Output generation. NFCI.
Nirav Dave [Fri, 18 Jan 2019 15:57:13 +0000 (15:57 +0000)]
[SelectionDAGBuilder] Cleanup InlineAsm Output generation. NFCI.

Defer inline asm's output fixup work until after we've generated the
inline asm node itself. Remove StoresToEmit, IndirectStoresToEmit, and
RetValRegs in favor of using ConstraintOperands.

llvm-svn: 351558

5 years ago[x86] simplify code for SDValue.getOperand(); NFC
Sanjay Patel [Fri, 18 Jan 2019 15:55:21 +0000 (15:55 +0000)]
[x86] simplify code for SDValue.getOperand(); NFC

llvm-svn: 351557

5 years agoRevert r351529 "[llvm-objdump][NFC] Improve readability."
Clement Courbet [Fri, 18 Jan 2019 15:26:14 +0000 (15:26 +0000)]
Revert r351529 "[llvm-objdump][NFC] Improve readability."

msan errors in ELF/strip-all.s.

llvm-svn: 351556

5 years ago[AMDGPU][MC][GFX8+][DISASSEMBLER] Corrected 1/2pi value for 64-bit operands
Dmitry Preobrazhensky [Fri, 18 Jan 2019 15:17:17 +0000 (15:17 +0000)]
[AMDGPU][MC][GFX8+][DISASSEMBLER] Corrected 1/2pi value for 64-bit operands

See bug 39332: https://bugs.llvm.org/show_bug.cgi?id=39332

Reviewers: artem.tamazov, arsenm

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

llvm-svn: 351555

5 years ago[TTI] Use ConcreteTTI cast in getIntrinsicInstrCost Type variant. NFCI.
Simon Pilgrim [Fri, 18 Jan 2019 14:48:36 +0000 (14:48 +0000)]
[TTI] Use ConcreteTTI cast in getIntrinsicInstrCost Type variant. NFCI.

Same as we do in the Value variant.

llvm-svn: 351554

5 years agoReland r351529 "[llvm-objdump][NFC] Improve readability."
Clement Courbet [Fri, 18 Jan 2019 14:20:13 +0000 (14:20 +0000)]
Reland r351529 "[llvm-objdump][NFC] Improve readability."

`SectionSymbol*` is cast from `void*` to
`std::tuple<uint64_t, StringRef, uint8_t>` in AMDGPUSymbolizer, so it has to
*be* one, not *act like* one.

llvm-svn: 351553

5 years ago[SelectionDAG] Add getTokenFactor, which splits nodes with > 64k operands.
Florian Hahn [Fri, 18 Jan 2019 14:05:59 +0000 (14:05 +0000)]
[SelectionDAG] Add getTokenFactor, which splits nodes with > 64k operands.

This functionality is required at multiple places which potentially
create large operand lists, like SelectionDAGBuilder or DAGCombiner.

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

llvm-svn: 351552

5 years agoAdd __[_[_]]Z demangling to new common demangle function
James Henderson [Fri, 18 Jan 2019 13:58:41 +0000 (13:58 +0000)]
Add __[_[_]]Z demangling to new common demangle function

This is a follow-up to r351448. It adds support for other _*Z extensions
of the Itanium demanling, to the newly available demangle function
heuristic.

Reviewed by: erik.pilkington, rupprecht, grimar

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

llvm-svn: 351551

5 years agoFix test failure from r351495
Erich Keane [Fri, 18 Jan 2019 13:58:10 +0000 (13:58 +0000)]
Fix test failure from r351495

The test has problems due to some platforms having a different type for
ptrdiff_t, so the error message is different.  The error message doesn't
matter to the test for anything other than an incompatible intger to
pointer conversion, so this patch removes the integral type from the
expected message.

Change-Id: I80e786f9b80268163813774bbf25a9ca25b6c60c
llvm-svn: 351550

5 years ago[AMDGPU][MC] Disabled use of 2 different literals with SOP2/SOPC instructions
Dmitry Preobrazhensky [Fri, 18 Jan 2019 13:57:43 +0000 (13:57 +0000)]
[AMDGPU][MC] Disabled use of 2 different literals with SOP2/SOPC instructions

See bug 39319: https://bugs.llvm.org/show_bug.cgi?id=39319

Reviewers: artem.tamazov, arsenm, rampitec

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

llvm-svn: 351549

5 years ago[ADT] Add streaming operators for llvm::Optional
Pavel Labath [Fri, 18 Jan 2019 12:52:03 +0000 (12:52 +0000)]
[ADT] Add streaming operators for llvm::Optional

Summary:
The operators simply print the underlying value or "None".

The trickier part of this patch is making sure the streaming operators
work even in unit tests (which was my primary motivation, though I can
also see them being useful elsewhere). Since the stream operator was a
template, implicit conversions did not kick in, and our gtest glue code
was explicitly introducing an implicit conversion to make sure other
implicit conversions do not kick in :P. I resolve that by specializing
llvm_gtest::StreamSwitch for llvm:Optional<T>.

Reviewers: sammccall, dblaikie

Reviewed By: sammccall

Subscribers: mgorny, dexonsmith, kristina, llvm-commits

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

llvm-svn: 351548

5 years ago[llvm-objdump] - Dump the archive headers when -all-headers is specified.
George Rimar [Fri, 18 Jan 2019 12:01:59 +0000 (12:01 +0000)]
[llvm-objdump] - Dump the archive headers when -all-headers is specified.

When -all-headers is given it is supposed to dump all headers,
but now it skips the archive headers for no reason.

The patch fixes that.

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

llvm-svn: 351547

5 years ago[OpenCL] Fix overloading ranking rules for addrspace conversions.
Anastasia Stulova [Fri, 18 Jan 2019 11:38:16 +0000 (11:38 +0000)]
[OpenCL] Fix overloading ranking rules for addrspace conversions.

Extend ranking to work with address spaces correctly when
resolving overloads.

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

llvm-svn: 351546

5 years ago[llvm-objdump] - Move getRelocationValueString and dependenices out of the llvm-objdu...
George Rimar [Fri, 18 Jan 2019 11:33:26 +0000 (11:33 +0000)]
[llvm-objdump] - Move getRelocationValueString and dependenices out of the llvm-objdump.cpp

getRelocationValueString is a dispatcher function that calls the
corresponding ELF/COFF/Wasm/MachO implementations
that currently live in the llvm-objdump.cpp file.

These implementations better be moved to ELFDump.cpp,
COFFDump.cpp and other corresponding files, to move platform specific
implementation out from the common logic.

The patch does that. Also, I had to move ToolSectionFilter helper
and SectionFilterIterator, SectionFilter to a header to make them
available across the objdump code.

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

llvm-svn: 351545

5 years ago[AVR] Fix codegen bug in 16-bit loads
Dylan McKay [Fri, 18 Jan 2019 11:27:38 +0000 (11:27 +0000)]
[AVR] Fix codegen bug in 16-bit loads

Prior to this patch, the AVR::LDWRdPtr instruction was always lowered to
instructions of this pattern:

    ld  $GPR8, [PTR:XYZ]+
    ld  $GPR8, [PTR]+1

This has a problem; the [PTR] is incremented in-place once, but never
decremented.

Future uses of the same pointer will use the now clobbered value,
leading to the pointer being incorrect by an offset of one.

This patch modifies the expansion code of the LDWRdPtr pseudo
instruction so that the pointer variable is not silently clobbered in
future uses in the same live range.

Patch by Keshav Kini.

llvm-svn: 351544

5 years ago[llvm-objdump] - Show aliases in -help.
George Rimar [Fri, 18 Jan 2019 10:41:26 +0000 (10:41 +0000)]
[llvm-objdump] - Show aliases in -help.

Currently llvm-objdump is inconsistent.

When -help is specified it shows no aliases except two.
Aliases are shown with -help-hidden though.
GNU objdump also prints them by default.

This patch does a change to always show all aliases
when -help is given.

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

llvm-svn: 351542

5 years agoBreakpad: Extract parsing code into a separate file
Pavel Labath [Fri, 18 Jan 2019 10:37:04 +0000 (10:37 +0000)]
Breakpad: Extract parsing code into a separate file

Summary:
This centralizes parsing of breakpad records, which was previously
spread out over ObjectFileBreakpad and SymbolFileBreakpad.

For each record type X there is a separate breakpad::XRecord class, and
an associated parse function. The classes just store the information in
the breakpad records in a more accessible form. It is up to the users to
determine what to do with that data.

This separation also made it possible to write some targeted tests for
the parsing code, which was previously unaccessible, so I write a couple
of those too.

Reviewers: clayborg, lemo, zturner

Reviewed By: clayborg

Subscribers: mgorny, fedor.sergeev, lldb-commits

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

llvm-svn: 351541

5 years ago[analyzer] Unbreak building of SymbolReaperTest true BUILD_SHARED_LIBS=True
Alex Bradbury [Fri, 18 Jan 2019 10:13:07 +0000 (10:13 +0000)]
[analyzer] Unbreak building of SymbolReaperTest true BUILD_SHARED_LIBS=True

Extra dependencies need to be listed for StaticAnalysisTests in order for
linking to succeed when BUILD_SHARED_LIBS=True.

llvm-svn: 351540

5 years ago[AVR] Fix the inst-cbr test
Dylan McKay [Fri, 18 Jan 2019 10:11:33 +0000 (10:11 +0000)]
[AVR] Fix the inst-cbr test

Now that the CBR alias has lower priority than ANDI, the assembly
printer uses ANDI instead.

Original broken in r351526.

llvm-svn: 351539

5 years ago[SelectionDAG] Add static getMaxNumOperands function to SDNode.
Florian Hahn [Fri, 18 Jan 2019 10:00:38 +0000 (10:00 +0000)]
[SelectionDAG] Add static getMaxNumOperands function to SDNode.

Summary:
Use this helper to make sure we use the same value at various places.
This will likely be needed at more places were we currently crash
because we use more operands than possible.

Also makes it easier to change in the future.

Reviewers: RKSimon, craig.topper, efriedma, aemerson

Reviewed By: RKSimon

Subscribers: hiraditya, arsenm, llvm-commits

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

llvm-svn: 351537

5 years agoRevert r351529 "[llvm-objdump][NFC] Improve readability."
Clement Courbet [Fri, 18 Jan 2019 09:40:19 +0000 (09:40 +0000)]
Revert r351529 "[llvm-objdump][NFC] Improve readability."

Breaks labels-branch.s

llvm-svn: 351534

5 years ago[tooling] Add a new argument adjuster for deleting plugin related command line args
Kadir Cetinkaya [Fri, 18 Jan 2019 09:00:31 +0000 (09:00 +0000)]
[tooling] Add a new argument adjuster for deleting plugin related command line args

Summary:
Currently both clangd and clang-tidy makes use of this mechanism so
putting it into tooling so that all tools can make use of it.

Reviewers: ilya-biryukov, sammccall

Subscribers: ioeric, cfe-commits

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

llvm-svn: 351531

5 years ago[llvm-objdump][NFC] Improve readability.
Clement Courbet [Fri, 18 Jan 2019 08:59:39 +0000 (08:59 +0000)]
[llvm-objdump][NFC] Improve readability.

Summary:
Introduce a `struct SectionSymbol` instead of
`tuple<uint64_t, StringRef, uint8>`.

Reviewers: jhenderson, davide

Subscribers: rupprecht, llvm-commits

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

llvm-svn: 351529

5 years agoFix failing MSan bots
Vlad Tsyrklevich [Fri, 18 Jan 2019 08:43:22 +0000 (08:43 +0000)]
Fix failing MSan bots

Revert r351508-351514, this block of changes introduced a consistent
MSan failure on the sanitizer bots.

llvm-svn: 351528

5 years ago[ScheduleDAGRRList] Do not preschedule the node has ADJCALLSTACKDOWN parent
Shiva Chen [Fri, 18 Jan 2019 08:36:06 +0000 (08:36 +0000)]
[ScheduleDAGRRList] Do not preschedule the node has ADJCALLSTACKDOWN parent

We should not pre-scheduled the node has ADJCALLSTACKDOWN parent,
or else, when bottom-up scheduling, ADJCALLSTACKDOWN and
ADJCALLSTACKUP may hold CallResource too long and make other
calls can't be scheduled. If there's no other available node
to schedule, the scheduler will try to rename the register by
creating copy to avoid the conflict which will fail because
CallResource is not a real physical register.

llvm-svn: 351527

5 years ago[AVR] Rewrite the CBRRdK instruction as an alias of ANDIRdK
Dylan McKay [Fri, 18 Jan 2019 07:31:34 +0000 (07:31 +0000)]
[AVR] Rewrite the CBRRdK instruction as an alias of ANDIRdK

The CBR instruction is just an ANDI instruction with the immediate
complemented.

Because of this, prior to this change TableGen would warn due to a
decoding conflict.

This commit fixes the existing compilation warning:

  ===============
  [423/492] Building AVRGenDisassemblerTables.inc...
  Decoding Conflict:
                  0111............
                  01..............
                  ................
          ANDIRdK 0111____________
          CBRRdK 0111____________
  ================

After this commit, there are no more decoding conflicts in the AVR
backend's instruction definitions.

Thanks to Eli F for pointing me torward `t2_so_imm_not` as an example of
how to perform a complement in an instruction alias.

Fixes BugZilla PR38802.

llvm-svn: 351526

5 years ago[CodeGen] Fix bugs in LiveDebugVariables when debug labels are generated.
Hsiangkai Wang [Fri, 18 Jan 2019 07:17:09 +0000 (07:17 +0000)]
[CodeGen] Fix bugs in LiveDebugVariables when debug labels are generated.

Remove DBG_LABELs in LiveDebugVariables and generate them in
VirtRegRewriter.

This bug is reported in
https://bugs.chromium.org/p/chromium/issues/detail?id=898152.

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

llvm-svn: 351525

5 years ago[Reproducers] Fix reproducers unittest.
Jonas Devlieghere [Fri, 18 Jan 2019 07:17:05 +0000 (07:17 +0000)]
[Reproducers] Fix reproducers unittest.

Fix fallout from r351501 in the reproducer unittest.

llvm-svn: 351524

5 years ago[AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL
Dylan McKay [Fri, 18 Jan 2019 06:10:41 +0000 (06:10 +0000)]
[AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL

This change modifies the LLVM ISel lowering settings so that
8-bit/16-bit multiplication is expanded to calls into the compiler
runtime library if the MCU being targeted does not support
multiplication in hardware.

Before this, MUL instructions would be generated on CPUs like the
ATtiny85, triggering a CPU reset due to an illegal instruction at
runtime.

First raised in https://github.com/avr-rust/rust/issues/124.

llvm-svn: 351523

5 years ago[X86] Add test cases showing failure to fold a global variable address into the gathe...
Craig Topper [Fri, 18 Jan 2019 06:06:03 +0000 (06:06 +0000)]
[X86] Add test cases showing failure to fold a global variable address into the gather addressing mode when using the target specific intrinsics. NFC

llvm-svn: 351522

5 years ago[X86] Change avx512-gather-scatter-intrin.ll to use x86_64-unknown-unknown instead...
Craig Topper [Fri, 18 Jan 2019 06:06:01 +0000 (06:06 +0000)]
[X86] Change avx512-gather-scatter-intrin.ll to use x86_64-unknown-unknown instead of x86_64-apple-darwin. NFC

Will help with an upcoming patch.

llvm-svn: 351521

5 years agoRe-enable terminator folding in LoopSimplifyCFG: underlying bugs fixed
Max Kazantsev [Fri, 18 Jan 2019 04:57:32 +0000 (04:57 +0000)]
Re-enable terminator folding in LoopSimplifyCFG: underlying bugs fixed

llvm-svn: 351520

5 years agogn build: unbreak mac (and maybe win) after r351258, r351277
Nico Weber [Fri, 18 Jan 2019 04:09:30 +0000 (04:09 +0000)]
gn build: unbreak mac (and maybe win) after r351258, r351277

The check-hwasan build files assert that current_os == "linux" || current_os ==
"android", so pull it in only there.

ar is unused on mac, so don't set it in the stage2 toolchain. (It'd be nicer to
use llvm-libtool on mac instead of host libtool, but llvm-libtool doesn't seem
to understand the -no_warning_for_no_symbols flag.)

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

llvm-svn: 351519

5 years ago[PSTL] Convert license text file to use unix line endings, matching the
Chandler Carruth [Fri, 18 Jan 2019 03:57:39 +0000 (03:57 +0000)]
[PSTL] Convert license text file to use unix line endings, matching the
other licenses in the LLVM project.

llvm-svn: 351518

5 years ago[DOCS] it it => it
Xing GUO [Fri, 18 Jan 2019 03:56:37 +0000 (03:56 +0000)]
[DOCS] it it => it

Summary: it it => it for LLVM Language Reference Manual

Reviewers: aaron.ballman, Higuoxing, liangdzou

Reviewed By: aaron.ballman, Higuoxing, liangdzou

Subscribers: Higuoxing, llvm-commits

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

llvm-svn: 351517

5 years agogn build: Merge r351499
Nico Weber [Fri, 18 Jan 2019 03:38:53 +0000 (03:38 +0000)]
gn build: Merge r351499

llvm-svn: 351516

5 years agomac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF
Nico Weber [Fri, 18 Jan 2019 03:36:04 +0000 (03:36 +0000)]
mac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF

llvm/tools sets LLVM_TOOL_LTO_BUILD to Off if LLVM_ENABLE_PIC=OFF, but that's
not visible in llvm/test.

r289662 added the llvm_tool_lto_build lit parameter, there the intent was to
use it with an explicit -DLLVM_TOOL_LTO_BUILD=OFF, which is visible globally.
On the review for that (D27739), a mild preference was expressed for using a
lit parameter over checking the existence of libLTO.dylib. Since that works
with the LLVM_ENABLE_PIC=OFF case too and since it matches what we do for the
gold plugin, switch to that approach.

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

llvm-svn: 351515

5 years ago[analyzer] Introduce proper diagnostic for freeing unowned object
George Karpenkov [Fri, 18 Jan 2019 03:13:53 +0000 (03:13 +0000)]
[analyzer] Introduce proper diagnostic for freeing unowned object

Insert a note when the object becomes not (exclusively) owned.

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

llvm-svn: 351514

5 years ago[analyzer] Extend the PathDiagnosticLocation constructor to handle CallExitEnd
George Karpenkov [Fri, 18 Jan 2019 03:13:40 +0000 (03:13 +0000)]
[analyzer] Extend the PathDiagnosticLocation constructor to handle CallExitEnd

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

llvm-svn: 351513

5 years ago[analyzer] [NFC] Clean up messy handling of bug categories in RetainCountChecker
George Karpenkov [Fri, 18 Jan 2019 03:13:27 +0000 (03:13 +0000)]
[analyzer] [NFC] Clean up messy handling of bug categories in RetainCountChecker

https://reviews.llvm.org/D56887

llvm-svn: 351512

5 years ago[analyzer] const-ify reference to bug type used in BugReporter
George Karpenkov [Fri, 18 Jan 2019 03:13:14 +0000 (03:13 +0000)]
[analyzer] const-ify reference to bug type used in BugReporter

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

llvm-svn: 351511

5 years ago[analyzer] Extend BugType constructor to accept "SuppressOnSink" as a parameter
George Karpenkov [Fri, 18 Jan 2019 03:13:01 +0000 (03:13 +0000)]
[analyzer] Extend BugType constructor to accept "SuppressOnSink" as a parameter

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

llvm-svn: 351510

5 years ago[analyzer] [RetainCountChecker] Produce a correct message when OSTypeAlloc is used
George Karpenkov [Fri, 18 Jan 2019 03:12:48 +0000 (03:12 +0000)]
[analyzer] [RetainCountChecker] Produce a correct message when OSTypeAlloc is used

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

llvm-svn: 351509

5 years ago[analyzer] [RetainCountChecker] Smart pointer support.
George Karpenkov [Fri, 18 Jan 2019 03:12:35 +0000 (03:12 +0000)]
[analyzer] [RetainCountChecker] Smart pointer support.

rdar://47323216

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

llvm-svn: 351508

5 years ago[WebAssembly] Add languages from debug info to producers section
Thomas Lively [Fri, 18 Jan 2019 02:47:48 +0000 (02:47 +0000)]
[WebAssembly] Add languages from debug info to producers section

Reviewers: aheejin, dschuff, sbc100

Subscribers: aprantl, jgravelle-google, hiraditya, sunfish

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

llvm-svn: 351507

5 years ago[safestack] Remove dependency of SafeStack on sanitizer_common
Vitaly Buka [Fri, 18 Jan 2019 01:53:37 +0000 (01:53 +0000)]
[safestack] Remove dependency of SafeStack on sanitizer_common

Summary:
SafeStack needs just few functions from there, but sanitizer_common
introduces conflicts with other runtimes, e.g. SCUDO.

Reviewers: eugenis, kcc, cryptoad

Subscribers: mgorny, krytarowski, fedor.sergeev, jfb, llvm-commits

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

llvm-svn: 351506

5 years ago[analyzer] A speculative fix for buildbot failures in the new SymbolReaperTest.
Artem Dergachev [Fri, 18 Jan 2019 01:37:14 +0000 (01:37 +0000)]
[analyzer] A speculative fix for buildbot failures in the new SymbolReaperTest.

I expect an xvalue to be easier to convert.

llvm-svn: 351505

5 years agoUse llvm::VersionTuple instead of manual version marshalling
Brad Smith [Fri, 18 Jan 2019 01:36:58 +0000 (01:36 +0000)]
Use llvm::VersionTuple instead of manual version marshalling

llvm-svn: 351504

5 years ago[safestack] Replace statics with unnamed namespace
Vitaly Buka [Fri, 18 Jan 2019 01:36:09 +0000 (01:36 +0000)]
[safestack] Replace statics with unnamed namespace

Reviewers: eugenis

Subscribers: jfb, llvm-commits

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

llvm-svn: 351503

5 years ago[polly] Change to range-based invocation of llvm::sort
Mandeep Singh Grang [Fri, 18 Jan 2019 01:06:46 +0000 (01:06 +0000)]
[polly] Change to range-based invocation of llvm::sort

llvm-svn: 351502

5 years ago[Reproducers] Refactor reproducer info
Jonas Devlieghere [Fri, 18 Jan 2019 01:04:59 +0000 (01:04 +0000)]
[Reproducers] Refactor reproducer info

In the original reproducer design, I expected providers to be more
dynamic than they turned out. For example, we don't have any instances
where one provider has multiple files. Additionally, I expected there to
be less locality between capture and replay, with the provider being
defined in one place and the replay code to live in another. Both
contributed to the design of the provider info.

This patch refactors the reproducer info to be something static. This
means less magic strings and better type checking. The new design still
allows for the capture and replay code to live in different places as
long as they both have access to the new statically defined info class.

I didn't completely get rid of the index, because it is useful for (1)
sanity checking and (2) knowing what files are used by the reproducer.

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

llvm-svn: 351501

5 years ago[analyzer] MoveChecker: Add one more common resetting method, "append".
Artem Dergachev [Fri, 18 Jan 2019 00:16:25 +0000 (00:16 +0000)]
[analyzer] MoveChecker: Add one more common resetting method, "append".

This is especially crucial for reports related to use-after-move of
standard library objects.

rdar://problem/47338505

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

llvm-svn: 351500

5 years ago[analyzer] Make sure base-region and its sub-regions are either all alive or all...
Artem Dergachev [Fri, 18 Jan 2019 00:08:56 +0000 (00:08 +0000)]
[analyzer] Make sure base-region and its sub-regions are either all alive or all dead.

SymbolReaper now realizes that our liveness analysis isn't sharp enough
to discriminate between liveness of, say, variables and their fields.
Surprisingly, this didn't quite work before: having a variable live only
through Environment (eg., calling a C++ method on a local variable
as the last action ever performed on that variable) would not keep the
region value symbol of a field of that variable alive.

It would have been broken in the opposite direction as well, but both
Environment and RegionStore use the scanReachableSymbols mechanism for finding
live symbols regions within their values, and due to that they accidentally
end up marking the whole chain of super-regions as live when at least one
sub-region is known to be live.

It is now a direct responsibility of SymbolReaper to maintain this invariant,
and a unit test was added in order to make sure it stays that way.

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

rdar://problem/46914108

llvm-svn: 351499

5 years ago[CMake] Only test debugserver if platform can use debugserver
Alex Langford [Fri, 18 Jan 2019 00:05:25 +0000 (00:05 +0000)]
[CMake] Only test debugserver if platform can use debugserver

In commit svn r351496 I changed this condition from
`if(LLDB_CAN_USE_DEBUGSERVER)` to `if(NOT SKIP_TEST_DEBUGSERVER)`.
This causes debugserver tests to run on windows, which shouldn't happen.
SKIP_TEST_DEBUGSERVER is set either by the user (it shouldn't be set on
windows builds) or in the debugserver CMake logic (which doesn't get
included when building on windows). Therefore, I changed the condition
to be `if(LLDB_CAN_USE_DEBUGSERVER AND NOT SKIP_TEST_DEBUGSERVER)`.

llvm-svn: 351498

5 years ago[lit] Fix lldbtest format
Jonas Devlieghere [Thu, 17 Jan 2019 23:30:06 +0000 (23:30 +0000)]
[lit] Fix lldbtest format

The lldbtest format was incorrectly detecting XFAIL as FAIL because it
was looking for the `FAIL:` substring in the dotest output.

llvm-svn: 351497

5 years ago[CMake] Prevent lldbDebugserverCommon from building if you disable debugserver builds
Alex Langford [Thu, 17 Jan 2019 23:14:04 +0000 (23:14 +0000)]
[CMake] Prevent lldbDebugserverCommon from building if you disable debugserver builds

Summary:
The flags `LLDB_USE_SYSTEM_DEBUGSERVER` and `LLDB_NO_DEBUGSERVER` were
introduced to the debugserver build. If one of these two flags are set, then we
do not build and sign debugserver. However I noticed that we were still building
the lldbDebugserverCommon and lldbDebugserverCommon_NonUI libraries regardless
of whether or not these flags were set. I don't believe we should be building
these libraries unless we are building and signing debugserver.

Reviewers: sgraenitz, davide, JDevlieghere, beanz, vsk, aprantl, labath

Subscribers: mgorny, jfb, lldb-commits

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

llvm-svn: 351496

5 years agoMake integral-o-pointer conversions in SFINAE illegal.
Erich Keane [Thu, 17 Jan 2019 23:11:15 +0000 (23:11 +0000)]
Make integral-o-pointer conversions in SFINAE illegal.

As reported in PR40362, allowing the conversion from an integral to a
pointer type (despite being illegal in the C++ standard) will cause
surprsing results when testing for certain behaviors in SFINAE.  This
patch converts the error to a SFINAE Error and adds a test to ensure
that it is still a warning in non-SFINAE but an error in it.

Change-Id: I1f475637fa4d83217ae37dc6b5dbf653e118fae4
llvm-svn: 351495

5 years agoAMDGPU: Convert tests away from llvm.SI.load.const
Matt Arsenault [Thu, 17 Jan 2019 22:47:26 +0000 (22:47 +0000)]
AMDGPU: Convert tests away from llvm.SI.load.const

llvm-svn: 351494

5 years agoAddress Ried's post-commit review comment on r351477.
Erik Pilkington [Thu, 17 Jan 2019 22:39:31 +0000 (22:39 +0000)]
Address Ried's post-commit review comment on r351477.

llvm-svn: 351493

5 years ago[HotColdSplit] Allow outlining with live outputs
Vedant Kumar [Thu, 17 Jan 2019 22:36:05 +0000 (22:36 +0000)]
[HotColdSplit] Allow outlining with live outputs

Prior to r348205, extracting code regions with live output values was
disabled because of a miscompilation (PR39433). Lift the restriction as
PR39433 has been addressed.

Tested on LNT+externals, on a run of check-llvm in a stage2 build, and
with a full build of iOS (with hot/cold splitting enabled).

As a drive-by, remove an errant TODO.

llvm-svn: 351492

5 years ago[HotColdSplit] Consider resume instructions to be cold
Vedant Kumar [Thu, 17 Jan 2019 22:35:47 +0000 (22:35 +0000)]
[HotColdSplit] Consider resume instructions to be cold

Resuming exception unwinding is roughly as unlikely as throwing an
exception.

Tested on LNT+externals (in particular, the C++ EH regression tests
provide end-to-end test coverage), as well as with a full build of iOS.

llvm-svn: 351491

5 years agoDon't run TestBreakpointThumbCodesection.py on darwin systems;
Jason Molenda [Thu, 17 Jan 2019 22:26:25 +0000 (22:26 +0000)]
Don't run TestBreakpointThumbCodesection.py on darwin systems;
we don't use a thumb code section.

Don't run Test128BitsInteger.py on armv7k; it's not a supported
type on that target.

llvm-svn: 351490

5 years ago[CMake] Fix lldb-test-depends target
Jonas Devlieghere [Thu, 17 Jan 2019 22:25:20 +0000 (22:25 +0000)]
[CMake] Fix lldb-test-depends target

The lldb-test-depends target was using the old CMake variable name
LLDB_TEST_DEPENDS instead of LLDB_TEST_DEPS. This patch moves the target
definition and makes it use the correct one.

llvm-svn: 351489

5 years ago[WebAssembly] Fix windows compiler warning by using explicit 64bit shift. NFC.
Sam Clegg [Thu, 17 Jan 2019 22:09:09 +0000 (22:09 +0000)]
[WebAssembly] Fix windows compiler warning by using explicit 64bit shift. NFC.

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

llvm-svn: 351488

5 years agoFix cleanup registration for lambda captures.
Richard Smith [Thu, 17 Jan 2019 22:05:50 +0000 (22:05 +0000)]
Fix cleanup registration for lambda captures.

Lambda captures should be destroyed if an exception is thrown only if
the construction of the complete lambda-expression has not completed.
(If the lambda-expression has been fully constructed, any exception will
invoke its destructor, which will destroy the captures.)

This is directly modeled after how we handle the equivalent situation in
InitListExprs.

Note that EmitLambdaLValue was unreachable because in C++11 onwards the
frontend never creates the awkward situation where a prvalue expression
(such as a lambda) is used in an lvalue context (such as the left-hand
side of a class member access).

llvm-svn: 351487

5 years ago[lit] Make sure tests are actually skipped on darwin and windows.
Davide Italiano [Thu, 17 Jan 2019 21:57:33 +0000 (21:57 +0000)]
[lit] Make sure tests are actually skipped on darwin and windows.

llvm-svn: 351486

5 years ago[mips] Emit .reloc R_{MICRO}MIPS_JALR along with j(al)r(c) $25
Vladimir Stefanovic [Thu, 17 Jan 2019 21:50:37 +0000 (21:50 +0000)]
[mips] Emit .reloc R_{MICRO}MIPS_JALR along with j(al)r(c) $25

The callee address is added as an optional operand (MCSymbol) in
AdjustInstrPostInstrSelection() and then used by asm printer to insert:
'.reloc tmplabel, R_MIPS_JALR, symbol
tmplabel:'.
Controlled with '-mips-jalr-reloc', default is true.

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

llvm-svn: 351485

5 years agoAdd -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction...
Eric Fiselier [Thu, 17 Jan 2019 21:44:24 +0000 (21:44 +0000)]
Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides.

Summary:
Some style guides want to allow using CTAD only on types that "opt-in"; i.e. on types that are designed to support it and not just types that *happen* to work with it.

This patch implements the `-Wctad-maybe-unsupported` warning, which is off by default, which warns when CTAD is used on a type that does not define any deduction guides.

The following pattern can be used to suppress the warning in cases where the type intentionally doesn't define any deduction guides:

```
struct allow_ctad_t;

template <class T>
struct TestSuppression {
  TestSuppression(T) {}
};
TestSuppression(allow_ctad_t)->TestSuppression<void>; // guides with incomplete parameter types are never considered.
```

Reviewers: rsmith, james.dennett, gromer

Reviewed By: rsmith

Subscribers: jdennett, Quuxplusone, lebedev.ri, cfe-commits

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

llvm-svn: 351484

5 years ago[HotColdSplit] Relax requirement that the cold sink block be extractable
Vedant Kumar [Thu, 17 Jan 2019 21:42:36 +0000 (21:42 +0000)]
[HotColdSplit] Relax requirement that the cold sink block be extractable

Relaxing this requirement creates opportunities to split code dominated
by an EH pad.

Tested on LNT+externals.

llvm-svn: 351483

5 years ago[demangler] Support for block literals.
Erik Pilkington [Thu, 17 Jan 2019 21:37:51 +0000 (21:37 +0000)]
[demangler] Support for block literals.

llvm-svn: 351482

5 years ago[demangler] Ignore leading underscores if present
Erik Pilkington [Thu, 17 Jan 2019 21:37:36 +0000 (21:37 +0000)]
[demangler] Ignore leading underscores if present

On MacOS, symbols start with a leading underscore, so just parse and
ignore it if present.

llvm-svn: 351481

5 years ago[HotColdSplit] Simplify tests by lowering their splitting thresholds
Vedant Kumar [Thu, 17 Jan 2019 21:29:34 +0000 (21:29 +0000)]
[HotColdSplit] Simplify tests by lowering their splitting thresholds

This gets rid of the brittle/mysterious calls to @sink()/@sideeffect()
peppered throughout the test cases. They are no longer needed to force
splitting to occur.

llvm-svn: 351480

5 years agoxray: Add missing header to list of installed headers.
Peter Collingbourne [Thu, 17 Jan 2019 21:11:49 +0000 (21:11 +0000)]
xray: Add missing header to list of installed headers.

Spotted by gn's llvm/utils/gn/build/sync_source_lists_from_cmake.py script.

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

llvm-svn: 351479

5 years agoFix -Wsign-compare in new tests
Reid Kleckner [Thu, 17 Jan 2019 20:52:46 +0000 (20:52 +0000)]
Fix -Wsign-compare in new tests

llvm-svn: 351478

5 years agoFix an MSVC bot failure from r351474.
Erik Pilkington [Thu, 17 Jan 2019 20:52:10 +0000 (20:52 +0000)]
Fix an MSVC bot failure from r351474.

llvm-svn: 351477

5 years ago[SampleFDO] Skip profile reading when flattened profile used in ThinLTO postlink
Wei Mi [Thu, 17 Jan 2019 20:48:34 +0000 (20:48 +0000)]
[SampleFDO] Skip profile reading when flattened profile used in ThinLTO postlink

If the sample profile has no inlining hierachy information included, we call
the sample profile is flattened. For flattened profile, in ThinLTO postlink
phase, SampleProfileLoader's hot function inlining and profile annotation will
do nothing, so it is better to save the effort to read in the profile and run
the sample profile loader pass. It is helpful for reducing compile time when
the flattened profile is huge.

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

llvm-svn: 351476

5 years ago[InstCombine] Don't sink dynamic allocas
Reid Kleckner [Thu, 17 Jan 2019 20:46:53 +0000 (20:46 +0000)]
[InstCombine] Don't sink dynamic allocas

Summary:
InstCombine's sinking algorithm only thinks about memory. It doesn't
think about non-memory constraints like stack object lifetime. It can
sink dynamic allocas across a stacksave call, which may be used with
stackrestore, which can incorrectly reduce the lifetime of the dynamic
alloca.

Fixes PR40365

Reviewers: hfinkel, efriedma

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 351475

5 years agoNFC: Make the copies of the demangler byte-for-byte identical
Erik Pilkington [Thu, 17 Jan 2019 20:37:51 +0000 (20:37 +0000)]
NFC: Make the copies of the demangler byte-for-byte identical

With this patch, the copies of the files ItaniumDemangle.h,
StringView.h, and Utility.h are kept byte-for-byte in sync between
libcxxabi and llvm. All differences (namespaces, fallthrough, and
unreachable macros) are defined in each copies' DemanglerConfig.h.

This patch also adds a script to copy changes from libcxxabi
(cp-to-llvm.sh), and a README.txt explaining the situation.

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

llvm-svn: 351474

5 years ago[clang-tidy] Add abseil-duration-conversion-cast check
Hyrum Wright [Thu, 17 Jan 2019 20:37:35 +0000 (20:37 +0000)]
[clang-tidy] Add abseil-duration-conversion-cast check

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

llvm-svn: 351473

5 years agoFix the buildbot failure introduced by r351404
Sanjin Sijaric [Thu, 17 Jan 2019 20:24:14 +0000 (20:24 +0000)]
Fix the buildbot failure introduced by r351404

EXPENSIVE_CHECKS buildbots are failing due to r351404.

Add x1 as live in to the funclet basic block for SEH funclets, as well as
-verify-machineinstrs to the test case that triggered the failure.

llvm-svn: 351472

5 years agoRevert r351208 (which was a revert of r350892).
Aaron Ballman [Thu, 17 Jan 2019 20:21:44 +0000 (20:21 +0000)]
Revert r351208 (which was a revert of r350892).

This corresponds to the fix to Clang in r351470.

llvm-svn: 351471

5 years agoRevert r351209 (which was a revert of r350891) with a fix.
Aaron Ballman [Thu, 17 Jan 2019 20:21:34 +0000 (20:21 +0000)]
Revert r351209 (which was a revert of r350891) with a fix.

The test case had a parse error that was causing the condition string to be misreported. We now have better fallback code for error cases.

llvm-svn: 351470

5 years agollvm build: Merge r351448
Nico Weber [Thu, 17 Jan 2019 20:20:56 +0000 (20:20 +0000)]
llvm build: Merge r351448

llvm-svn: 351469

5 years ago[Documentation] Fix another link in docs/clang-tidy/Contributing.rst.
Eugene Zelenko [Thu, 17 Jan 2019 20:00:23 +0000 (20:00 +0000)]
[Documentation] Fix another link in docs/clang-tidy/Contributing.rst.

llvm-svn: 351468

5 years ago[Documentation] Another attempt to fix link in docs/clang-tidy/Contributing.rst....
Eugene Zelenko [Thu, 17 Jan 2019 19:47:44 +0000 (19:47 +0000)]
[Documentation] Another attempt to fix link in docs/clang-tidy/Contributing.rst. Use HTTPS for links.

llvm-svn: 351467

5 years ago[Documentation] Fix link in docs/clang-tidy/Contributing.rst.
Eugene Zelenko [Thu, 17 Jan 2019 19:35:39 +0000 (19:35 +0000)]
[Documentation] Fix link in docs/clang-tidy/Contributing.rst.

llvm-svn: 351466

5 years ago[WebAssembly] Fixing 2 more symbol offset related tests.
Wouter van Oortmerssen [Thu, 17 Jan 2019 19:18:05 +0000 (19:18 +0000)]
[WebAssembly] Fixing 2 more symbol offset related tests.

llvm-svn: 351465

5 years ago[Test] Fix debug-loc-0.mir with EXPENSIVE_CHECKS
Jonas Devlieghere [Thu, 17 Jan 2019 18:35:14 +0000 (18:35 +0000)]
[Test] Fix debug-loc-0.mir with EXPENSIVE_CHECKS

The `llc` invocation was missing `-start-before=machine-cp`.

llvm-svn: 351464

5 years ago[Documentation] Add a chapter about Clang-tidy integrations.
Eugene Zelenko [Thu, 17 Jan 2019 18:31:34 +0000 (18:31 +0000)]
[Documentation] Add a chapter about Clang-tidy integrations.

Patch by Marina Kalashina.

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

llvm-svn: 351463

5 years ago[WebAssembly] Changed objdump output to offsets instead of indices.
Wouter van Oortmerssen [Thu, 17 Jan 2019 18:30:35 +0000 (18:30 +0000)]
[WebAssembly] Changed objdump output to offsets instead of indices.

Summary: This is to accommodate this change: https://reviews.llvm.org/D56684

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 351462

5 years ago[CodeGenObjC] Use a constant value for non-fragile ivar offsets when possible
Erik Pilkington [Thu, 17 Jan 2019 18:18:53 +0000 (18:18 +0000)]
[CodeGenObjC] Use a constant value for non-fragile ivar offsets when possible

If a class inherits from NSObject and has an implementation, then we
can assume that ivar offsets won't need to be updated by the runtime.
This allows us to index into the object using a constant value and
avoid loading from the ivar offset variable.

This patch was adapted from one written by Pete Cooper.

rdar://problem/10132568

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

llvm-svn: 351461

5 years ago[WebAssembly] Fixed objdump not parsing function headers.
Wouter van Oortmerssen [Thu, 17 Jan 2019 18:14:09 +0000 (18:14 +0000)]
[WebAssembly] Fixed objdump not parsing function headers.

Summary:
objdump was interpreting the function header containing the locals
declaration as instructions. To parse these without injecting target
specific code in objdump, MCDisassembler::onSymbolStart was added to
be implemented by the WebAssembly implemention.

WasmObjectFile now returns a code offset for the "address" of a symbol,
rather than the index. This is also more in-line with what other
targets do.

Also ensured that the AsmParser correctly puts each function
in its own segment to enable this test case.

Reviewers: sbc100, dschuff

Subscribers: jgravelle-google, aheejin, sunfish, rupprecht, llvm-commits

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

llvm-svn: 351460