platform/upstream/llvm.git
5 years ago[OpenCL] Improve destructor support in C++ for OpenCL
Marco Antognini [Thu, 18 Jul 2019 10:04:18 +0000 (10:04 +0000)]
[OpenCL] Improve destructor support in C++ for OpenCL

Summary:
This patch does mainly three things:
 1. It fixes a false positive error detection in Sema that is similar to
    D62156. The error happens when explicitly calling an overloaded
    destructor for different address spaces.
 2. It selects the correct destructor when multiple overloads for
    address spaces are available.
 3. It inserts the expected address space cast when invoking a
    destructor, if needed, and therefore fixes a crash due to the unmet
    assertion in llvm::CastInst::Create.

The following is a reproducer of the three issues:

    struct MyType {
      ~MyType() {}
      ~MyType() __constant {}
    };

    __constant MyType myGlobal{};

    kernel void foo() {
      myGlobal.~MyType(); // 1 and 2.
      // 1. error: cannot initialize object parameter of type
      //    '__generic MyType' with an expression of type '__constant MyType'
      // 2. error: no matching member function for call to '~MyType'
    }

    kernel void bar() {
      // 3. The implicit call to the destructor crashes due to:
      //    Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
      //    in llvm::CastInst::Create.
      MyType myLocal;
    }

The added test depends on D62413 and covers a few more things than the
above reproducer.

Subscribers: yaxunl, Anastasia, cfe-commits

Tags: #clang

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

llvm-svn: 366422

5 years ago[OpenCL] Update comments/diagnostics to refer to C++ for OpenCL
Anastasia Stulova [Thu, 18 Jul 2019 10:02:35 +0000 (10:02 +0000)]
[OpenCL] Update comments/diagnostics to refer to C++ for OpenCL

Clang doesn't implement OpenCL C++, change the comments to
reflect that.

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

llvm-svn: 366421

5 years ago[clangd] Added highlightings for template parameters and specializations.
Johan Vikstrom [Thu, 18 Jul 2019 09:56:38 +0000 (09:56 +0000)]
[clangd] Added highlightings for template parameters and specializations.

Summary: Template parameters and specializations were not being highlighted before. This adds highlightings to those types of tokens by adding two Visit* methods.

Reviewers: hokein, sammccall, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 366420

5 years ago[SCEV] add no wrap flag for SCEVAddExpr.
Chen Zheng [Thu, 18 Jul 2019 09:23:19 +0000 (09:23 +0000)]
[SCEV] add no wrap flag for SCEVAddExpr.
Differential Revision: https://reviews.llvm.org/D64868

llvm-svn: 366419

5 years ago[lld] Fix vs-diagnostics-version-script test. NFC.
Chris Jackson [Thu, 18 Jul 2019 09:17:11 +0000 (09:17 +0000)]
[lld] Fix vs-diagnostics-version-script test. NFC.

Removed unnecessary llvm-mc call.

llvm-svn: 366418

5 years ago[OpenCL][PR42033] Fix addr space deduction with template parameters
Anastasia Stulova [Thu, 18 Jul 2019 09:12:49 +0000 (09:12 +0000)]
[OpenCL][PR42033] Fix addr space deduction with template parameters

If dependent types appear in pointers or references we allow addr
space deduction because the addr space in template argument will
belong to the pointee and not the pointer or reference itself.

We also don't diagnose addr space on a function return type after
template instantiation. If any addr space for the return type was
provided on a template parameter this will be diagnosed during the
parsing of template definition.

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

llvm-svn: 366417

5 years agoFixup r366333 (require x86 in test)
Diana Picus [Thu, 18 Jul 2019 08:27:44 +0000 (08:27 +0000)]
Fixup r366333 (require x86 in test)

Seems to be required for the other added tests too.

llvm-svn: 366416

5 years ago[lldb][NFC] Tablegenify type commands
Raphael Isemann [Thu, 18 Jul 2019 08:22:19 +0000 (08:22 +0000)]
[lldb][NFC] Tablegenify type commands

llvm-svn: 366415

5 years ago[lldb] Don't double emit option groups
Raphael Isemann [Thu, 18 Jul 2019 08:22:11 +0000 (08:22 +0000)]
[lldb] Don't double emit option groups

We currently emit the option groups twice if Groups<[1,2,3]> is
used in the tablegen. This leads to compilation errors. This
patch just removes the line that accidentially emits the option
group a second time.

llvm-svn: 366414

5 years agoFix asan infinite loop on undefined symbol
Serge Guelton [Thu, 18 Jul 2019 08:09:31 +0000 (08:09 +0000)]
Fix asan infinite loop on undefined symbol

Fix llvm#39641

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

llvm-svn: 366413

5 years ago[RISCV] Reset NoPHIS MachineFunctionProperty in emitSelectPseudo
Alex Bradbury [Thu, 18 Jul 2019 07:52:41 +0000 (07:52 +0000)]
[RISCV] Reset NoPHIS MachineFunctionProperty in emitSelectPseudo

We insered PHIS were there were none before, so the property must be
reset. This error was found on an EXPENSIVE_CHECKS build.

llvm-svn: 366412

5 years ago[LoopInfo] Use early return in branch weight update functions. NFC.
Serguei Katkov [Thu, 18 Jul 2019 07:36:20 +0000 (07:36 +0000)]
[LoopInfo] Use early return in branch weight update functions. NFC.

llvm-svn: 366411

5 years ago[RISCV][DebugInfo] Fix dwarf-riscv-relocs.ll test on Windows
Alex Bradbury [Thu, 18 Jul 2019 07:25:56 +0000 (07:25 +0000)]
[RISCV][DebugInfo] Fix dwarf-riscv-relocs.ll test on Windows

Windows sees DW_AT_decl_file (".\dwarf-riscv-relocs.c") while Linux sees
DW_AT_decl_file ("./dwarf-riscv-relocs.c").

This fixes a failure introduced in rL366402.

llvm-svn: 366410

5 years ago[CodeComplete] Fix ASTUnit cached completion of macros from preamble, broken in r342528
Sam McCall [Thu, 18 Jul 2019 07:17:49 +0000 (07:17 +0000)]
[CodeComplete] Fix ASTUnit cached completion of macros from preamble, broken in r342528

Summary:
The problem is the default LoadExternal with no completer, which happens when
loading global results.

Reviewers: ilya-biryukov, nik

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 366409

5 years agoclang-tidy release notes: Split and order changes by type
Hans Wennborg [Thu, 18 Jul 2019 07:12:47 +0000 (07:12 +0000)]
clang-tidy release notes: Split and order changes by type

Patch by Eugene Zelenko!

llvm-svn: 366408

5 years ago[NFC][PowerPC] Add the test to test the pass block-placement
Kang Zhang [Thu, 18 Jul 2019 06:56:49 +0000 (06:56 +0000)]
[NFC][PowerPC] Add the test to test the pass block-placement

llvm-svn: 366407

5 years ago[PowerPC][Clang] Remove use of malloc in mm_malloc
Qiu Chaofan [Thu, 18 Jul 2019 06:20:12 +0000 (06:20 +0000)]
[PowerPC][Clang] Remove use of malloc in mm_malloc

Remove dependency of malloc in implementation of mm_malloc function in PowerPC
intrinsics and alignment assumption on glibc.

Reviewed By: Hal Finkel

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

llvm-svn: 366406

5 years ago[X86] Disable combineConcatVectors for vXi1 vectors.
Craig Topper [Thu, 18 Jul 2019 06:18:06 +0000 (06:18 +0000)]
[X86] Disable combineConcatVectors for vXi1 vectors.

I'm not convinced the code this calls is properly vetted for
vXi1 vectors. Experimental vector widening legalization testing
for D55251 is now hitting an assertion failure inside
EltsFromConsecutiveLoads. This is occurring from a v2i1 load
having a store size different than its VT size. Hopefully
this commit will keep such issues from happening.

llvm-svn: 366405

5 years agoFix typo in programmer's manual cantFile -> cantFail
Nathan Lanza [Thu, 18 Jul 2019 05:24:22 +0000 (05:24 +0000)]
Fix typo in programmer's manual cantFile -> cantFail

llvm-svn: 366403

5 years ago[DWARF][RISCV] Add support for RISC-V relocations needed for debug info
Alex Bradbury [Thu, 18 Jul 2019 05:22:55 +0000 (05:22 +0000)]
[DWARF][RISCV] Add support for RISC-V relocations needed for debug info

When code relaxation is enabled many RISC-V fixups are not resolved but
instead relocations are emitted. This happens even for DWARF debug
sections. Therefore, to properly support the parsing of DWARF debug info
we need to be able to resolve RISC-V relocations. This patch adds:

* Support for RISC-V relocations in RelocationResolver
* DWARF support for two relocations per object file offset
* DWARF changes to support relocations in more DIE fields

The two relocations per offset change is needed because some RISC-V
relocations (used for label differences) come in pairs.

Relocations can also be emitted for DWARF fields where relocations were
not yet evaluated. Adding relocation support for some of these fields is
essencial. On the other hand, LLVM currently emits RISC-V relocations
for fixups that could be safely evaluated, since they can never be
affected by code relaxations. This patch also adds relocation support
for the fields affected by those extraneous relocations (the DWARF unit
entry Length, and the DWARF debug line entry TotalLength and
PrologueLength), for testing purposes.

Differential Revision: https://reviews.llvm.org/D62062
Patch by Luís Marques.

llvm-svn: 366402

5 years ago[ELF][test] Merge/rename some basic*.s tests
Fangrui Song [Thu, 18 Jul 2019 04:54:58 +0000 (04:54 +0000)]
[ELF][test] Merge/rename some basic*.s tests

basic64be.s is a big-endian powerpc64 test that just duplicates what
basic-ppc64.s does. Extend basic-ppc64.s to add big-endian tests.
Delete basic64be.s

Rename basic32.s to basic-i386.s

llvm-svn: 366401

5 years ago[clangd] Fix Fix -Wunused-lambda-capture after r366339
Fangrui Song [Thu, 18 Jul 2019 04:23:54 +0000 (04:23 +0000)]
[clangd] Fix Fix -Wunused-lambda-capture after r366339

llvm-svn: 366400

5 years ago[RISCV] Re-land r366331 d RISCV to LLVM_ALL_TARGETS
Alex Bradbury [Thu, 18 Jul 2019 04:05:18 +0000 (04:05 +0000)]
[RISCV] Re-land r366331 d RISCV to LLVM_ALL_TARGETS

*San flagged issues should be now be addressed.

llvm-svn: 366399

5 years ago[RISCV] Avoid signed integer overflow UB in RISCVMatInt::generateInstSeq
Alex Bradbury [Thu, 18 Jul 2019 04:02:58 +0000 (04:02 +0000)]
[RISCV] Avoid signed integer overflow UB in RISCVMatInt::generateInstSeq

Found by UBSan.

llvm-svn: 366398

5 years ago[RISCV] Don't acccess an invalidated iterator in RISCVInstrInfo::removeBranch
Alex Bradbury [Thu, 18 Jul 2019 03:23:47 +0000 (03:23 +0000)]
[RISCV] Don't acccess an invalidated iterator in RISCVInstrInfo::removeBranch

Issue found by ASan.

llvm-svn: 366397

5 years ago[AArch64] Add dependency from AArch64CodeGen to TransformUtils to fix -DBUILD_SHARED_...
Fangrui Song [Thu, 18 Jul 2019 01:53:08 +0000 (01:53 +0000)]
[AArch64] Add dependency from AArch64CodeGen to TransformUtils to fix -DBUILD_SHARED_LIBS=on link error after D64173/r366361

This fixes:

ld.lld: error: undefined symbol: llvm::findAllocaForValue(llvm::Value*, llvm::DenseMap<llvm::Value*, llvm::Alloc aInst*, llvm::DenseMapInfo<llvm::Value*>, llvm::detail::DenseMapPair<llvm::Value*, llvm::AllocaInst*> >&)
>>> referenced by AArch64StackTagging.cpp

llvm-svn: 366396

5 years agoOnly build lldb-tblgen if it's not a current target
Nathan Lanza [Thu, 18 Jul 2019 01:26:53 +0000 (01:26 +0000)]
Only build lldb-tblgen if it's not a current target

Summary:
When doing standalone builds, you could potentially be building against
an llvm which also built lldb. If this were the case, you'd be
attempting to build this target twice.

Reviewers: xiaobai

Subscribers: mgorny

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

llvm-svn: 366394

5 years ago[Tests] Add a test showing how we handle overaligned allocas w/ no-realign-stack
Philip Reames [Thu, 18 Jul 2019 00:26:03 +0000 (00:26 +0000)]
[Tests] Add a test showing how we handle overaligned allocas w/ no-realign-stack

(At the moment, we ignore the alignment requirement.)

llvm-svn: 366393

5 years ago[cmake] Add NATIVE build for cross compiling standalone builds
Nathan Lanza [Thu, 18 Jul 2019 00:21:57 +0000 (00:21 +0000)]
[cmake] Add NATIVE build for cross compiling standalone builds

TableGen is a host tool and requires a native variant for every build.
While building as a part of llvm this is trivial and llvm handles it.
However, building standalone means that lldb has to handle this itself.
Add a NATIVE build variant to enable this.

llvm-svn: 366392

5 years ago[analyzer] MallocChecker: Prevent Integer Set Library false positives
Csaba Dabis [Thu, 18 Jul 2019 00:03:55 +0000 (00:03 +0000)]
[analyzer] MallocChecker: Prevent Integer Set Library false positives

Summary:
Integer Set Library using retain-count based allocation which is not
modeled in MallocChecker.

Reviewed By: NoQ

Tags: #clang

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

llvm-svn: 366391

5 years agoChanges to display code view debug info type records in hex format
Nilanjana Basu [Wed, 17 Jul 2019 23:43:58 +0000 (23:43 +0000)]
Changes to display code view debug info type records in hex format

llvm-svn: 366390

5 years agohwasan: Use C++ driver for cfi.cc test.
Peter Collingbourne [Wed, 17 Jul 2019 23:35:15 +0000 (23:35 +0000)]
hwasan: Use C++ driver for cfi.cc test.

It turns out that this test was only passing by accident. It was relying on
the optimizer to remove the only reference to A's vtable by realizing that
the CFI check will always fail. The vtable contains a reference to RTTI in
libc++, which will be unresolved because the C driver won't link against it.

This was found by my prototype implementation of HWASAN for globals, which
happens to end up preserving the reference.

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

llvm-svn: 366389

5 years agoMake DT a transitive dependency of LI.
Evgeniy Stepanov [Wed, 17 Jul 2019 23:31:59 +0000 (23:31 +0000)]
Make DT a transitive dependency of LI.

Summary:
LoopInfoWrapperPass::verify uses DT, which means DT must be alive
even if it has no direct users.

Fixes a crash in expensive checks mode.

Reviewers: pcc, leonardchan

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 366388

5 years ago[llvm-bcanalyzer] Fixed error 'Expected<T> must be checked before access or destruction'
Denis Bakhvalov [Wed, 17 Jul 2019 23:28:39 +0000 (23:28 +0000)]
[llvm-bcanalyzer] Fixed error 'Expected<T> must be checked before access or destruction'

After rL365286 I had failing test:
  LLVM :: tools/gold/X86/v1.12/thinlto_emit_linked_objects.ll

It was failing with the output:
$ llvm-bcanalyzer --dump llvm/test/tools/gold/X86/v1.12/Output/thinlto_emit_linked_objects.ll.tmp3.o.thinlto.bc
Expected<T> must be checked before access or destruction.
Unchecked Expected<T> contained error:
Unexpected end of file reading 0 of 0 bytesStack dump:

Change-Id: I07e03262074ea5e0aae7a8d787d5487c87f914a2
llvm-svn: 366387

5 years agollvm-pdbdump: Fix several smaller issues with injected source compression handling
Nico Weber [Wed, 17 Jul 2019 22:59:52 +0000 (22:59 +0000)]
llvm-pdbdump: Fix several smaller issues with injected source compression handling

- getCompression() used to return a PDB_SourceCompression even though
  the docs for IDiaInjectedSource are explicit about the return value
  being compiler-dependent. Return an uint32_t instead, and make the
  printing code handle unknown values better by printing "Unknown" and
  the int value instead of not printing any compression.

- Print compressed contents as hex dump, not as string.

- Add compression type "DotNet", which is used (at least) by csc.exe,
  the C# compiler. Also add a lengthy comment describing the stream
  contents (derived from looking at the raw hex contents long enough
  to see the GUIDs, which led me to the roslyn and mono implementations
  for handling this).

- The native injected source dumper was dumping the contents of the
  whole data stream -- but csc.exe writes a stream that's padded with
  zero bytes to the next 512 boundary, and the dia api doesn't display
  those padding bytes. So make NativeInjectedSource::getCode() do the
  same thing.

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

llvm-svn: 366386

5 years ago[AMDGPU] Simplify AMDGPUInstPrinter::printRegOperand()
Stanislav Mekhanoshin [Wed, 17 Jul 2019 22:58:43 +0000 (22:58 +0000)]
[AMDGPU] Simplify AMDGPUInstPrinter::printRegOperand()

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

llvm-svn: 366385

5 years agoAMDGPU: Set inaccessiblememonly on sendmsg intrinsics
Matt Arsenault [Wed, 17 Jul 2019 22:41:53 +0000 (22:41 +0000)]
AMDGPU: Set inaccessiblememonly on sendmsg intrinsics

llvm-svn: 366384

5 years ago[NFC] Clarify a Cmake status message regarding Python on LLDBConfig
Adrian McCarthy [Wed, 17 Jul 2019 22:36:26 +0000 (22:36 +0000)]
[NFC] Clarify a Cmake status message regarding Python on LLDBConfig

llvm-svn: 366383

5 years ago[X86] Make sure we mark 128/256 MLOAD as Legal with VLX when min-legal-vector-width...
Craig Topper [Wed, 17 Jul 2019 22:26:00 +0000 (22:26 +0000)]
[X86] Make sure we mark 128/256 MLOAD as Legal with VLX when min-legal-vector-width=256 is in effect.

This started triggering an assertion after r364718 when we made
these Custom under AVX2.

llvm-svn: 366382

5 years agoAh, forgot a debug line I left in the dsym-for-uuid.sh script
Jason Molenda [Wed, 17 Jul 2019 21:55:39 +0000 (21:55 +0000)]
Ah, forgot a debug line I left in the dsym-for-uuid.sh script
to make sure it was correctly being disabled after this test
case completed.

llvm-svn: 366381

5 years agogn build: Merge r366361.
Peter Collingbourne [Wed, 17 Jul 2019 21:45:34 +0000 (21:45 +0000)]
gn build: Merge r366361.

llvm-svn: 366380

5 years agohwasan: Initialize the pass only once.
Peter Collingbourne [Wed, 17 Jul 2019 21:45:19 +0000 (21:45 +0000)]
hwasan: Initialize the pass only once.

This will let us instrument globals during initialization. This required
making the new PM pass a module pass, which should still provide access to
analyses via the ModuleAnalysisManager.

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

llvm-svn: 366379

5 years agoAdd support to ProcessMachCore::DoLoadCore to handle an EFI UUID str.
Jason Molenda [Wed, 17 Jul 2019 21:44:05 +0000 (21:44 +0000)]
Add support to ProcessMachCore::DoLoadCore to handle an EFI UUID str.

If a core file has an EFI version string which includes a UUID
(similar to what it returns for the kdp KDP_KERNELVERSION packet)
in the LC_IDENT or LC_NOTE 'kern ver str' load command.  In that
case, we should try to find the binary and dSYM for the UUID
listed.  The dSYM may have python code which knows how to relocate
the binary to the correct address in lldb's target section load
list and loads other ancillary binaries.

The test case is a little involved,

1. it compiles an inferior hello world apple (a.out),
2. it compiles a program which can create a corefile manually
   with a specific binary's UUID encoded in it,
3. it gets the UUID of the a.out binary,
4. it creates a shell script, dsym-for-uuid.sh, which will
   return the full path to the a.out + a.out.dSYM when called
   with teh correct UUID,
5. it sets the LLDB_APPLE_DSYMFORUUID_EXECUTABLE env var before
   creating the lldb target, to point to this dsym-for-uuid.sh,
6. runs the create-corefile binary we compiled in step #2,
7. loads the corefile from step #6 into lldb,
8. verifies that lldb loaded a.out by reading the LC_NOTE
   load command from the corefile, calling dsym-for-uuid.sh with
   that UUID, got back the path to a.out and loaded it.

whew!

<rdar://problem/47562911>

llvm-svn: 366378

5 years ago[NFC][ScopBuilder] Move buildSchedule and its callees to ScopBuilder or ScopHelper
Dominik Adamski [Wed, 17 Jul 2019 21:42:39 +0000 (21:42 +0000)]
[NFC][ScopBuilder] Move buildSchedule and its callees to ScopBuilder or ScopHelper

Scope of changes:
1. Moved buildSchedule functions to ScopBuilder.
2. Moved combineInSequence function to ScopBuilder.
3. Moved mapToDimension function to ScopBuilder.
4. Moved LoopStackTy to ScopBuilder.
5. Moved getLoopSurroundingScop to ScopHelper.
6. Moved getNumBlocksInLoop to ScopHelper.
7. Moved getNumBlocksInRegionNode to ScopHelper.
8. Moved getRegionNodeLoop to ScopHelper.

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

llvm-svn: 366377

5 years ago[AMDGPU] Stop special casing flat_scratch for register name
Stanislav Mekhanoshin [Wed, 17 Jul 2019 21:35:11 +0000 (21:35 +0000)]
[AMDGPU] Stop special casing flat_scratch for register name

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

llvm-svn: 366376

5 years agoSpeculative fix for stack-tagging.ll failure.
Evgeniy Stepanov [Wed, 17 Jul 2019 21:27:44 +0000 (21:27 +0000)]
Speculative fix for stack-tagging.ll failure.

Depending on the evaluation order of function call arguments,
the current code may insert a use before def.

llvm-svn: 366375

5 years ago[NFC][ScopBuilder]Move finalizeAccesses and its callees to ScopBuilder
Dominik Adamski [Wed, 17 Jul 2019 21:25:18 +0000 (21:25 +0000)]
[NFC][ScopBuilder]Move finalizeAccesses and its callees to ScopBuilder

Scope of changes:
1) Moved finalizeAccesses to ScopBuilder
2) Moved updateAccessDimensionality to ScopBuilder
3) Moved foldSizeConstantsToRight to ScopBuilder
4) Moved foldSizeConstantsToRight to ScopBuilder
5) Moved assumeNoOutOfBounds to ScopBuilder
6) Moved markFortranArrays to ScopBuilder
7) Added iterator range for AccessFunctions vector.

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

llvm-svn: 366374

5 years ago[Attributor][NFC] Remove unnecessary debug output
Hideto Ueno [Wed, 17 Jul 2019 21:11:02 +0000 (21:11 +0000)]
[Attributor][NFC] Remove unnecessary debug output

llvm-svn: 366373

5 years agoAdding inline comments to code view type record directives for better readability
Nilanjana Basu [Wed, 17 Jul 2019 21:01:12 +0000 (21:01 +0000)]
Adding inline comments to code view type record directives for better readability

llvm-svn: 366372

5 years ago[PEI] Don't re-allocate a pre-allocated stack protector slot
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:19 +0000 (20:46 +0000)]
[PEI] Don't re-allocate a pre-allocated stack protector slot

The LocalStackSlotPass pre-allocates a stack protector and makes sure
that it comes before the local variables on the stack.

We need to make sure that later during PEI we don't re-allocate a new
stack protector slot. If that happens, the new stack protector slot will
end up being **after** the local variables that it should be protecting.

Therefore, we would have two slots assigned for two different stack
protectors, one at the top of the stack, and one at the bottom. Since
PEI will overwrite the assigned slot for the stack protector, the load
that is used to compare the value of the stack protector will use the
slot assigned by PEI, which is wrong.

For this, we need to check if the object is pre-allocated, and re-use
that pre-allocated slot.

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

llvm-svn: 366371

5 years ago[CodeGen] Add stack protector tests where the guard gets re-assigned
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:16 +0000 (20:46 +0000)]
[CodeGen] Add stack protector tests where the guard gets re-assigned

In preparation of a fix, add tests for multiple backends.

llvm-svn: 366370

5 years ago[CodeGen][NFC] Simplify checks for stack protector index checking
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:09 +0000 (20:46 +0000)]
[CodeGen][NFC] Simplify checks for stack protector index checking

Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex() >=
0`.

llvm-svn: 366369

5 years agoRenamed and changed the wording of warn_cconv_ignored
Sunil Srivastava [Wed, 17 Jul 2019 20:41:26 +0000 (20:41 +0000)]
Renamed and changed the wording of warn_cconv_ignored

As discussed in D64780 the wording of this warning message is being
changed to say 'is not supported' instead of 'ignored', and the
diag ID itself is being changed to warn_cconv_not_supported.

llvm-svn: 366368

5 years agoGlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources
Matt Arsenault [Wed, 17 Jul 2019 20:22:44 +0000 (20:22 +0000)]
GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources

Extract the sources to the GCD of the original size and target size,
padding with implicit_def as necessary.

Also fix the case where the requested source type is wider than the
original result type. This was ignoring the type, and just using the
destination. Do the operation in the requested type and truncate back.

llvm-svn: 366367

5 years agoGlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES
Matt Arsenault [Wed, 17 Jul 2019 20:22:38 +0000 (20:22 +0000)]
GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES

Use an anyext to the requested type for the leftover operand to
produce a slightly wider type, and then truncate the final merge.

I have another implementation almost ready which handles arbitrary
widens, but I think it produces worse code in this example (which I
think is 90% due to not folding redundant copies or folding out
implicit_def users), so I wanted to add this as a baseline first.

llvm-svn: 366366

5 years agoFix CreateFunctionTemplateSpecialization to prevent dangling poiner to stack memory
Shafik Yaghmour [Wed, 17 Jul 2019 20:16:13 +0000 (20:16 +0000)]
Fix CreateFunctionTemplateSpecialization to prevent dangling poiner to stack memory

In ClangASTContext::CreateFunctionTemplateSpecializationInfo a TemplateArgumentList is allocated on the stack but is treated as if it is persistent in subsequent calls. When we exit the function func_decl will still point to the stack allocated memory. We will use TemplateArgumentList::CreateCopy instead which will allocate memory out of the DeclContext.

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

llvm-svn: 366365

5 years ago[docs] Adjust variable formatting table
Jonas Devlieghere [Wed, 17 Jul 2019 19:49:01 +0000 (19:49 +0000)]
[docs] Adjust variable formatting table

While the in-place hints on valid formats are up to date (e.g. when
choosing an invalid format expr -f nonExisting -- 42), the corresponding
online docs table is not. The formats "address", "hex float",
"instruction" and "void" are missing, and "decimal" refers to an
outdated abbreviation 'i' instead of 'd'.

Patch by: Lukas Böger

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

llvm-svn: 366364

5 years ago[CMake] Remove duplicated logic to find Python when doing a standalone build
Jonas Devlieghere [Wed, 17 Jul 2019 19:36:20 +0000 (19:36 +0000)]
[CMake] Remove duplicated logic to find Python when doing a standalone build

I'm pretty sure there's no need to have this logic living in
LLDBStandalone. It doesn't appear anything in LLVM depends on this, and
We always go through LLDBConfig.cmake which has the canonical way to
find the Python libs and interpreter for LLDB.

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

llvm-svn: 366363

5 years ago[CMake] Use LLVM_DIR and Clang_DIR for standalone builds.
Jonas Devlieghere [Wed, 17 Jul 2019 19:24:15 +0000 (19:24 +0000)]
[CMake] Use LLVM_DIR and Clang_DIR for standalone builds.

When doing a standalone build, without setting LLDB_PATH_TO_LLVM_BUILD
or LLDB_PATH_TO_CLANG_BUILD, you get the following error.

```
CMake Error at cmake/modules/LLDBStandalone.cmake:23 (find_package):
  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

  Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
  "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
  provides a separate development package or SDK, be sure it has been
  installed.
```

This suggests setting LLVM_DIR to LLVM's install directory. However,
LLDBStandalone.cmake takes LLDB_PATH_TO_LLVM_BUILD as its hint. As
someone who isn't familiar with the standalone process, this is rather
confusing. This patch removes LLDB_PATH_TO_LLVM_BUILD and
LLDB_PATH_TO_CLANG_BUILD and instead use LLVM_DIR and Clang_DIR
respectively.

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

llvm-svn: 366362

5 years agoBasic MTE stack tagging instrumentation.
Evgeniy Stepanov [Wed, 17 Jul 2019 19:24:12 +0000 (19:24 +0000)]
Basic MTE stack tagging instrumentation.

Summary:
Use MTE intrinsics to tag stack variables in functions with
sanitize_memtag attribute.

Reviewers: pcc, vitalybuka, hctim, ostannard

Subscribers: srhines, mgorny, javed.absar, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 366361

5 years agoBasic codegen for MTE stack tagging.
Evgeniy Stepanov [Wed, 17 Jul 2019 19:24:02 +0000 (19:24 +0000)]
Basic codegen for MTE stack tagging.

Implement IR intrinsics for stack tagging. Generated code is very
unoptimized for now.

Two special intrinsics, llvm.aarch64.irg.sp and llvm.aarch64.tagp are
used to implement a tagged stack frame pointer in a virtual register.

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

llvm-svn: 366360

5 years ago[libc++] XFAIL a test that does not behave properly on older Clang
Louis Dionne [Wed, 17 Jul 2019 18:54:29 +0000 (18:54 +0000)]
[libc++] XFAIL a test that does not behave properly on older Clang

rdar://53015486

llvm-svn: 366359

5 years ago[lld][WebAssembly] Fix handling of comdat functions in init array.
Sam Clegg [Wed, 17 Jul 2019 18:43:36 +0000 (18:43 +0000)]
[lld][WebAssembly] Fix handling of comdat functions in init array.

When hidden symbols are discarded by comdat rules we still want to
create a local defined symbol, otherwise `Symbol::isDiscarded()` relies
on begin able to check `getChunk->discarded`.

This is a followup on rL362769. The comdat.ll test was previously GC'ing
the `__wasm_call_ctors` functions so `do_init` was not actually being
included in the link.  Once that function was included in triggered the
crash bug that this change addresses.

Fixes: https://github.com/emscripten-core/emscripten/issues/8981

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

llvm-svn: 366358

5 years ago[OPENMP]Fix PR42632: crash on the analysis of the OpenMP constructs.
Alexey Bataev [Wed, 17 Jul 2019 18:03:39 +0000 (18:03 +0000)]
[OPENMP]Fix PR42632: crash on the analysis of the OpenMP constructs.

Fixed processing of the CapturedStmt children to fix the crash of the
OpenMP constructs during analysis.

llvm-svn: 366357

5 years ago[dotest] Disable color while testing.
Jonas Devlieghere [Wed, 17 Jul 2019 17:56:57 +0000 (17:56 +0000)]
[dotest] Disable color while testing.

Disable colors so we don't risk having unexpected ANSI codes in the test
output. Currently, the behavior of a test can change depending on
whether it's run under a color-supporting terminal, or under a dummy
terminal, for example when using lit or multiprocessing.

llvm-svn: 366356

5 years agoRevert [AArch64] Add support for Transactional Memory Extension (TME)
Momchil Velikov [Wed, 17 Jul 2019 17:43:32 +0000 (17:43 +0000)]
Revert [AArch64] Add support for Transactional Memory Extension (TME)

This reverts r366322 (git commit 4b8da3a503e434ddbc08ecf66582475765f449bc)

llvm-svn: 366355

5 years ago[clang-tidy] Exclude forward decls from fuchsia-multiple-inheritance
Julie Hockett [Wed, 17 Jul 2019 17:40:53 +0000 (17:40 +0000)]
[clang-tidy] Exclude forward decls from fuchsia-multiple-inheritance

Addresses b39770.

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

llvm-svn: 366354

5 years ago[clang-tidy] Fix crash on end location inside macro
Nathan Huckleberry [Wed, 17 Jul 2019 17:22:43 +0000 (17:22 +0000)]
[clang-tidy] Fix crash on end location inside macro

Summary:
Lexer::getLocForEndOfToken is defined to return an
invalid location if the given location is inside a macro.
Other checks conditionally warn based off location
validity. Updating this check to do the same.

Reviewers: JonasToth, aaron.ballman, nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: lebedev.ri, nickdesaulniers, xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 366353

5 years ago[Test] Add module cache for TestWeakSymbols
Jonas Devlieghere [Wed, 17 Jul 2019 17:22:29 +0000 (17:22 +0000)]
[Test] Add module cache for TestWeakSymbols

Explicitly set the module cache in the Makefile with
-fmodules-cache-path.

llvm-svn: 366352

5 years ago[Docs][OpenCL] Documentation of C++ for OpenCL mode
Anastasia Stulova [Wed, 17 Jul 2019 17:21:31 +0000 (17:21 +0000)]
[Docs][OpenCL] Documentation of C++ for OpenCL mode

Added documentation of C++ for OpenCL mode into Clang
User Manual and Language Extensions document.

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

llvm-svn: 366351

5 years ago[CMake] Avoid liblldb genex when figuring out the copy destination for framework...
Stefan Granitz [Wed, 17 Jul 2019 17:14:40 +0000 (17:14 +0000)]
[CMake] Avoid liblldb genex when figuring out the copy destination for framework tools

This genex created an order-only dependency to liblldb for every framework tool. It reduced build throughput in the first half of the compilation and pulled in unnecessary build units, e.g. debugserver required ~900 build units. With this change debugserver is (again) down at 52 build units!

llvm-svn: 366350

5 years ago[OPENMP] Resolve lost LoopTripCnt for subsequent loops in same thread.
Ron Lieberman [Wed, 17 Jul 2019 17:07:52 +0000 (17:07 +0000)]
[OPENMP] Resolve lost LoopTripCnt for subsequent loops in same thread.

Remove loopTripCnt from threaded device stack after consuming it.
Added a libomptarget DP message to aid in future debugging and to
validate the added testcase, which only runs in Debug build.

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

llvm-svn: 366349

5 years ago[AMDGPU] Tune inlining parameters for AMDGPU target
Daniil Fukalov [Wed, 17 Jul 2019 16:51:29 +0000 (16:51 +0000)]
[AMDGPU] Tune inlining parameters for AMDGPU target

Summary:
Since the target has no significant advantage of vectorization,
vector instructions bous threshold bonus should be optional.

amdgpu-inline-arg-alloca-cost parameter default value and the target
InliningThresholdMultiplier value tuned then respectively.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

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

llvm-svn: 366348

5 years ago[lldb] Make log for ClangModulesDeclVendor's compiler flag less verbose
Raphael Isemann [Wed, 17 Jul 2019 16:51:16 +0000 (16:51 +0000)]
[lldb] Make log for ClangModulesDeclVendor's compiler flag less verbose

Summary:
Currently the ClangModulesDeclVendor is spamming the expression log with the compiler flags it is using, which creates a log that looks like this:

```
clang

 -fmodules

 -fimplicit-module-maps
```

This patch removes all these newlines and just prints the compiler flags in one line as you see in the command line:

```
clang -fmodules -fimplicit-module-maps [...]
```

Reviewers: shafik, davide

Reviewed By: davide

Subscribers: davide, abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 366347

5 years ago[CMake] Move standalone check so we don't have to reconfigure LLDB
Jonas Devlieghere [Wed, 17 Jul 2019 16:47:02 +0000 (16:47 +0000)]
[CMake] Move standalone check so we don't have to reconfigure LLDB

By moving the standalone check into the main CMake file, the whole file
is ignored in a regular (non-standalone) build. This means that you can
make changes to LLDBStandalone.cmake without having to reconfigure a
build in a different directory. This matters when you share one source
repository with different build directories (e.g. release-assert, debug,
standalone).

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

llvm-svn: 366346

5 years ago[NativePDB] Add a FromCompilerDecl for going from lldb -> clang
Nathan Lanza [Wed, 17 Jul 2019 16:43:36 +0000 (16:43 +0000)]
[NativePDB] Add a FromCompilerDecl for going from lldb -> clang

Summary:
A common transformation in NativePDB is to go from lldb types to clang
types and vice versa. This function automates one of those steps.

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

llvm-svn: 366345

5 years ago[ORC] Add deprecation warnings to ORCv1 layers and utilities.
Lang Hames [Wed, 17 Jul 2019 16:40:52 +0000 (16:40 +0000)]
[ORC] Add deprecation warnings to ORCv1 layers and utilities.

Summary:
ORCv1 is deprecated. The current aim is to remove it before the LLVM 10.0
release. This patch adds deprecation attributes to the ORCv1 layers and
utilities to warn clients of the change.

Reviewers: dblaikie, sgraenitz, AlexDenisov

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 366344

5 years ago[RISCV] Revert r366331 as it exposed some sanitizer failures
Alex Bradbury [Wed, 17 Jul 2019 16:14:52 +0000 (16:14 +0000)]
[RISCV] Revert r366331 as it exposed some sanitizer failures

See <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/33612>.

llvm-svn: 366343

5 years ago[ASan] Support `{f}puts(NULL)` on Darwin
Julian Lettner [Wed, 17 Jul 2019 16:09:25 +0000 (16:09 +0000)]
[ASan] Support `{f}puts(NULL)` on Darwin

On Darwin, the man page states that "both fputs() and puts() print
`(null)' if str is NULL."

rdar://48227136

Reviewed By: Lekensteyn

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

llvm-svn: 366342

5 years agoRemove REQUIRES OMP spec version within lit tests
Jonathan Peyton [Wed, 17 Jul 2019 15:41:00 +0000 (15:41 +0000)]
Remove REQUIRES OMP spec version within lit tests

This is a follow up patch to D64534 (r365963) which removed all OMP
spec versioning within the OpenMP runtime codebase.  This patch removes
REQUIRES: openmp-x.y lines from lit tests.

llvm-svn: 366341

5 years agoAMDGPU: Use getTargetConstant
Matt Arsenault [Wed, 17 Jul 2019 15:35:36 +0000 (15:35 +0000)]
AMDGPU: Use getTargetConstant

Avoids creating an extra intermediate mov.

llvm-svn: 366340

5 years agoFix MSVC 'implicitly capture' compile error. NFCI.
Simon Pilgrim [Wed, 17 Jul 2019 15:31:53 +0000 (15:31 +0000)]
Fix MSVC 'implicitly capture' compile error. NFCI.

llvm-svn: 366339

5 years ago[clangd] Type hierarchy: don't resolve parents if the client only asked for children
Nathan Ridge [Wed, 17 Jul 2019 15:26:49 +0000 (15:26 +0000)]
[clangd] Type hierarchy: don't resolve parents if the client only asked for children

Summary: Also reorganize the code for computing supertypes to make it more symmetric to subtypes.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 366338

5 years ago[clang-tidy] Adjust location of namespace comment diagnostic
Ilya Biryukov [Wed, 17 Jul 2019 15:22:14 +0000 (15:22 +0000)]
[clang-tidy] Adjust location of namespace comment diagnostic

Summary:
If there is no comment, place it at the closing brace of a namespace
definition. Previously it was placed at the next character after the
closing brace.

The new position produces a better location for highlighting in clangd
and does not seem to make matters worse for clang-tidy.

Reviewers: alexfh, hokein

Reviewed By: alexfh, hokein

Subscribers: xazax.hun, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 366337

5 years ago[OPENMP]Fix crash in LoopCounterRefChecker when MemberExpr is not Var or Field
Mike Rice [Wed, 17 Jul 2019 15:18:45 +0000 (15:18 +0000)]
[OPENMP]Fix crash in LoopCounterRefChecker when MemberExpr is not Var or Field

checkDecl is only valid for VarDecls or FieldDecls, since getCanonicalDecl
expects only these. Prevent other Decl kinds (such as CXXMethodDecls and
EnumConstantDecls) from entering and asserting.

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

llvm-svn: 366336

5 years ago[Attributor] Deduce "willreturn" function attribute
Hideto Ueno [Wed, 17 Jul 2019 15:15:43 +0000 (15:15 +0000)]
[Attributor] Deduce "willreturn" function attribute

Summary:
Deduce the "willreturn" attribute for functions.

For now, intrinsics are not willreturn. More annotation will be done in another patch.

Reviewers: jdoerfert

Subscribers: jvesely, nhaehnle, nicholas, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 366335

5 years ago[llvm-ar][test] Add tests failing on Darwin
Owen Reynolds [Wed, 17 Jul 2019 15:10:02 +0000 (15:10 +0000)]
[llvm-ar][test] Add tests failing on Darwin

These tests that failed on Darwin but passed on other machines due to the default archive format differing
on a Darwin machine, and what looks to be bugs in the output of this format.
I can not investigate these issue further so the tests are considered expected failures on Darwin.

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

llvm-svn: 366334

5 years ago[lld] Add Visual Studio compatible diagnostics
Chris Jackson [Wed, 17 Jul 2019 14:54:02 +0000 (14:54 +0000)]
[lld] Add Visual Studio compatible diagnostics

Summary:
Add a --vs-diagnostics flag that alters the format of diagnostic output
to enable source hyperlinks in Visual Studio.

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

Reviewed by: ruiu

llvm-svn: 366333

5 years ago[ASTImporter] Fix structural eq of lambdas
Gabor Marton [Wed, 17 Jul 2019 14:40:09 +0000 (14:40 +0000)]
[ASTImporter] Fix structural eq of lambdas

Summary:
The structural equivalence check reported false eq between lambda classes
with different parameters in their call signature.
The solution is to check the methods for equality too in case of lambda
classes.

Reviewers: a_sidorin, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 366332

5 years ago[RISCV] Add RISCV to LLVM_ALL_TARGETS so it s built by default
Alex Bradbury [Wed, 17 Jul 2019 14:32:25 +0000 (14:32 +0000)]
[RISCV] Add RISCV to LLVM_ALL_TARGETS so it s built by default

This follows the RFC <http://lists.llvm.org/pipermail/llvm-dev/2019-July/133724.html>.

Follow-on commits will add appropriate release notes changes etc.

Pushing this now and in a minimal form so there is reasonable time before 9.0
branches to resolve any issues arising from e.g. the backend being exposed on
different sanitizer setups.

The current builder for RISC-V is on the staging build-bot
<http://lab.llvm.org:8014/builders/llvm-riscv-linux>, however with the RISCV
backend being built by default it won't provide any real additional coverage.
We will shortly set up a builder that runs the test-suite in qemu-user.

llvm-svn: 366331

5 years ago[RISCV][NFC] Remove outdated TODO from test/CodeGen/RISCV/dwarf-eh.ll
Alex Bradbury [Wed, 17 Jul 2019 14:04:48 +0000 (14:04 +0000)]
[RISCV][NFC] Remove outdated TODO from test/CodeGen/RISCV/dwarf-eh.ll

llvm-svn: 366330

5 years ago[AsmPrinter] Make the encoding of call sites in .gcc_except_table configurable and...
Alex Bradbury [Wed, 17 Jul 2019 14:00:35 +0000 (14:00 +0000)]
[AsmPrinter] Make the encoding of call sites in .gcc_except_table configurable and use for RISC-V

The original behavior was to always emit the offsets to each call site in the
call site table as uleb128 values, however on some architectures (eg RISCV)
these uleb128 offsets into the code cannot always be resolved until link time
(because relaxation will invalidate any calculated offsets), and there are no
appropriate relocations for uleb128 values. As a consequence it needs to be
possible to specify an alternative.

This also switches RISCV to use DW_EH_PE_udata4 for call side encodings in
.gcc_except_table

Differential Revision: https://reviews.llvm.org/D63415
Patch by Edward Jones.

llvm-svn: 366329

5 years agoMips: Remove immarg from copy and insert intrinsics
Matt Arsenault [Wed, 17 Jul 2019 13:55:01 +0000 (13:55 +0000)]
Mips: Remove immarg from copy and insert intrinsics

These intrinsics do in fact work with non-constant index arguments.

These are lowered to either the generic
ISD::INSERT_VECTOR_ELT/ISD::EXTRACT_VECTOR_ELT, or to
VEXTRACT_SEXT_ELT. The handling of these all accept variable
indexes. Turning these into generic instructions which do allow
variables introduces complications in a future change to immarg
handling.

Since these just turn into generic instructions, these are kind of
pointless and should probably just be autoupgraded to
extractelement/insertelement.

llvm-svn: 366328

5 years ago[RISCV] Set correct encodings for DWARF exception handling
Alex Bradbury [Wed, 17 Jul 2019 13:54:38 +0000 (13:54 +0000)]
[RISCV] Set correct encodings for DWARF exception handling

This patch sets correct encodings for DWARF exception handling for RISC-V
(other than call site encoding, which must be udata4 rather than uleb128 and
is handled by D63415).

This has the same intend as D63409, except this version matches GCC/binutils
behaviour which uses the same encodings regardless of PIC/non-PIC and
medlow/medany code model.

llvm-svn: 366327

5 years ago[RISCV][NFC] Add tests that capture current encodings for DWARF EH
Alex Bradbury [Wed, 17 Jul 2019 13:48:49 +0000 (13:48 +0000)]
[RISCV][NFC] Add tests that capture current encodings for DWARF EH

Items which are known to be wrong/different vs GCC are marked as TODO and will
be address in follow-up patches.

llvm-svn: 366326

5 years ago[ASTImporter] Fix LLDB lookup in transparent ctx and with ext src
Gabor Marton [Wed, 17 Jul 2019 13:47:46 +0000 (13:47 +0000)]
[ASTImporter] Fix LLDB lookup in transparent ctx and with ext src

Summary:
With LLDB we use localUncachedLookup(), however, that fails to find
Decls when a transparent context is involved and the given DC has
external lexical storage.  The solution is to use noload_lookup, which
works well with transparent contexts.  But, we cannot use only the
noload_lookup since the slow case of localUncachedLookup is still needed
in some other cases.

These other cases are handled in ASTImporterLookupTable, but we cannot
use that with LLDB since that traverses through the AST which initiates
the load of external decls again via DC::decls().

We must avoid loading external decls during the import becuase
ExternalASTSource is implemented with ASTImporter, so external loads
during import results in uncontrolled and faulty import.

Reviewers: shafik, teemperor, jingham, clayborg, a_sidorin, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits, lldb-commits

Tags: #clang, #lldb

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

llvm-svn: 366325

5 years ago[llvm-ar][test] \r\n -> \n
Fangrui Song [Wed, 17 Jul 2019 13:40:42 +0000 (13:40 +0000)]
[llvm-ar][test] \r\n -> \n

Also simplify some empty output tests with 'count 0'

llvm-svn: 366324

5 years ago[AMDGPU] Optimize atomic AND/OR/XOR
Jay Foad [Wed, 17 Jul 2019 13:40:03 +0000 (13:40 +0000)]
[AMDGPU] Optimize atomic AND/OR/XOR

Summary: Extend the atomic optimizer to handle AND, OR and XOR.

Reviewers: arsenm, sheredom

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 366323

5 years ago[AArch64] Add support for Transactional Memory Extension (TME)
Momchil Velikov [Wed, 17 Jul 2019 13:23:27 +0000 (13:23 +0000)]
[AArch64] Add support for Transactional Memory Extension (TME)

TME is a future architecture technology, documented in

https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools
https://developer.arm.com/docs/ddi0601/a

More about the future architectures:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture

This patch adds support for the TME instructions TSTART, TTEST, TCOMMIT, and
TCANCEL and the target feature/arch extension "tme".

It also implements TME builtin functions, defined in ACLE Q2 2019
(https://developer.arm.com/docs/101028/latest)

Patch by Javed Absar and Momchil Velikov

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

llvm-svn: 366322

5 years ago[clangd] Force the required interpretation of #import on windows tests.
Sam McCall [Wed, 17 Jul 2019 13:21:25 +0000 (13:21 +0000)]
[clangd] Force the required interpretation of #import on windows tests.

Summary: NFC but should fix a bunch of tests.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 366321