]> granicus.if.org Git - clang/log
clang
6 years ago[Sema] Fix -Wcomma in dependent context
Richard Trieu [Wed, 24 Oct 2018 02:07:41 +0000 (02:07 +0000)]
[Sema] Fix -Wcomma in dependent context

When there is a dependent type inside a cast, the CastKind becomes CK_Dependent
instead of CK_ToVoid.  This fix will check that there is a dependent cast,
the original type is dependent, and the target type is void to ignore the cast.

https://bugs.llvm.org/show_bug.cgi?id=39375

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

6 years agoDebug Info (-gmodules): emit full types for non-anchored template specializations
Adrian Prantl [Wed, 24 Oct 2018 00:06:02 +0000 (00:06 +0000)]
Debug Info (-gmodules): emit full types for non-anchored template specializations

Before this patch, clang would emit a (module-)forward declaration for
template instantiations that are not anchored by an explicit template
instantiation, but still are guaranteed to be available in an imported
module. Unfortunately detecting the owning module doesn't reliably
work when local submodule visibility is enabled and the template is
inside a cross-module namespace.

This make clang debuggable again with -gmodules and LSV enabled.

rdar://problem/41552377

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

6 years ago[analyzer] [NFC] Change scanReachableSymbols to use ranges
George Karpenkov [Tue, 23 Oct 2018 23:12:12 +0000 (23:12 +0000)]
[analyzer] [NFC] Change scanReachableSymbols to use ranges

Remove unused overload. Clean up some usages.

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

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

6 years ago[analyzer] Do not stop tracking CXX methods touching OSObject.
George Karpenkov [Tue, 23 Oct 2018 23:11:50 +0000 (23:11 +0000)]
[analyzer] Do not stop tracking CXX methods touching OSObject.

Trust generalized annotations for OSObject.

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

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

6 years ago[analyzer] Trust summaries for OSObject::retain and OSObject::release
George Karpenkov [Tue, 23 Oct 2018 23:11:30 +0000 (23:11 +0000)]
[analyzer] Trust summaries for OSObject::retain and OSObject::release

Refactor the way in which summaries are consumed for safeMetaCast

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

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

6 years agoNFC: Remove MANGLE_CHECKER from ItaniumMangle.cpp
Erik Pilkington [Tue, 23 Oct 2018 19:55:38 +0000 (19:55 +0000)]
NFC: Remove MANGLE_CHECKER from ItaniumMangle.cpp

This hasn't even compiled since 2011. It would be useful to have some test to
verify that ItaniumMangle and ItaniumDemangle agree, but this isn't it.

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

6 years agoChange getRedeclContext() to support enumerations as another kind of transparent...
Aaron Ballman [Tue, 23 Oct 2018 19:44:51 +0000 (19:44 +0000)]
Change getRedeclContext() to support enumerations as another kind of transparent context in C.

This change fixes PR15071 and ensures that enumerators redefined in a struct cannot conflict with enumerators defined outside of the struct.

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

6 years agoFix doxygen comment.
Adrian Prantl [Tue, 23 Oct 2018 19:39:02 +0000 (19:39 +0000)]
Fix doxygen comment.

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

6 years ago[analyzer] Rename trackNullOrUndefValue to trackExpressionValue
George Karpenkov [Tue, 23 Oct 2018 18:24:53 +0000 (18:24 +0000)]
[analyzer] Rename trackNullOrUndefValue to trackExpressionValue

trackNullOrUndefValue is a long and confusing name,
and it does not actually reflect what the function is doing.
Give a function a new name, with a relatively clear semantics.

Also remove some dead code.

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

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

6 years ago[Fixed Point Arithmetic] Fixed Point to Boolean Cast
Leonard Chan [Tue, 23 Oct 2018 17:55:35 +0000 (17:55 +0000)]
[Fixed Point Arithmetic] Fixed Point to Boolean Cast

This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split
the casting logic up into smaller patches. This contains the code for casting
from fixed point types to boolean types.

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

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

6 years ago[OpenCL] Remove PIPE_RESERVE_ID_VALID_BIT from opencl-c.h
Andrew Savonichev [Tue, 23 Oct 2018 17:05:29 +0000 (17:05 +0000)]
[OpenCL] Remove PIPE_RESERVE_ID_VALID_BIT from opencl-c.h

Summary:
PIPE_RESERVE_ID_VALID_BIT is implementation defined, so lets not keep it in the header.

Previously the topic was discussed here: https://reviews.llvm.org/D32896

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: cfe-commits, asavonic, bader

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

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

6 years ago[OpenCL] Add cl_intel_planar_yuv extension
Andrew Savonichev [Tue, 23 Oct 2018 16:13:16 +0000 (16:13 +0000)]
[OpenCL] Add cl_intel_planar_yuv extension

Just adding a preprocessor #define for the extension.

Patch by Alexey Sotkin and Dmitry Sidorov

Phabricator review: https://reviews.llvm.org/D51402

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

6 years ago[OpenCL][NFC] Unify ZeroToOCL* cast types
Andrew Savonichev [Tue, 23 Oct 2018 15:19:20 +0000 (15:19 +0000)]
[OpenCL][NFC] Unify ZeroToOCL* cast types

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: asavonic, cfe-commits

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

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

6 years ago[clang] Fix a null pointer dereference.
Kadir Cetinkaya [Tue, 23 Oct 2018 13:49:37 +0000 (13:49 +0000)]
[clang] Fix a null pointer dereference.

Summary:
Sometimes expression inside switch statement can be invalid, for
example type might be incomplete. In those cases code were causing a null
pointer dereference. This patch fixes that.

Reviewers: sammccall, ioeric, hokein

Reviewed By: sammccall

Subscribers: arphaman, cfe-commits

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

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

6 years agoRevert r345009 "[DebugInfo] Generate debug information for labels. (After fix PR39094)"
Hans Wennborg [Tue, 23 Oct 2018 13:17:13 +0000 (13:17 +0000)]
Revert r345009 "[DebugInfo] Generate debug information for labels. (After fix PR39094)"

This broke the Chromium build. See
https://bugs.chromium.org/p/chromium/issues/detail?id=898152#c1 for the
reproducer.

> Generate DILabel metadata and call llvm.dbg.label after label
> statement to associate the metadata with the label.
>
> After fixing PR37395.
> After fixing problems in LiveDebugVariables.
> After fixing NULL symbol problems in AddressPool when enabling
> split-dwarf-file.
> After fixing PR39094.
>
> Differential Revision: https://reviews.llvm.org/D45045

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

6 years ago[AST] Do not align virtual bases in `MicrosoftRecordLayoutBuilder` when
Aleksandr Urakov [Tue, 23 Oct 2018 08:23:22 +0000 (08:23 +0000)]
[AST] Do not align virtual bases in `MicrosoftRecordLayoutBuilder` when
      an external layout is used

Summary:
The patch removes alignment of virtual bases when an external layout is used.
We have two cases:
- the external layout source has an information about virtual bases offsets,
  so we just use them;
- the external source has no information about virtual bases offsets. In this
  case we can't predict where the base will be located. If we will align it but
  there will be something like `#pragma pack(push, 1)` really, then likely our
  layout will not fit into the real structure size, and then some asserts will
  hit. The asserts look reasonable, so I don't think that we need to remove
  them. May be it would be better instead don't align fields / bases etc.
  (so treat it always as `#pragma pack(push, 1)`) when an external layout source
  is used but no info about a field location is presented.

This one is related to D49871

Reviewers: rnk, rsmith, zturner, mstorsjo, majnemer

Reviewed By: rnk

Subscribers: cfe-commits

Tags: #clang

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

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

6 years ago[DebugInfo] Generate debug information for labels. (After fix PR39094)
Hsiangkai Wang [Tue, 23 Oct 2018 08:06:21 +0000 (08:06 +0000)]
[DebugInfo] Generate debug information for labels. (After fix PR39094)

Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

After fixing PR37395.
After fixing problems in LiveDebugVariables.
After fixing NULL symbol problems in AddressPool when enabling
split-dwarf-file.
After fixing PR39094.

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

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

6 years agoRevert "[Driver] Use forward slashes in most linker arguments"
Martin Storsjo [Tue, 23 Oct 2018 07:01:55 +0000 (07:01 +0000)]
Revert "[Driver] Use forward slashes in most linker arguments"

This reverts commit r345004, as it broke tests when actually run
on windows; see e.g.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/763.

This broke tests that had captured a variable containing a path
with backslashes, which failed to match cases in the output
where the path separators had been changed into forward slashes.

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

6 years ago[Driver] Use forward slashes in most linker arguments
Martin Storsjo [Tue, 23 Oct 2018 06:33:26 +0000 (06:33 +0000)]
[Driver] Use forward slashes in most linker arguments

libtool inspects the output of $CC -v to detect what object files and
libraries are linked in by default. When clang is built as a native
windows executable, all paths are formatted with backslashes, and
the backslashes cause each argument to be enclosed in quotes. The
backslashes and quotes break further processing within libtool (which
is implemented in shell script, running in e.g. msys) pretty badly.

Between unix style pathes (that only work in tools that are linked
to the msys runtime, essentially the same as cygwin) and proper windows
style paths (with backslashes, that can easily break shell scripts
and msys environments), the best compromise is to use windows style
paths (starting with e.g. c:) but with forward slashes, which both
msys based tools, shell scripts and native windows executables can
cope with. This incidentally turns out to be the form of paths that
GCC prints out when run with -v on windows as well.

This change potentially makes the output from clang -v a bit more
inconsistent, but it is isn't necessarily very consistent to begin with.

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

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

6 years ago[MinGW] Link to correct openmp library
Martin Storsjo [Tue, 23 Oct 2018 06:33:22 +0000 (06:33 +0000)]
[MinGW] Link to correct openmp library

Patch by Peiyuan Song!

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

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

6 years agoAdd gfx904 and gfx906 to GPU Arch
Yaxun Liu [Tue, 23 Oct 2018 02:05:31 +0000 (02:05 +0000)]
Add gfx904 and gfx906 to GPU Arch

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

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

6 years ago[analyzer] [NFC] Correct comment on RetainSummaryManager
George Karpenkov [Tue, 23 Oct 2018 01:31:08 +0000 (01:31 +0000)]
[analyzer] [NFC] Correct comment on RetainSummaryManager

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

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

6 years ago[analyzer] [www] Drop references to GC mode, which was deprecated years ago
George Karpenkov [Tue, 23 Oct 2018 01:30:45 +0000 (01:30 +0000)]
[analyzer] [www] Drop references to GC mode, which was deprecated years ago

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

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

6 years ago[analyzer] [testing] Compute data on path length, compute percentiles
George Karpenkov [Tue, 23 Oct 2018 01:30:26 +0000 (01:30 +0000)]
[analyzer] [testing] Compute data on path length, compute percentiles

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

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

6 years ago[CodeGen] Attach InlineHint to more functions
Richard Trieu [Tue, 23 Oct 2018 01:26:28 +0000 (01:26 +0000)]
[CodeGen] Attach InlineHint to more functions

For instantiated functions, search the template pattern to see if it marked
inline to determine if InlineHint attribute should be added to the function.

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

6 years ago[X86] Remove 'rtm' feature from KNL.
Craig Topper [Tue, 23 Oct 2018 00:15:37 +0000 (00:15 +0000)]
[X86] Remove 'rtm' feature from KNL.

I'm unsure if KNL has this feature, but the backend never thought it did, only clang did. The predefined-arch-macros test lost the check for __RTM__ on KNL when it was removed Skylake CPUs in r344117.

I think we want to drop it from KNL for consistency with Skylake anyway regardless of how we got here.

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

6 years agoRevert "[Driver] Reland again: Default Android toolchains to libc++."
Dan Albert [Mon, 22 Oct 2018 21:58:22 +0000 (21:58 +0000)]
Revert "[Driver] Reland again: Default Android toolchains to libc++."

More compiler-rt test bot breakages...

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

6 years agoRevert "Ensure sanitizer check function calls have a !dbg location"
Vlad Tsyrklevich [Mon, 22 Oct 2018 21:51:58 +0000 (21:51 +0000)]
Revert "Ensure sanitizer check function calls have a !dbg location"

This reverts commit r344915. It was causing exceptions on the
x86_64-linux-ubsan bot.

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

6 years ago[Driver] fix broken test
Nick Desaulniers [Mon, 22 Oct 2018 21:25:53 +0000 (21:25 +0000)]
[Driver] fix broken test

Summary:
Fixes test from r344941 which was broken on Windows. We want to check
the selected toolchain rather than the found toolchain anyways.

Reviewers: srhines, danalbert

Reviewed By: srhines

Subscribers: cfe-commits, bogner, pirama

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

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

6 years agoGive Multiversion-inline functions linkonce linkage
Erich Keane [Mon, 22 Oct 2018 21:20:45 +0000 (21:20 +0000)]
Give Multiversion-inline functions linkonce linkage

Since multiversion variant functions can be inline, in C they become
available-externally linkage.  This ends up causing the variants to not
be emitted, and not available to the linker.

The solution is to make sure that multiversion functions are always
emitted by marking them linkonce.

Change-Id: I897aa37c7cbba0c1eb2c57ee881d5000a2113b75

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

6 years ago[Driver] Reland again: Default Android toolchains to libc++.
Dan Albert [Mon, 22 Oct 2018 20:16:21 +0000 (20:16 +0000)]
[Driver] Reland again: Default Android toolchains to libc++.

Some of the test data went missing last time I tried to submit this,
causing the tests to fail when the build did not include libc++.

Original review was https://reviews.llvm.org/D53109.

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

6 years ago[analyzer] Fix dumping for SymbolConjured conjured at no particular statement.
Artem Dergachev [Mon, 22 Oct 2018 20:11:10 +0000 (20:11 +0000)]
[analyzer] Fix dumping for SymbolConjured conjured at no particular statement.

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

6 years ago[Driver] allow Android triples to alias for non Android targets
Nick Desaulniers [Mon, 22 Oct 2018 19:48:08 +0000 (19:48 +0000)]
[Driver] allow Android triples to alias for non Android targets

Summary:
Partial revert of r330873 ('[Driver] Reland "Android triples are not
aliases for other triples."')

While we don't want `-target *-linux-android` to alias to non
*-linux-android libs and binaries, it turns out we do want the
opposite. Ie. We would like for `-target *-linux-gnu` to still be
able to use *-android libs and binaries.

In fact, this is used to cross assemble and link the Linux kernel for
Android devices.

`-target *-linux-gnu` needs to be used for the Linux kernel when
using the android binutils prebuilts (*-linux-android).

The use of `-target *-linux-android` on C source files will cause
Clang to perform optimizations based on the presence of bionic (due to
r265481 ('Faster stack-protector for Android/AArch64.')) which is
invalid within the Linux kernel and will produce a non-bootable kernel
image.

Of course, you could just use the standard binutils (*-linux-gnu),
but Android does not distribute these.  So this patch fixes a problem
that only occurs when cross assembling and linking a Linux kernel with
the Android provided binutils, which is what is done within Android's
build system.

Reviewers: srhines, pirama, danalbert

Reviewed By: srhines, danalbert

Subscribers: javed.absar, kristof.beyls, cfe-commits

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

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

6 years agoHopefully fix the documentation generation issue
Sylvestre Ledru [Mon, 22 Oct 2018 19:07:29 +0000 (19:07 +0000)]
Hopefully fix the documentation generation issue

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

6 years agoGenerate ClangFormatStyleOptions.rst from Format.h (using docs/tools/dump_format_styl...
Sylvestre Ledru [Mon, 22 Oct 2018 18:48:58 +0000 (18:48 +0000)]
Generate ClangFormatStyleOptions.rst from Format.h (using docs/tools/dump_format_style.py)

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

6 years ago[X86] Add new features to the priority list for target attribute multiversioning.
Craig Topper [Mon, 22 Oct 2018 17:59:58 +0000 (17:59 +0000)]
[X86] Add new features to the priority list for target attribute multiversioning.

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

6 years agoEnsure sanitizer check function calls have a !dbg location
Adrian Prantl [Mon, 22 Oct 2018 16:27:41 +0000 (16:27 +0000)]
Ensure sanitizer check function calls have a !dbg location

Function calls without a !dbg location inside a function that has a
DISubprogram make it impossible to construct inline information and
are rejected by the verifier. This patch ensures that sanitizer check
function calls have a !dbg location, by carrying forward the location
of the preceding instruction or by inserting an artificial location if
necessary.

This fixes a crash when compiling the attached testcase with -Os.

rdar://problem/45311226

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

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

6 years agoAlways search sysroot for GCC installs
David Greene [Mon, 22 Oct 2018 13:46:12 +0000 (13:46 +0000)]
Always search sysroot for GCC installs

Previously, if clang was configured with -DGCC_INSTALL_PREFIX, then it
would not search a provided sysroot for a gcc install. This caused a
number of regression tests to fail.  If a sysroot is given, skip
searching GCC_INSTALL_PREFIX as it is likely not valid for the
provided sysroot.

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

6 years agoSilence the -Wshadow warning for enumerators shadowing a type.
Aaron Ballman [Mon, 22 Oct 2018 13:05:53 +0000 (13:05 +0000)]
Silence the -Wshadow warning for enumerators shadowing a type.

Amends r344259 so that enumerators shadowing types are not diagnosed, as shadowing under those circumstances is rarely (if ever) an issue in practice.

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

6 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Mon, 22 Oct 2018 10:46:37 +0000 (10:46 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

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

6 years ago[OpenCL] Fix definitions of __builtin_(add|sub|mul)_overflow
Marco Antognini [Mon, 22 Oct 2018 10:41:07 +0000 (10:41 +0000)]
[OpenCL] Fix definitions of __builtin_(add|sub|mul)_overflow

Ensure __builtin_(add|sub|mul)_overflow return bool instead of void as per
specification (LanguageExtensions).

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

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

6 years ago[ARM][AArch64] Add LLVM_FALLTHROUGH to silence warning [NFC]
Peter Smith [Mon, 22 Oct 2018 10:40:52 +0000 (10:40 +0000)]
[ARM][AArch64] Add LLVM_FALLTHROUGH to silence warning [NFC]

A follow up to D52784 to add in LLVM_FALLTHROUGH where there is an
intentional fall through in a switch statement. This will hopefully silence
a GCC warning.

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

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

6 years ago[CodeComplete] Fix accessibility of protected members when accessing members implicitly.
Eric Liu [Mon, 22 Oct 2018 08:47:31 +0000 (08:47 +0000)]
[CodeComplete] Fix accessibility of protected members when accessing members implicitly.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

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

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

6 years ago[analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal
Kristof Umann [Sun, 21 Oct 2018 23:30:01 +0000 (23:30 +0000)]
[analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal

As rightly pointed out by @NoQ, nonloc::LazyCompoundVals were only used to acquire a constructed object's region, which isn't what LazyCompoundVal was made for.

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

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

6 years ago[analyzer][www] Update alpha_checks.html
Kristof Umann [Sun, 21 Oct 2018 22:10:15 +0000 (22:10 +0000)]
[analyzer][www] Update alpha_checks.html

I added some missing doc. I have not developed any of these checkers, it might worth really inspecting whether I wrote something terribly incorrect.

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

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

6 years ago[analyzer][NFC] Fix inconsistencies in AnalyzerOptions
Kristof Umann [Sun, 21 Oct 2018 18:19:32 +0000 (18:19 +0000)]
[analyzer][NFC] Fix inconsistencies in AnalyzerOptions

I'm in the process of refactoring AnalyzerOptions. The main motivation behind
here is to emit warnings if an invalid -analyzer-config option is given from the
command line, and be able to list them all.

This first NFC patch contains small modifications to make AnalyzerOptions.cpp a
little more consistent.

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

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

6 years ago[AST, analyzer] Transform rvalue cast outputs to lvalues (fheinous-gnu-extensions)
Aleksei Sidorin [Sat, 20 Oct 2018 22:49:23 +0000 (22:49 +0000)]
[AST, analyzer] Transform rvalue cast outputs to lvalues (fheinous-gnu-extensions)

Despite the fact that cast expressions return rvalues, GCC still
handles such outputs as lvalues when compiling inline assembler.
In this commit, we are treating it by removing LValueToRValue
casts inside GCCAsmStmt outputs.

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

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

6 years ago[X86] Add more intrinsics to match icc.
Craig Topper [Sat, 20 Oct 2018 19:28:52 +0000 (19:28 +0000)]
[X86] Add more intrinsics to match icc.

This adds
_mm_loadu_epi8, _mm256_loadu_epi8, _mm512_loadu_epi8
_mm_loadu_epi16, _mm256_loadu_epi16, _mm512_loadu_epi16
_mm_storeu_epi8, _mm256_storeu_epi8, _mm512_storeu_epi8
_mm_storeu_epi16, _mm256_storeu_epi16, _mm512_storeu_epi16

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

6 years ago[X86] Add missing intrinsics to match icc.
Craig Topper [Sat, 20 Oct 2018 19:28:50 +0000 (19:28 +0000)]
[X86] Add missing intrinsics to match icc.

This adds
_mm_and_epi32, _mm_and_epi64
_mm_andnot_epi32, _mm_andnot_epi64
_mm_or_epi32, _mm_or_epi64
_mm_xor_epi32, _mm_xor_epi64
_mm256_and_epi32, _mm256_and_epi64
_mm256_andnot_epi32, _mm256_andnot_epi64
_mm256_or_epi32, _mm256_or_epi64
_mm256_xor_epi32, _mm256_xor_epi64
_mm_loadu_epi32, _mm_loadu_epi64
_mm_load_epi32, _mm_load_epi64
_mm256_loadu_epi32, _mm256_loadu_epi64
_mm256_load_epi32, _mm256_load_epi64
_mm512_loadu_epi32, _mm512_loadu_epi64
_mm512_load_epi32, _mm512_load_epi64
_mm_storeu_epi32, _mm_storeu_epi64
_mm_store_epi32, _mm_load_epi64
_mm256_storeu_epi32, _mm256_storeu_epi64
_mm256_store_epi32, _mm256_load_epi64
_mm512_storeu_epi32, _mm512_storeu_epi64
_mm512_store_epi32,V _mm512_load_epi64

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

6 years agoUse llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC
Fangrui Song [Sat, 20 Oct 2018 17:53:42 +0000 (17:53 +0000)]
Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC

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

6 years ago[NFC][Test commit] Fix typos in a comment
Aleksei Sidorin [Sat, 20 Oct 2018 14:47:37 +0000 (14:47 +0000)]
[NFC][Test commit] Fix typos in a comment

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

6 years ago[CodeGen] Use the mangle context owned by CodeGenModule to correctly
Akira Hatanaka [Sat, 20 Oct 2018 05:45:01 +0000 (05:45 +0000)]
[CodeGen] Use the mangle context owned by CodeGenModule to correctly
mangle types of lambda objects captured by a block instead of creating a
new mangle context everytime a captured field type is mangled.

This fixes a bug in IRGen's block helper merging code that was
introduced in r339438 where two blocks capturing two distinct lambdas
would end up sharing helper functions and the block descriptor. This
happened because the ID number used to distinguish lambdas defined
in the same context is reset everytime a mangled context is created.

rdar://problem/45314494

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

6 years ago[X86] Add support for more than 32 features for __builtin_cpu_is
Craig Topper [Sat, 20 Oct 2018 03:51:52 +0000 (03:51 +0000)]
[X86] Add support for more than 32 features for __builtin_cpu_is

libgcc supports more than 32 features by adding a new 32-bit variable __cpu_features2.

This adds the clang support for checking these feature bits.

Patches for compiler-rt and llvm to support this are coming as well.

Probably still need an additional patch for target multiversioning in clang.

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

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

6 years agoMake -Wfor-loop-analysis work with C++17
Richard Trieu [Sat, 20 Oct 2018 02:15:58 +0000 (02:15 +0000)]
Make -Wfor-loop-analysis work with C++17

For now, disable the "variable in loop condition not modified" warning to not
be emitted when there is a structured binding variable in the loop condition.

https://bugs.llvm.org/show_bug.cgi?id=39285

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

6 years ago[X86] When checking the bits in cpu_features for function multiversioning dispatcher...
Craig Topper [Sat, 20 Oct 2018 01:30:00 +0000 (01:30 +0000)]
[X86] When checking the bits in cpu_features for function multiversioning dispatcher in the resolver, make sure all the required bits are set. Not just one of them

Summary:
The multiversioning code repurposed the code from __builtin_cpu_supports for checking if a single feature is enabled. That code essentially performed (_cpu_features & (1 << C)) != 0. But with the multiversioning path, the mask is no longer guaranteed to be a power of 2. So we return true anytime any one of the bits in the mask is set not just all of the bits.

The correct check is (_cpu_features & mask) == mask

Reviewers: erichkeane, echristo

Reviewed By: echristo

Subscribers: cfe-commits

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

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

6 years ago[analyzer] Be more plugin-friendly by moving static locals into .cpp files.
Artem Dergachev [Sat, 20 Oct 2018 00:29:24 +0000 (00:29 +0000)]
[analyzer] Be more plugin-friendly by moving static locals into .cpp files.

The GDMIndex functions return a pointer that's used as a key for looking up
data, but addresses of local statics defined in header files aren't the same
across shared library boundaries and the result is that analyzer plugins
can't access this data.

Event types are uniqued by using the addresses of a local static defined
in a header files, but it isn't the same across shared library boundaries
and plugins can't currently handle ImplicitNullDerefEvents.

Patches by Joe Ranieri!

Differential Revision: https://reviews.llvm.org/D52905
Differential Revision: https://reviews.llvm.org/D52906

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

6 years agoRevert "[Driver] Reland: Default Android toolchains to libc++."
Dan Albert [Fri, 19 Oct 2018 19:23:01 +0000 (19:23 +0000)]
Revert "[Driver] Reland: Default Android toolchains to libc++."

This reverts commit 84677d5009d613232d360fda27e6e41fb5cb6700.

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

6 years agoPR24164, PR39336: init-captures are not distinct full-expressions.
Richard Smith [Fri, 19 Oct 2018 19:01:34 +0000 (19:01 +0000)]
PR24164, PR39336: init-captures are not distinct full-expressions.

Rather, they are subexpressions of the enclosing lambda-expression, and
any temporaries in them are destroyed at the end of that
full-expression, or when the corresponding lambda-expression is
destroyed if they are lifetime-extended.

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

6 years agoAdd basic test that we perform lifetime extension in the expected
Richard Smith [Fri, 19 Oct 2018 19:01:31 +0000 (19:01 +0000)]
Add basic test that we perform lifetime extension in the expected
situations.

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

6 years ago[Driver] Reland: Default Android toolchains to libc++.
Dan Albert [Fri, 19 Oct 2018 18:06:02 +0000 (18:06 +0000)]
[Driver] Reland: Default Android toolchains to libc++.

The sanitizer builder that was broken by this should now be fixed.

Original review was https://reviews.llvm.org/D53109

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

6 years agoJava annotation declaration being handled correctly
Hans Wennborg [Fri, 19 Oct 2018 16:19:52 +0000 (16:19 +0000)]
Java annotation declaration being handled correctly

Previously, Java annotation declarations (@interface AnnotationName) were being
handled as ObjC interfaces. This caused the brace formatting to mess up, so
that when you had a class with an interface defined in it, it would indent the
final brace of the class.

It used to format this class like so:

  class A {
    @interface B {}
    }

But will now just skip the @interface and format it like so:

  class A {
    @interface B {}
  }

Patch by Sam Maier!

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

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

6 years ago[Hexagon] Remove support for V4
Krzysztof Parzyszek [Fri, 19 Oct 2018 15:36:45 +0000 (15:36 +0000)]
[Hexagon] Remove support for V4

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

6 years ago[ASTImporter] Removed uneeded default case label.
Balazs Keri [Fri, 19 Oct 2018 15:16:51 +0000 (15:16 +0000)]
[ASTImporter] Removed uneeded default case label.

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

6 years ago[ASTImporter] Added error handling for AST import.
Balazs Keri [Fri, 19 Oct 2018 13:32:20 +0000 (13:32 +0000)]
[ASTImporter] Added error handling for AST import.

Summary:
The goal of this change is to make the ASTImporter::Import functions return
llvm::Expected instead of the imported type.
As first part the ASTNodeImporter visit functions are updated to return with
llvm::Expected. Various `import` functions are added to ASTNodeImporter to
simplify the code and have a common place for interface towards ASTImporter
(from ASTNodeImporter). There is some temporary code that is needed before
ASTImporter is updated.

Reviewers: a.sidorin, a_sidorin, xazax.hun

Reviewed By: a_sidorin

Subscribers: dkrupp, Szelethus, rnkovacs, martong, jfb, cfe-commits

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

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

6 years ago[OpenCL] Remove unwanted signedness conversion from tests
Marco Antognini [Fri, 19 Oct 2018 09:01:37 +0000 (09:01 +0000)]
[OpenCL] Remove unwanted signedness conversion from tests

The get_kernel_* functions used in cl20-device-side-enqueue.cl all return
unsigned integers. This patch avoids undesired implicit conversions on the
returned values.

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

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

6 years ago[COFF, ARM64] Enable unit test arm64-microsoft-status-reg.cpp only for aarch64 target
Mandeep Singh Grang [Fri, 19 Oct 2018 00:05:26 +0000 (00:05 +0000)]
[COFF, ARM64] Enable unit test arm64-microsoft-status-reg.cpp only for aarch64 target

This should unbreak bots broken here:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/14391
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/38288

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

6 years ago[COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsics
Mandeep Singh Grang [Thu, 18 Oct 2018 23:35:35 +0000 (23:35 +0000)]
[COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsics

Reviewers: rnk, compnerd, mstorsjo, efriedma, TomTan, haripul, javed.absar

Reviewed By: efriedma

Subscribers: dmajor, kristof.beyls, chrib, cfe-commits

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

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

6 years ago[Test] Fix test file for C++98 mode
David Bolvansky [Thu, 18 Oct 2018 21:26:01 +0000 (21:26 +0000)]
[Test] Fix test file for C++98 mode

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

6 years ago[Diagnostics] Add missing expected warning to test file
David Bolvansky [Thu, 18 Oct 2018 21:06:14 +0000 (21:06 +0000)]
[Diagnostics] Add missing expected warning to test file

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

6 years ago[Diagnostics] Check for integer overflow in array size expressions
David Bolvansky [Thu, 18 Oct 2018 20:49:06 +0000 (20:49 +0000)]
[Diagnostics] Check for integer overflow in array size expressions

Summary: Fixes PR27439

Reviewers: rsmith, Rakete1111

Reviewed By: rsmith

Subscribers: Rakete1111, cfe-commits

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

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

6 years agoAdd check-clang-python to the Clang tests directory in IDEs; NFC.
Aaron Ballman [Thu, 18 Oct 2018 17:47:18 +0000 (17:47 +0000)]
Add check-clang-python to the Clang tests directory in IDEs; NFC.

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

6 years agoAdd language standard aliases for -std=c18, -std=gnu18, and -std=iso9899:2018.
Aaron Ballman [Thu, 18 Oct 2018 17:42:41 +0000 (17:42 +0000)]
Add language standard aliases for -std=c18, -std=gnu18, and -std=iso9899:2018.

As described in D40225, the C17 standard was balloted and approved in 2017, but the ISO publication process delayed the actual publication until 2018. WG14 considers the release to be C17 and describes it as such, but users can still be confused by the publication year which is why -std=c18 adds value. These aliases map to c17 and are all supported by GCC 8.x with the same behavior. Note that the value of __STDC_VERSION__ remains at 201710L.

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

6 years ago[X86][Tests] Make sure tls-direct-seg-refs tests only run where supported
Kristina Brooks [Thu, 18 Oct 2018 14:44:25 +0000 (14:44 +0000)]
[X86][Tests] Make sure tls-direct-seg-refs tests only run where supported

This flag is only supported for x86 targets, make sure the tests only run
for those.

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

6 years ago[OPENMP] Move OMPClausePrinter to OpenMPClause.h/OpenMPClause.cpp - NFC. Differential...
Patrick Lyster [Thu, 18 Oct 2018 14:28:23 +0000 (14:28 +0000)]
[OPENMP] Move OMPClausePrinter to OpenMPClause.h/OpenMPClause.cpp - NFC. Differential Revision: https://reviews.llvm.org/D53102

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

6 years agoAdd support for -mno-tls-direct-seg-refs to Clang
Kristina Brooks [Thu, 18 Oct 2018 14:07:02 +0000 (14:07 +0000)]
Add support for -mno-tls-direct-seg-refs to Clang

This patch exposes functionality added in rL344723 to the Clang driver/frontend
as a flag and adds appropriate metadata.

Driver tests pass:
```
ninja check-clang-driver
-snip-
  Expected Passes    : 472
  Expected Failures  : 3
  Unsupported Tests  : 65
```

Odd failure in CodeGen tests but unrelated to this:
```
ninja check-clang-codegen
-snip-
/SourceCache/llvm-trunk-8.0/tools/clang/test/CodeGen/builtins-wasm.c:87:10:
error: cannot compile this builtin function yet
-snip-
Failing Tests (1):
    Clang :: CodeGen/builtins-wasm.c

  Expected Passes    : 1250
  Expected Failures  : 2
  Unsupported Tests  : 120
  Unexpected Failures: 1
```

Original commit:
[X86] Support for the mno-tls-direct-seg-refs flag
Allows to disable direct TLS segment access (%fs or %gs). GCC supports a
similar flag, it can be useful in some circumstances, e.g. when a thread
context block needs to be updated directly from user space. More info and
specific use cases: https://bugs.llvm.org/show_bug.cgi?id=16145

Patch by nruslan (Ruslan Nikolaev).

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

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

6 years ago[TI removal] Test predicate rather than casting to detect a terminator
Chandler Carruth [Thu, 18 Oct 2018 08:16:20 +0000 (08:16 +0000)]
[TI removal] Test predicate rather than casting to detect a terminator
and use the range based successor API.

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

6 years agoAMDGPU: Add options to enable/disable code object v3
Konstantin Zhuravlyov [Wed, 17 Oct 2018 21:39:12 +0000 (21:39 +0000)]
AMDGPU: Add options to enable/disable code object v3

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

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

6 years ago[AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.
Eli Friedman [Wed, 17 Oct 2018 21:07:11 +0000 (21:07 +0000)]
[AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.

"aarch64-none-elf" is commonly used for AArch64 baremetal toolchains.

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

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

6 years agoFix for arm bots afternew PM pass port. Prevent cross compiling on arm.
Leonard Chan [Wed, 17 Oct 2018 18:12:18 +0000 (18:12 +0000)]
Fix for arm bots afternew PM pass port. Prevent cross compiling on arm.

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

6 years agoFix for failing unit tests on some bots after r344696.
Leonard Chan [Wed, 17 Oct 2018 16:21:19 +0000 (16:21 +0000)]
Fix for failing unit tests on some bots after r344696.

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

6 years ago[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitiz...
Leonard Chan [Wed, 17 Oct 2018 15:38:22 +0000 (15:38 +0000)]
[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

Enable usage of `AddressSanitizer` and `AddressModuleSanitizer` ported from the
legacy to the new PassManager.

This patch depends on https://reviews.llvm.org/D52739.

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

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

6 years agoNFC: Remove trailing space from CodeGenModule.cpp
Takuto Ikuta [Wed, 17 Oct 2018 04:29:56 +0000 (04:29 +0000)]
NFC: Remove trailing space from CodeGenModule.cpp

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

6 years ago[python] [tests] Disable on known-broken arches
Michal Gorny [Wed, 17 Oct 2018 03:05:39 +0000 (03:05 +0000)]
[python] [tests] Disable on known-broken arches

Disable the Python binding tests on AArch64, Hexagon and SystemZ
following reports on test failures.  The first two yield different
results, possibly indicating test case problems.  The last one seems
to have broken FFI in Python.

While at it, refactor the code to make adding future test restrictions
easier.

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

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

6 years agoAMDGPU: add __builtin_amdgcn_update_dpp
Yaxun Liu [Wed, 17 Oct 2018 02:32:26 +0000 (02:32 +0000)]
AMDGPU: add __builtin_amdgcn_update_dpp

Emit llvm.amdgcn.update.dpp for both __builtin_amdgcn_mov_dpp and
__builtin_amdgcn_update_dpp. The first argument to
llvm.amdgcn.update.dpp will be undef for __builtin_amdgcn_mov_dpp.

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

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

6 years ago[analyzer] [www] Minor improvements to the text in open_projects
George Karpenkov [Wed, 17 Oct 2018 01:15:53 +0000 (01:15 +0000)]
[analyzer] [www] Minor improvements to the text in open_projects

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

6 years ago[analyzer] [www] Updated a list of open projects
George Karpenkov [Wed, 17 Oct 2018 01:06:20 +0000 (01:06 +0000)]
[analyzer] [www] Updated a list of open projects

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

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

6 years agoDisable code object version 3 for HIP toolchain
Yaxun Liu [Tue, 16 Oct 2018 17:36:23 +0000 (17:36 +0000)]
Disable code object version 3 for HIP toolchain

AMDGPU backend will switch to code object version 3 by default.
Since HIP runtime is not ready, disable it until the runtime is ready.

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

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

6 years ago[SystemZ] Actually enable -mzvector keywords
Ulrich Weigand [Tue, 16 Oct 2018 14:57:20 +0000 (14:57 +0000)]
[SystemZ] Actually enable -mzvector keywords

It appears when initially committing the support for the IBM Z vector
extension language, one critical line was lost, causing the specific
keywords __vector, __bool, and vec_step to not actually be enabled.
(Note that this does not affect "vector" and "bool"!)

Unfortunately, this was not caught by any tests either.  (All existing
Z vector tests just use the regular "vector" and "bool" keywords ...)

Fixed by adding the missing line and updating the tests.

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

6 years ago[driver][mips] Support MIPS R6 target triples
Simon Atanasyan [Tue, 16 Oct 2018 14:29:27 +0000 (14:29 +0000)]
[driver][mips] Support MIPS R6 target triples

This change adds support for the following MIPS target triples:
  mipsisa32r6-linux-gnu
  mipsisa32r6el-linux-gnu
  mipsisa64r6-linux-gnuabi64
  mipsisa64r6el-linux-gnuabi64
  mipsisa64r6-linux-gnuabin32
  mipsisa64r6el-linux-gnuabin32

Patch by Yun Qiang Su.

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

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

6 years ago[driver][mips] Adjust target triple's environment accordingly to provided ABI name
Simon Atanasyan [Tue, 16 Oct 2018 10:19:06 +0000 (10:19 +0000)]
[driver][mips] Adjust target triple's environment accordingly to provided ABI name

For MIPS we need to adjust not only architecture name accordingly to ABI
provided by the `-mabi` command line option, but also modify triple's
environment. For example, for `mips-linux-gnu` triple and `-mabi=n32`
option a correct final triple is `mips64-linux-gnuabin32`.

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

6 years agoFix buildbots - update clang-interpreter to use Legacy ORC classes introduced in...
Simon Pilgrim [Tue, 16 Oct 2018 09:21:58 +0000 (09:21 +0000)]
Fix buildbots - update clang-interpreter to use Legacy ORC classes introduced in rL344572.

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

6 years ago[ARM][AArch64] Pass through endian flags to assembler and linker.
Peter Smith [Tue, 16 Oct 2018 09:21:17 +0000 (09:21 +0000)]
[ARM][AArch64] Pass through endian flags to assembler and linker.

The big-endian arm32 Linux builds are currently failing when the
-mbig-endian flag is used but the binutils default on the system is little
endian. This also holds when -mlittle-endian is used and the binutils
default is big endian.

The patch always passes through -EL or -BE to the assembler and linker,
taking into account the target and the -mbig-endian and -mlittle-endian
flag.

Fixes pr38770

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

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

6 years ago Add target requirement to profile remap test.
Yvan Roux [Tue, 16 Oct 2018 08:47:36 +0000 (08:47 +0000)]
 Add target requirement to profile remap test.

 Fix bots which don't have x86_64 target built (ARM/AArch64).

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

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

6 years ago[mips] Group similar commands in the test case. NFC
Simon Atanasyan [Tue, 16 Oct 2018 05:18:36 +0000 (05:18 +0000)]
[mips] Group similar commands in the test case. NFC

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

6 years ago[OPENMP][NVPTX]Increment iterator only when it is used, NFC.
Alexey Bataev [Tue, 16 Oct 2018 00:09:06 +0000 (00:09 +0000)]
[OPENMP][NVPTX]Increment iterator only when it is used, NFC.

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

6 years ago[mips] Fix handling of GNUABIN32 environment in a target triple
Simon Atanasyan [Mon, 15 Oct 2018 22:43:23 +0000 (22:43 +0000)]
[mips] Fix handling of GNUABIN32 environment in a target triple

The `GNUABIN32` environment in a target triple implies using the N32
ABI. This patch adds support for this environment and switches on N32
ABI if necessary.

Patch by Patch by YunQiang Su.

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

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

6 years ago[Driver] Support direct split DWARF emission for Fuchsia
Petr Hosek [Mon, 15 Oct 2018 21:30:32 +0000 (21:30 +0000)]
[Driver] Support direct split DWARF emission for Fuchsia

This enables the driver support for direct split DWARF emission for
Fuchsia in addition to Linux.

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

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

6 years ago[analyzer] Add doxygen comments for the new CXXAllocatorCall APIs.
Artem Dergachev [Mon, 15 Oct 2018 18:01:34 +0000 (18:01 +0000)]
[analyzer] Add doxygen comments for the new CXXAllocatorCall APIs.

Forgot to squeeze this into r344539.

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

6 years ago[analyzer] Teach CallEvent about C++17 aligned operator new().
Artem Dergachev [Mon, 15 Oct 2018 17:53:18 +0000 (17:53 +0000)]
[analyzer] Teach CallEvent about C++17 aligned operator new().

In C++17, when class C has large alignment value, a special case of
overload resolution rule kicks in for expression new C that causes the aligned
version of operator new() to be called. The aligned new has two arguments:
size and alignment. However, the new-expression has only one "argument":
the construct-expression for C(). This causes a false positive in
core.CallAndMessage's check for matching number of arguments and number
of parameters.

Update CXXAllocatorCall, which is a CallEvent sub-class for operator new calls
within new-expressions, so that the number of arguments always matched
the number of parameters.

rdar://problem/44738501

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

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

6 years ago[analyzer] NFC: RetainCountChecker: Don't dump() symbols into program point tags.
Artem Dergachev [Mon, 15 Oct 2018 17:47:56 +0000 (17:47 +0000)]
[analyzer] NFC: RetainCountChecker: Don't dump() symbols into program point tags.

We don't need a separate node for every symbol, because whenever the first
symbol leaks, a bug is emitted, the analysis is sinked, and the checker
callback immediately returns due to State variable turning into null,
so we never get to see the second leaking symbol.

Additionally, we are no longer able to break normal analysis while experimenting
with debug dumps.

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

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