]> granicus.if.org Git - clang/log
clang
6 years agoRevert "This diff includes changes for supporting the following types."
Leonard Chan [Sat, 2 Jun 2018 03:27:13 +0000 (03:27 +0000)]
Revert "This diff includes changes for supporting the following types."

This reverts commit r333814, which fails for a test checking the bit
width on ubuntu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333815 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoThis diff includes changes for supporting the following types.
Leonard Chan [Sat, 2 Jun 2018 02:58:51 +0000 (02:58 +0000)]
This diff includes changes for supporting the following types.

```

// Primary fixed point types
signed short _Accum s_short_accum;
signed _Accum s_accum;
signed long _Accum s_long_accum;
unsigned short _Accum u_short_accum;
unsigned _Accum u_accum;
unsigned long _Accum u_long_accum;

// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;

```

This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches.

The tests included are for asserting that we can declare these types.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333814 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Support LLD for CLANG_ORDER_FILE
Shoaib Meenai [Sat, 2 Jun 2018 01:22:39 +0000 (01:22 +0000)]
[cmake] Support LLD for CLANG_ORDER_FILE

LLD also supports order files using the `--symbol-ordering-file` option.
As the name would suggest, the order file format is slightly different
from gold; gold's order files specify section names, whereas LLD's
specify symbol names. Assuming you have an order file in the correct
format though, we should support using it with LLD.

Switch the check to actually use LLVM's linker detection rather than
just checking for the presence of the gold executable, since we might
have a gold executable present but be using LLD (or bfd for that matter)
as our linker.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333810 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Use LLVM's check_linker_flag
Shoaib Meenai [Sat, 2 Jun 2018 00:49:54 +0000 (00:49 +0000)]
[cmake] Use LLVM's check_linker_flag

LLVM already defines this function, so make use of it instead of rolling
our own.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333808 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd Features.def to module map
Eric Fiselier [Fri, 1 Jun 2018 22:51:59 +0000 (22:51 +0000)]
Add Features.def to module map

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333802 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCap "voluntary" vector alignment at 16 for all Darwin platforms.
John McCall [Fri, 1 Jun 2018 21:34:26 +0000 (21:34 +0000)]
Cap "voluntary" vector alignment at 16 for all Darwin platforms.

This fixes two major problems:
- We were not capping vector alignment as desired on 32-bit ARM.
- We were using different alignments based on the AVX settings on
  Intel, so we did not have a consistent ABI.

This is an ABI break, but we think we can get away with it because
vectors tend to be used mostly in inline code (which is why not having
a consistent ABI has not proven disastrous on Intel).

Intel's AVX types are specified as having 32-byte / 64-byte alignment,
so align them explicitly instead of relying on the base ABI rule.
Note that this sort of attribute is stripped from template arguments
in template substitution, so there's a possibility that code templated
over vectors will produce inadequately-aligned objects.  The right
long-term solution for this is for alignment attributes to be
interpreted as true qualifiers and thus preserved in the canonical type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333791 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Rewrite avx512vbmi unmasked and maskz macro intrinsics to be wrappers around...
Craig Topper [Fri, 1 Jun 2018 18:26:35 +0000 (18:26 +0000)]
[X86] Rewrite avx512vbmi unmasked and maskz macro intrinsics to be wrappers around their __builtin function with appropriate arguments rather than just passing arguments to the masked intrinsic.

This is more consistent with all of our other avx512 macro intrinsics.

It also fixes a bad cast where an argument was casted to mmask8 when it should have been a mmask16.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333778 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Coverage] Remove a test dependency on the itanium ABI
Vedant Kumar [Fri, 1 Jun 2018 17:11:18 +0000 (17:11 +0000)]
[Coverage] Remove a test dependency on the itanium ABI

This should address a bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/9994/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333775 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove redundant -fno-coverage-mapping added in r333761 (already added in r333423)
Nico Weber [Fri, 1 Jun 2018 15:02:43 +0000 (15:02 +0000)]
Remove redundant -fno-coverage-mapping added in r333761 (already added in r333423)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333762 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoclang-cl: Expose -no-canonical-prefixes
Nico Weber [Fri, 1 Jun 2018 14:59:57 +0000 (14:59 +0000)]
clang-cl: Expose -no-canonical-prefixes

-no-canonical-prefixes is a weird flag: In gcc, it controls whether realpath()
is called on the path of the driver binary. It's needed to support some
usecases where gcc is symlinked to, see
https://gcc.gnu.org/ml/gcc/2011-01/msg00429.html for some background.

In clang, the resource dir is found relative to the compiler binary, and
without -no-canonical-prefixes that's an absolute path. For clang, the main use
case for -no-canonical-prefixes is to make the -resource-dir path added by the
driver relative instead of absolute. Making it relative seems like the better
default, but since neither clang not gcc have -canonical-prefixes without no-
which makes changing the default tricky, and since some symlink behaviors do
depend on the realpath() call at least for gcc, just expose
-no-canonical-prefixes in clang-cl mode.

Alternatively we could default to no-canonical-prefix-mode for clang-cl since
it's less likely to be used in symlinked scenarios, but since you already need
to about -no-canonical-prefixes for the non-clang-cl bits of your build, not
hooking this of driver mode seems better to me.

https://reviews.llvm.org/D47480

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333761 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OpenMP] Fix typo in NVPTX linker, NFC.
Jonas Hahnfeld [Fri, 1 Jun 2018 14:43:48 +0000 (14:43 +0000)]
[OpenMP] Fix typo in NVPTX linker, NFC.

Clang calls "nvlink" for linking multiple object files with OpenMP
target functions, so correct this information when printing errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333757 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix unused variable warning from r333718
Erich Keane [Fri, 1 Jun 2018 14:16:18 +0000 (14:16 +0000)]
Fix unused variable warning from r333718

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333752 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file
Erich Keane [Fri, 1 Jun 2018 13:04:26 +0000 (13:04 +0000)]
[OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

Compiler crashes when omp simd is used in an OpenCL file:

clang -c -fopenmp omp_simd.cl

__kernel void test(global int *data, int size) {
#pragma omp simd
  for (int i = 0; i < size; ++i) {
  }
}

The problem seems to be the check added to verify block pointers have
initializers. An OMPCapturedExprDecl is created to capture ‘size’ but there is
no TypeSourceInfo.

The change just uses getType() directly.

Patch-By: mikerice
Differential Revision: https://reviews.llvm.org/D46667

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333746 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeComplete] Add a few extra tests for r333538. NFC
Ilya Biryukov [Fri, 1 Jun 2018 09:49:53 +0000 (09:49 +0000)]
[CodeComplete] Add a few extra tests for r333538. NFC

From a follow-up discussion in D44480.
New tests check that function bodies are not skipped:
- In presence of ptr declarators, e.g. `auto**`.
- When `decltype(auto)` is used in return type, only `auto` was checked before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333735 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove leftover semicolons at end of macros
Martin Storsjo [Fri, 1 Jun 2018 09:40:50 +0000 (09:40 +0000)]
[X86] Remove leftover semicolons at end of macros

This was missed in a few places in SVN r333613, causing compilation
errors if these macros are used e.g. as parameter to a function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333734 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] NFC: Track all constructed objects in a single state trait.
Artem Dergachev [Fri, 1 Jun 2018 01:59:48 +0000 (01:59 +0000)]
[analyzer] NFC: Track all constructed objects in a single state trait.

ExprEngine already maintains three internal program state traits to track
path-sensitive information related to object construction: pointer returned by
operator new, and pointer to temporary object for two different purposes - for
destruction and for lifetime extension. We'll need to add 2-3 more in a few
follow-up commits.

Merge these traits into one because they all essentially serve one purpose and
work similarly.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333719 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Modules] Warning for module declarations lacking 'framework' qualifier
Bruno Cardoso Lopes [Fri, 1 Jun 2018 01:26:18 +0000 (01:26 +0000)]
[Modules] Warning for module declarations lacking 'framework' qualifier

When a module declaration for a framework lacks the 'framework'
qualifier, the listed headers aren't found (because there's no
trigger for the special framework style path lookup) and the module
is silently not built. This leads to frameworks not being modularized
by accident, which is pretty bad.

Add a warning and suggest the user to add the 'framework' qualifier
when we can prove that it's the case.

rdar://problem/39193062

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333718 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Hide new Wasm EH behind its feature flag
Heejin Ahn [Fri, 1 Jun 2018 01:01:37 +0000 (01:01 +0000)]
[WebAssembly] Hide new Wasm EH behind its feature flag

Summary:
clang's current wasm EH implementation is a non-MVP feature in progress.
We had a `-mexception-handling` wasm feature but were not using it. This
patch hides the non-MVP wasm EH behind a flag, so it does not affect
other code for now.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333716 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Coverage] End deferred regions before labels, fixes PR35867
Vedant Kumar [Fri, 1 Jun 2018 00:37:13 +0000 (00:37 +0000)]
[Coverage] End deferred regions before labels, fixes PR35867

A deferred region should end before the start of a label, and should not
extend to the start of the label sub-statement.

Fixes llvm.org/PR35867.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333715 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Update to the new names for the memory builtin functions.
Dan Gohman [Fri, 1 Jun 2018 00:05:51 +0000 (00:05 +0000)]
[WebAssembly] Update to the new names for the memory builtin functions.

The WebAssembly committee has decided on the names `memory.size` and
`memory.grow` for the memory intrinsics, so update the clang builtin
functions to follow those names, keeping both sets of old names in place
for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333712 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] fix bug with 1-bit APSInt types in Z3ConstraintManager
Dominic Chen [Thu, 31 May 2018 22:23:07 +0000 (22:23 +0000)]
[analyzer] fix bug with 1-bit APSInt types in Z3ConstraintManager

Summary: Clang does not have a corresponding QualType for a 1-bit APSInt, so use the BoolTy and extend the APSInt. Split from D35450. Fixes PR37622.

Reviewers: george.karpenkov, NoQ

Subscribers: mikhail.ramalho, xazax.hun, szepet, rnkovacs, cfe-commits, a.sidorin

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333704 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Use Windows EH instructions for Wasm EH
Heejin Ahn [Thu, 31 May 2018 22:18:13 +0000 (22:18 +0000)]
[WebAssembly] Use Windows EH instructions for Wasm EH

Summary:
Because wasm control flow needs to be structured, using WinEH
instructions to support wasm EH brings several benefits. This patch
makes wasm EH uses Windows EH instructions, with some changes:
1. Because wasm uses a single catch block to catch all C++ exceptions,
   this merges all catch clauses into a single catchpad, within which we
   test the EH selector as in Itanium EH.
2. Generates a call to `__clang_call_terminate` in case a cleanup
   throws. Wasm does not have a runtime to handle this.
3. In case there is no catch-all clause, inserts a call to
   `__cxa_rethrow` at the end of a catchpad in order to unwind to an
   enclosing EH scope.

Reviewers: majnemer, dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333703 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix null MSInheritanceAttr deref in CXXRecordDecl::getMSInheritanceModel()
Reid Kleckner [Thu, 31 May 2018 18:42:29 +0000 (18:42 +0000)]
Fix null MSInheritanceAttr deref in CXXRecordDecl::getMSInheritanceModel()

Ensure latest MPT decl has a MSInheritanceAttr when instantiating
templates, to avoid null MSInheritanceAttr deref in
CXXRecordDecl::getMSInheritanceModel().

See PR#37399 for repo / details.

Patch by Andrew Rogers!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333680 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Annotate ProgramState update methods with LLVM_NODISCARD.
Artem Dergachev [Thu, 31 May 2018 18:30:41 +0000 (18:30 +0000)]
[analyzer] Annotate ProgramState update methods with LLVM_NODISCARD.

Because our program states are immutable, methods like "add<>", "set<>", "bind"
create a copy of the program state instead of mutating the existing state.
If the updated state is discarded, it clearly indicates a bug.
Such bugs are introduced frequently, hence the warn_unused_result annotation.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333679 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoIRGen: Write .dwo files when -split-dwarf-file is used together with -fthinlto-index.
Peter Collingbourne [Thu, 31 May 2018 18:25:59 +0000 (18:25 +0000)]
IRGen: Write .dwo files when -split-dwarf-file is used together with -fthinlto-index.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333677 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Improve performance of the SVal simplification mechanism further.
Artem Dergachev [Thu, 31 May 2018 17:27:28 +0000 (17:27 +0000)]
[analyzer] Improve performance of the SVal simplification mechanism further.

Memoize simplification so that we didn't need to simplify the same symbolic
expression twice within the same program state.

Gives ~25% performance boost on the artificial test in test/Analysis/hangs.c.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333671 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Improve performance of the SVal simplification mechanism.
Artem Dergachev [Thu, 31 May 2018 17:22:38 +0000 (17:22 +0000)]
[analyzer] Improve performance of the SVal simplification mechanism.

When neither LHS nor RHS of a binary operator expression can be simplified,
return the original expression instead of re-evaluating the binary operator.

Such re-evaluation was causing recusrive re-simplification which caused
the algorithmic complexity to explode.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333670 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd dump method for selectors
Aditya Kumar [Thu, 31 May 2018 14:45:32 +0000 (14:45 +0000)]
Add dump method for selectors

Differential Revision: https://reviews.llvm.org/D45935
Reviewers: compnerd

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333657 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd a new driver mode to dump compiler feature and extension options.
Aaron Ballman [Thu, 31 May 2018 13:57:09 +0000 (13:57 +0000)]
Add a new driver mode to dump compiler feature and extension options.

Add the ability to dump compiler option-related information to a JSON file via the -compiler-options-dump option. Specifically, it dumps the features/extensions lists -- however, this output could be extended to other information should it be useful. In order to support features and extensions, I moved them into a .def file so that we could build the various lists we care about from them without a significant increase in maintenance burden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333653 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Clean up tmp files when deleting Compilation objects
David Stenberg [Thu, 31 May 2018 09:05:22 +0000 (09:05 +0000)]
[Driver] Clean up tmp files when deleting Compilation objects

Summary:
In rL327851 the createUniqueFile() and createTemporaryFile()
variants that do not return the file descriptors were changed to
create empty files, rather than only check if the paths are free.
This change was done in order to make the functions race-free.

That change led to clang-tidy (and possibly other tools) leaving
behind temporary assembly files, of the form placeholder-*, when
using a target that does not support the internal assembler.

The temporary files are created when building the Compilation
object in stripPositionalArgs(), as a part of creating the
compilation database for the arguments after the double-dash. The
files are created by Driver::GetNamedOutputPath().

Fix this issue by cleaning out temporary files at the deletion of
Compilation objects.

This fixes https://bugs.llvm.org/show_bug.cgi?id=37091.

Reviewers: klimek, sepavloff, arphaman, aaron.ballman, john.brawn, mehdi_amini, sammccall, bkramer, alexfh, JDevlieghere

Reviewed By: aaron.ballman, JDevlieghere

Subscribers: erichkeane, lebedev.ri, Ka-Ka, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333637 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Make 512-bit unmasked load/store builtins more like their 128/256-bit equivalents.
Craig Topper [Thu, 31 May 2018 05:02:08 +0000 (05:02 +0000)]
[X86] Make 512-bit unmasked load/store builtins more like their 128/256-bit equivalents.

Previously we were just passing -1 mask to the masked builtin. This changes it to the more generic way that the 128/256 bit use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333626 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix wrong intrinsic semantic.
Tim Shen [Thu, 31 May 2018 01:51:07 +0000 (01:51 +0000)]
[X86] Fix wrong intrinsic semantic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333617 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix some places where macro arguments to intrinsics weren't cast to _m512(i...
Craig Topper [Thu, 31 May 2018 01:24:40 +0000 (01:24 +0000)]
[X86] Fix some places where macro arguments to intrinsics weren't cast to _m512(i|d)/_m256(i|d/_m128(i|d) first.

The majority of the cases were correct. This fixes the few that weren't.

I also removed some superfluous parentheses in non-macros that confused by attempts at grepping for missing casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333615 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove __extension__ from macro intrinsics when its not needed.
Craig Topper [Thu, 31 May 2018 00:51:20 +0000 (00:51 +0000)]
[X86] Remove __extension__ from macro intrinsics when its not needed.

I think this is a holdover from when we used to declare variables inside the macros. And then its been copy and pasted forward for years every time a new macro intrinsic gets added.

Interestingly this caused some tests for IRGen to be slightly more optimized. We now return a zeroinitializer directly instead of going through a store+load.

It also removed a bogus error message on another test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333613 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Trust _Nonnull annotations, and trust analyzer knowledge about receiver...
George Karpenkov [Thu, 31 May 2018 00:28:13 +0000 (00:28 +0000)]
[analyzer] Trust _Nonnull annotations, and trust analyzer knowledge about receiver nullability

Previously, the checker was using the nullability of the expression,
which is nonnull IFF both receiver and method are annotated as _Nonnull.
However, the receiver could be known to the analyzer to be nonnull
without being explicitly marked as _Nonnull.

rdar://40635584

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333612 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Coverage] Discard the last uncompleted deferred region in a decl
Vedant Kumar [Wed, 30 May 2018 23:35:44 +0000 (23:35 +0000)]
[Coverage] Discard the last uncompleted deferred region in a decl

Discard the last uncompleted deferred region in a decl, if one exists.
This prevents lines at the end of a function containing only whitespace
or closing braces from being marked as uncovered, if they follow a
region terminator (return/break/etc).

The previous behavior was to heuristically complete deferred regions at
the end of a decl. In practice this ended up being too brittle for too
little gain. Users would complain that there was no way to reach full
code coverage because whitespace at the end of a function would be
marked uncovered.

rdar://40238228

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333609 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[www] Update C++ status to cover P0620.
Richard Smith [Wed, 30 May 2018 23:30:36 +0000 (23:30 +0000)]
[www] Update C++ status to cover P0620.

While here, mark three-way comparison as in progress and bump "Clang 6" items from yellow to green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333606 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use C style comments in intrinsic headers for overall consistency.
Craig Topper [Wed, 30 May 2018 22:33:21 +0000 (22:33 +0000)]
[X86] Use C style comments in intrinsic headers for overall consistency.

Most of the origial comments used C style /* */ comments, but some C++ // comments had snuck in over time.

Still need to convert all the doxygen comments. Which is much harder to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333603 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoIRGen: Rename bitsets -> type metadata. NFC.
Peter Collingbourne [Wed, 30 May 2018 22:29:08 +0000 (22:29 +0000)]
IRGen: Rename bitsets -> type metadata. NFC.

"Type metadata" is the term that we've been using for the CFI-related
information on vtables for a while now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333602 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAST: Remove an unused ctor. NFC.
Peter Collingbourne [Wed, 30 May 2018 22:14:17 +0000 (22:14 +0000)]
AST: Remove an unused ctor. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333600 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPR37631: verify that a member deduction guide has the same access as its template.
Richard Smith [Wed, 30 May 2018 22:13:43 +0000 (22:13 +0000)]
PR37631: verify that a member deduction guide has the same access as its template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333599 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAST: Remove an unused function. NFC.
Peter Collingbourne [Wed, 30 May 2018 22:10:07 +0000 (22:10 +0000)]
AST: Remove an unused function. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333598 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd fopen to the list of builtins that we check and whitelist.
Eric Christopher [Wed, 30 May 2018 21:11:45 +0000 (21:11 +0000)]
Add fopen to the list of builtins that we check and whitelist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333594 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add __extension__ to a bunch of places in our intrinsic headers that fail if...
Craig Topper [Wed, 30 May 2018 21:08:27 +0000 (21:08 +0000)]
[X86] Add __extension__ to a bunch of places in our intrinsic headers that fail if you run it through -pedantic -ansi.

All of these are lines that create a 'compound literal' to concatenate elements together.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333593 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPR34520: after instantiating a non-templated member deduction guide, don't forget...
Richard Smith [Wed, 30 May 2018 20:24:10 +0000 (20:24 +0000)]
PR34520: after instantiating a non-templated member deduction guide, don't forget to push it into the class scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333589 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAs discussed with SG10, bump version of __cpp_deduction_guides macro to indicate...
Richard Smith [Wed, 30 May 2018 19:54:52 +0000 (19:54 +0000)]
As discussed with SG10, bump version of __cpp_deduction_guides macro to indicate support for P0620R0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333587 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AST] Fix loss of enum forward decl from decl context
Joel E. Denny [Wed, 30 May 2018 18:33:53 +0000 (18:33 +0000)]
[AST] Fix loss of enum forward decl from decl context

For example, given:

  enum __attribute__((deprecated)) T *p;

-ast-print produced:

  enum T *p;

The attribute was lost because the enum forward decl was lost.

Another example is the loss of enum forward decls from C++ namespaces
(in MS compatibility mode).

The trouble was that the EnumDecl node was suppressed, as revealed by
-ast-dump.  The suppression of the EnumDecl was intentional in
r116122, but I don't understand why.  The suppression isn't needed for
the test suite to behave.

Reviewed by: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333574 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Simplify the implementation of _mm_sqrt_ss, _mm_rcp_ss, and _mm_rsqrt_ss.
Craig Topper [Wed, 30 May 2018 18:27:07 +0000 (18:27 +0000)]
[X86] Simplify the implementation of _mm_sqrt_ss, _mm_rcp_ss, and _mm_rsqrt_ss.

We don't need the insertion back into the original vector at the end. The builtin already understands that.

This is different than _mm_sqrt_sd which takes two arguments and we do need to insert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333572 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Reduce the number of setzero intrinsics to just the set defined by the Intel...
Craig Topper [Wed, 30 May 2018 18:02:11 +0000 (18:02 +0000)]
[X86] Reduce the number of setzero intrinsics to just the set defined by the Intel Intrinsics Guide.

We had quite a few for different element sizes of integers sometimes with strange target features attached to them.

We only need a single version for each of _m128i, _m256i, and _m512i with the target feature that first introduced those types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333568 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove 'return' from a bunch of intrinsics that return void and use a builtin...
Craig Topper [Wed, 30 May 2018 17:23:45 +0000 (17:23 +0000)]
[X86] Remove 'return' from a bunch of intrinsics that return void and use a builtin that returns void.

Found by running the intrinsic headers through -pedantic -ansi.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333563 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Lowering FMA intrinsics to native IR (Clang part)
Gabor Buella [Wed, 30 May 2018 15:27:49 +0000 (15:27 +0000)]
[X86] Lowering FMA intrinsics to native IR (Clang part)

This patch replaces all packed (and scalar without rounding
mode) fused intrinsics with fmadd/fmaddsub variations.
Then fmadd/fmaddsub are lowered to native IR.

Patch by tkrupa

Reviewers: craig.topper, sroland, spatel, RKSimon

Reviewed By: craig.topper

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333555 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[clang-format/ObjC] Correctly parse Objective-C methods with 'class' in name
Ben Hamilton [Wed, 30 May 2018 15:21:38 +0000 (15:21 +0000)]
[clang-format/ObjC] Correctly parse Objective-C methods with 'class' in name

Summary:
Please take a close look at this CL. I haven't touched much of
`UnwrappedLineParser` before, so I may have gotten things wrong.

Previously, clang-format would incorrectly format the following:

```
@implementation Foo

- (Class)class {
}

- (void)foo {
}

@end
```

as:

```
@implementation Foo

- (Class)class {
}

    - (void)foo {
}

@end
```

The problem is whenever `UnwrappedLineParser::parseStructuralElement()`
sees any of the keywords `class`, `struct`, or `enum`, it calls
`parseRecord()` to parse them as a C/C++ record.

This causes subsequent lines to be parsed incorrectly, which
causes them to be indented incorrectly.

In Objective-C/Objective-C++, these keywords are valid selector
components.

This diff fixes the issue by explicitly handling `+` and `-` lines
inside `@implementation` / `@interface` / `@protocol` blocks
and parsing them as Objective-C methods.

Test Plan: New tests added. Ran tests with:
  make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, klimek

Reviewed By: jolesiak, klimek

Subscribers: klimek, cfe-commits, Wizard

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333553 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Update NRVO logic to support early return"
Sam McCall [Wed, 30 May 2018 14:14:58 +0000 (14:14 +0000)]
Revert "Update NRVO logic to support early return"

This reverts commit r333500, which causes stage2 compiler crashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333547 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[clang-format] Fix putting ObjC message arguments in one line for multiline...
Jacek Olesiak [Wed, 30 May 2018 12:57:58 +0000 (12:57 +0000)]
Revert "[clang-format] Fix putting ObjC message arguments in one line for multiline receiver"

Summary:
This reverts commit db9e5e9a616d7fdd4d1ba4c3b2cd89d8a0238533 (rC333171).

Mentioned change introduced unintended formatting of ObjC code due to split priorities inherited from C/C++, e.g.:
```
fooooooo = [
    [obj fooo] aaa:42 aaa:42];
```
instead of
```
fooooooo =
    [[obj fooo] aaa:42
                aaa:42];
```
when formatted with ColumnLimit = 30.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: benhamilton, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333539 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sema] Don't skip function bodies with 'auto' without trailing return type
Ilya Biryukov [Wed, 30 May 2018 12:50:48 +0000 (12:50 +0000)]
[Sema] Don't skip function bodies with 'auto' without trailing return type

Summary:
Skipping them was clearly not intentional. It's impossible to
guarantee correctness if the bodies are skipped.
Also adds a test case for r327504, now that it does not produce
invalid errors that made the test fail.

Reviewers: aaron.ballman, sammccall, rsmith

Reviewed By: rsmith

Subscribers: rayglover-ibm, rwols, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333538 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Reland "Move #include manipulation code to new lib/Tooling/Inclusions.""
Eric Liu [Wed, 30 May 2018 12:09:58 +0000 (12:09 +0000)]
Revert "Reland "Move #include manipulation code to new lib/Tooling/Inclusions.""

This reverts commit r333532. Revert for now to fix an internal bot issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333534 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReland "Move #include manipulation code to new lib/Tooling/Inclusions."
Eric Liu [Wed, 30 May 2018 11:51:48 +0000 (11:51 +0000)]
Reland "Move #include manipulation code to new lib/Tooling/Inclusions."

This reverts commit r332751 (i.e. reland r332720) after fixing module
build.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333532 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Remove the redundant check about same state transition in `ArrayBoundCheck...
Henry Wong [Wed, 30 May 2018 11:46:45 +0000 (11:46 +0000)]
[analyzer] Remove the redundant check about same state transition in `ArrayBoundCheckerV2.cpp`.

Summary: Since the `addTransitionImpl()` has a check about same state transition, there is no need to check it in `ArrayBoundCheckerV2.cpp`.

Reviewers: NoQ, xazax.hun, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, a.sidorin, cfe-commits, MTC

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333531 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a (possible) division by zero check in the CmpRuns script
Mikhail R. Gadelha [Wed, 30 May 2018 11:17:55 +0000 (11:17 +0000)]
Fix a (possible) division by zero check in the CmpRuns script

I missed updating the check in r333375

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333529 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ASTImporter] Corrected lookup at import of templated record decl
Gabor Marton [Wed, 30 May 2018 09:19:26 +0000 (09:19 +0000)]
[ASTImporter] Corrected lookup at import of templated record decl

Summary:
When a CXXRecordDecl under ClassTemplateDecl is imported, check
the templated record decl for similarity instead of the template.

Reviewers: a.sidorin

Reviewed By: a.sidorin

Subscribers: martong, cfe-commits

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

Patch by Balazs Keri!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333522 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd missing curly from r333509
Hans Wennborg [Wed, 30 May 2018 08:05:24 +0000 (08:05 +0000)]
Add missing curly from r333509

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333515 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix -Wunused in NDEBUG introduced by HIP r333484
Sam McCall [Wed, 30 May 2018 08:03:43 +0000 (08:03 +0000)]
Fix -Wunused in NDEBUG introduced by HIP r333484

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333514 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport __iso_volatile_load8 etc on aarch64-win32.
Simon Tatham [Wed, 30 May 2018 07:54:05 +0000 (07:54 +0000)]
Support __iso_volatile_load8 etc on aarch64-win32.

These intrinsics are used by MSVC's header files on AArch64 Windows as
well as AArch32, so we should support them for both targets. I've
factored them out of CodeGenFunction::EmitARMBuiltinExpr into separate
functions that EmitAArch64BuiltinExpr can call as well.

Reviewers: javed.absar, mstorsjo

Reviewed By: mstorsjo

Subscribers: kristof.beyls, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333513 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sparc] Add floating-point register names
Daniel Cederman [Wed, 30 May 2018 06:02:18 +0000 (06:02 +0000)]
[Sparc] Add floating-point register names

Reviewers: jyknight

Reviewed By: jyknight

Subscribers: eraman, fedor.sergeev, jrtc27, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333510 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove masking from the AVX512VNNI builtins. Use a select in IR instead.
Craig Topper [Wed, 30 May 2018 05:26:04 +0000 (05:26 +0000)]
[X86] Remove masking from the AVX512VNNI builtins. Use a select in IR instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333509 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoProtect a clang-cl file path with --.
Peter Collingbourne [Wed, 30 May 2018 04:08:34 +0000 (04:08 +0000)]
Protect a clang-cl file path with --.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333501 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate NRVO logic to support early return
Taiju Tsuiki [Wed, 30 May 2018 03:53:16 +0000 (03:53 +0000)]
Update NRVO logic to support early return

Summary:
The previous implementation misses an opportunity to apply NRVO (Named Return Value
Optimization) below. That discourages user to write early return code.

```
struct Foo {};

Foo f(bool b) {
  if (b)
    return Foo();
  Foo oo;
  return oo;
}
```
That is, we can/should apply RVO for a local variable if:
 * It's directly returned by at least one return statement.
 * And, all reachable return statements in its scope returns the variable directly.
While, the previous implementation disables the RVO in a scope if there are multiple return
statements that refers different variables.

On the new algorithm, local variables are in NRVO_Candidate state at first, and a return
statement changes it to NRVO_Disabled for all visible variables but the return statement refers.
Then, at the end of the function AST traversal, NRVO is enabled for variables in NRVO_Candidate
state and refers from at least one return statement.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: xbolva00, Quuxplusone, arthur.j.odwyer, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333500 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSema: Add a flag for rejecting member pointers with incomplete base types.
Peter Collingbourne [Wed, 30 May 2018 03:40:04 +0000 (03:40 +0000)]
Sema: Add a flag for rejecting member pointers with incomplete base types.

Codebases that need to be compatible with the Microsoft ABI can pass
this flag to avoid issues caused by the lack of a fixed ABI for
incomplete member pointers.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333498 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix the names of a bunch of icelake intrinsics.
Craig Topper [Wed, 30 May 2018 03:38:15 +0000 (03:38 +0000)]
[X86] Fix the names of a bunch of icelake intrinsics.

Mostly this fixes the names of all the 128-bit intrinsics to start with _mm_ instead of _mm128_ as is the convention and what the Intel docs say.

This also fixes the name of the bitshuffle intrinsics to say epi64 for 128 and 256 bit versions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333497 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix test failure after r333485. Try 2.
Eric Fiselier [Wed, 30 May 2018 02:20:40 +0000 (02:20 +0000)]
Fix test failure after r333485. Try 2.

Sorry for the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333491 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake the mangled name collision diagnostic a bit more useful by listing the mangling.
Richard Smith [Wed, 30 May 2018 01:52:16 +0000 (01:52 +0000)]
Make the mangled name collision diagnostic a bit more useful by listing the mangling.

This helps especially when the collision is for a template specialization,
where the template arguments are not available from anywhere else in the
diagnostic, and are likely relevant to the problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333489 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix test failure after r333485.
Eric Fiselier [Wed, 30 May 2018 01:22:14 +0000 (01:22 +0000)]
Fix test failure after r333485.

I missed adjusting a test under Misc in the last commit.
This patch updates that test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333488 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ODRHash] Support FunctionTemplateDecl in records.
Richard Trieu [Wed, 30 May 2018 01:12:26 +0000 (01:12 +0000)]
[ODRHash] Support FunctionTemplateDecl in records.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333486 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Sema] Use %sub to cleanup overload diagnostics
Eric Fiselier [Wed, 30 May 2018 01:00:41 +0000 (01:00 +0000)]
[Sema] Use %sub to cleanup overload diagnostics

Summary:
This patch adds the newly added `%sub` diagnostic modifier to cleanup repetition in the overload candidate diagnostics.

I think this should be good to go.

@rsmith: Some of the notes now emit `function template` where they only said `function` previously. It seems OK to me, but I would like your sign off on it.

Reviewers: rsmith, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333485 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd HIP toolchain
Yaxun Liu [Wed, 30 May 2018 00:53:50 +0000 (00:53 +0000)]
Add HIP toolchain

This patch adds HIP toolchain to support HIP language mode. It includes:

Create specific compiler jobs for HIP.

Choose specific libraries for HIP.

With contribution from Greg Rodgers.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333484 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd action builder for HIP
Yaxun Liu [Wed, 30 May 2018 00:49:10 +0000 (00:49 +0000)]
Add action builder for HIP

To support separate compile/link and linking across device IR in different source files,
a new HIP action builder is introduced. Basically it compiles/links host and device
code separately, and embed fat binary in host linking stage through linker script.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333483 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r332839.
Richard Smith [Wed, 30 May 2018 00:45:10 +0000 (00:45 +0000)]
Revert r332839.

This is causing miscompiles and "definition with same mangled name as another
definition" errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333482 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCheck pointer null-ness before dereferencing it.
Richard Trieu [Tue, 29 May 2018 22:43:00 +0000 (22:43 +0000)]
Check pointer null-ness before dereferencing it.

-Warc-repeated-use-of-weak may trigger a segmentation fault when the Decl
being checked is outside of a function scope, leaving the current function
info pointer null.  This adds a check before using the function info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333471 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Driver] Rename DefaultTargetTriple to TargetTriple
Petr Hosek [Tue, 29 May 2018 22:35:39 +0000 (22:35 +0000)]
[Driver] Rename DefaultTargetTriple to TargetTriple

While this value is initialized with the DefaultTargetTriple, it
can be later overriden using the -target flag so TargetTriple is
a more accurate name. This change also provides an accessor which
could be accessed from ToolChain implementations.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333468 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen][Darwin] Set the calling-convention of thread-local variable
Akira Hatanaka [Tue, 29 May 2018 18:28:49 +0000 (18:28 +0000)]
[CodeGen][Darwin] Set the calling-convention of thread-local variable
initialization functions to 'cxx_fast_tlscc'.

This fixes a bug where instructions calling initialization functions for
thread-local static members of c++ template classes were using calling
convention 'cxx_fast_tlscc' while the called functions weren't annotated
with the calling convention.

rdar://problem/40447463

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333447 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Tag some 128/256 load/store instructions as requiring avx512vl instead of avx512f.
Craig Topper [Tue, 29 May 2018 18:23:22 +0000 (18:23 +0000)]
[X86] Tag some 128/256 load/store instructions as requiring avx512vl instead of avx512f.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333446 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoadd test for r332053
Nico Weber [Tue, 29 May 2018 14:48:30 +0000 (14:48 +0000)]
add test for r332053

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333423 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] const init: handle non-explicit cases more accurately
Rafael Stahl [Tue, 29 May 2018 14:14:22 +0000 (14:14 +0000)]
[analyzer] const init: handle non-explicit cases more accurately

Summary: If the access is out of bounds, return UndefinedVal. If it is missing an explicit init, return the implicit zero value it must have.

Reviewers: NoQ, xazax.hun, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, a.sidorin, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333417 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix emission of phony dependency targets when adding extra deps
David Stenberg [Tue, 29 May 2018 13:07:58 +0000 (13:07 +0000)]
Fix emission of phony dependency targets when adding extra deps

Summary:
This commit fixes a bug where passing extra dependency entries
(using -fdepfile-entry) would result in -MP incorrectly emitting
a phony target for the input file, and no phony target for the
first extra dependency.

The extra dependencies are added first to the filename vector in
DFGImpl. That clashed with the emission of the phony targets, as
the code assumed that the first index always correspond to the
input file.

Reviewers: rsmith, pcc, krasin, bruno, vsapsai

Reviewed By: vsapsai

Subscribers: vsapsai, bruno, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333413 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTesting commit access with whitespace change.
Rafael Stahl [Tue, 29 May 2018 08:12:15 +0000 (08:12 +0000)]
Testing commit access with whitespace change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333396 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Merge the 3 different flavors of masked vpermi2var/vpermt2var builtins to a...
Craig Topper [Tue, 29 May 2018 03:26:38 +0000 (03:26 +0000)]
[X86] Merge the 3 different flavors of masked vpermi2var/vpermt2var builtins to a single version without masking. Use select builtins with appropriate operand instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333387 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Add -mrelax/-mno-relax flags to enable/disable RISCV linker relaxation
Shiva Chen [Tue, 29 May 2018 00:44:15 +0000 (00:44 +0000)]
[RISCV] Add -mrelax/-mno-relax flags to enable/disable RISCV linker relaxation

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333385 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[coroutines] Pass implicit object parameter to promise ctor (fix BUG37604)
Gor Nishanov [Mon, 28 May 2018 18:08:47 +0000 (18:08 +0000)]
[coroutines] Pass implicit object parameter to promise ctor (fix BUG37604)

Summary:
Complete the implementation of p0914r1.
Implicit object parameter should be passed to a promise constructor.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=37604
Reviewers: modocache, rsmith, lewissbaker

Reviewed By: modocache

Subscribers: cfe-commits, EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333379 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoIntroduces --stats-only option to only show changes in statistics.
Mikhail R. Gadelha [Mon, 28 May 2018 15:40:39 +0000 (15:40 +0000)]
Introduces --stats-only option to only show changes in statistics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333375 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Fix typo. NFC
Fangrui Song [Sun, 27 May 2018 07:23:04 +0000 (07:23 +0000)]
[DebugInfo] Fix typo. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333352 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r333347 "[X86] Rewrite the max and min reduction intrinsics to make better...
Craig Topper [Sat, 26 May 2018 18:57:41 +0000 (18:57 +0000)]
Revert r333347 "[X86] Rewrite the max and min reduction intrinsics to make better use of other functions and to reduce width to 256 and 128 bits were possible."

This wasn't supposed to be commited yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333349 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove mask from avx512ifma builtins. Use a select instruction instead.
Craig Topper [Sat, 26 May 2018 18:55:26 +0000 (18:55 +0000)]
[X86] Remove mask from avx512ifma builtins. Use a select instruction instead.

This reduces from 12 builtins to 6 since we no longer need a mask and maskz version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333348 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Rewrite the max and min reduction intrinsics to make better use of other functi...
Craig Topper [Sat, 26 May 2018 18:55:24 +0000 (18:55 +0000)]
[X86] Rewrite the max and min reduction intrinsics to make better use of other functions and to reduce width to 256 and 128 bits were possible.

Summary:
We only need to use 512 bit vectors all the way through v8i64 reductions since those max instructions are new to avx512f and only available in 512 bits until SKX.

For v16i32 and floating point we have legacy 128/256 bit instructions we can use.

I've tried to use other intrinsics to reduce the verbosity of the code and avoid having to mention all the shuffles. I've also removed all the -1 shuffle indices so the output sequence is fully specified and not left to backend optimization.

Reviewers: RKSimon, spatel, GBuella

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333347 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ClangDiagnostics] Silence warning about fallthrough after PrintFatalError
David Bolvansky [Sat, 26 May 2018 09:24:00 +0000 (09:24 +0000)]
[ClangDiagnostics] Silence warning about fallthrough after PrintFatalError

Summary:
ClangDiagnosticsEmitter.cpp:1047:57: warning: this statement may fall through [-Wimplicit-fallthrough=]
       Builder.PrintFatalError("Unknown modifier type: " + Modifier);
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
ClangDiagnosticsEmitter.cpp:1048:5: note: here
     case MT_Select: {
                   ^

Reviewers: rsmith, rtrieu

Reviewed By: rtrieu

Subscribers: rtrieu, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333340 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTest commit; please ignore.
George Burgess IV [Sat, 26 May 2018 02:29:14 +0000 (02:29 +0000)]
Test commit; please ignore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333333 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[analyzer] Add security checks for bcmp(), bcopy(), bzero().
Artem Dergachev [Sat, 26 May 2018 00:04:26 +0000 (00:04 +0000)]
[analyzer] Add security checks for bcmp(), bcopy(), bzero().

These functions are obsolete. The analyzer would advice to replace them with
memcmp(), memcpy() or memmove(), or memset().

Patch by Tom Rix!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333326 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix typo + reflow comment; NFC
George Burgess IV [Fri, 25 May 2018 23:40:59 +0000 (23:40 +0000)]
Fix typo + reflow comment; NFC

Reflow brings said comment below 80 cols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333324 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add const to another builtin that was missed from r331814.
Craig Topper [Fri, 25 May 2018 22:52:29 +0000 (22:52 +0000)]
[X86] Add const to another builtin that was missed from r331814.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333321 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Correct the target features on two avx512bw builtins that were incorrectly...
Craig Topper [Fri, 25 May 2018 22:43:20 +0000 (22:43 +0000)]
[X86] Correct the target features on two avx512bw builtins that were incorrectly labeled as avx512f.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333320 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[DebugInfo] Don't bother with MD5 checksums of preprocessed files."
Paul Robinson [Fri, 25 May 2018 22:35:59 +0000 (22:35 +0000)]
Revert "[DebugInfo] Don't bother with MD5 checksums of preprocessed files."

This reverts commit d734f2aa3f76fbf355ecd2bbe081d0c1f49867ab.
Also known as r333311.  A very small but nonzero number of bots fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333319 91177308-0d34-0410-b5e6-96231b3b80d8