]> granicus.if.org Git - clang/log
clang
6 years agoclang-cl: Pass /Brepro to linker if it was passed to the compiler
Nico Weber [Tue, 4 Sep 2018 18:00:14 +0000 (18:00 +0000)]
clang-cl: Pass /Brepro to linker if it was passed to the compiler

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

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

6 years agoFix the -print-multi-directory flag to print the selected multilib.
Christian Bruel [Tue, 4 Sep 2018 15:22:13 +0000 (15:22 +0000)]
Fix the -print-multi-directory flag to print the selected multilib.

Summary: Fix -print-multi-directory to print the selected multilib

Reviewers: jroelofs

Reviewed By: jroelofs

Subscribers: srhines, cfe-commits

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

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

6 years agoAdding HardLink Support to VirtualFileSystem.
Ilya Biryukov [Tue, 4 Sep 2018 14:15:53 +0000 (14:15 +0000)]
Adding HardLink Support to VirtualFileSystem.

Summary:
Added support of creating a hardlink from one file to another file.
After a hardlink is added between two files, both file will have the same:
  1. UniqueID (inode)
  2. Size
  3. Buffer

This will bring replay of compilation closer to the actual compilation. There are instances where clang checks for the UniqueID of the file/header to be loaded which leads to a different behavior during replay as all files have different UniqueIDs.

Patch by Utkarsh Saxena!

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

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

6 years ago[x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative
Chandler Carruth [Tue, 4 Sep 2018 12:38:00 +0000 (12:38 +0000)]
[x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative
Load Hardening.

Wires up the existing pass to work with a proper IR attribute rather
than just a hidden/internal flag. The internal flag continues to work
for now, but I'll likely remove it soon.

Most of the churn here is adding the IR attribute. I talked about this
Kristof Beyls and he seemed at least initially OK with this direction.
The idea of using a full attribute here is that we *do* expect at least
some forms of this for other architectures. There isn't anything
*inherently* x86-specific about this technique, just that we only have
an implementation for x86 at the moment.

While we could potentially expose this as a Clang-level attribute as
well, that seems like a good question to defer for the moment as it
isn't 100% clear whether that or some other programmer interface (or
both?) would be best. We'll defer the programmer interface side of this
for now, but at least get to the point where the feature can be enabled
without relying on implementation details.

This also allows us to do something that was really hard before: we can
enable *just* the indirect call retpolines when using SLH. For x86, we
don't have any other way to mitigate indirect calls. Other architectures
may take a different approach of course, and none of this is surfaced to
user-level flags.

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

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

6 years agoRevert "Disable the GNUstep v2 ABI on Windows."
David Chisnall [Tue, 4 Sep 2018 10:07:27 +0000 (10:07 +0000)]
Revert "Disable the GNUstep v2 ABI on Windows."

This reverts commit b4547c9cadd2f8adfe3f3182e4c56e466c5256cb.

Apparently git llvm push from the monorepo does not respect branches and
pushes the current branch to master.

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

6 years agoDisable the GNUstep v2 ABI on Windows.
David Chisnall [Tue, 4 Sep 2018 09:23:18 +0000 (09:23 +0000)]
Disable the GNUstep v2 ABI on Windows.

The code remains so that we can potentially reenable it in a point
release, but the driver will reject it.  Several issues were raised
during testing that made it clear that this was not quite ready for
general consumption.

Approved by: Hans Wennborg

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

6 years agoRemoving -debug-info-macros from option suggestions test
Brian Gesiak [Mon, 3 Sep 2018 16:55:02 +0000 (16:55 +0000)]
Removing -debug-info-macros from option suggestions test

Summary:
https://reviews.llvm.org/D46776 added better support for prefixes for the
"did you mean ...?" command line option suggestions. One of the tests was
checking against the `-debug-info-macro` option, which was failing on the
PS4 build bot. Tests would succeed against the `--help` and `--version`
options.

From https://llvm.org/devmtg/2013-11/slides/Robinson-PS4Toolchain.pdf, it
looks like the PS4 SDK forces optimizations and *could be* disabling the
`-debug-info-macro` altogether.

This diff removes `-debug-info-macro` altogether.

Patch by Arnaud Coomans!

Test Plan: untested since we do not have access to a PS4 with the SDK.

Reviewers: cfe-commits, modocache

Reviewed By: modocache

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

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

6 years agoAdd header guards to some headers that are missing them
Argyrios Kyrtzidis [Mon, 3 Sep 2018 16:26:36 +0000 (16:26 +0000)]
Add header guards to some headers that are missing them

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

6 years ago[ASTImporter] Merge ExprBits
Gabor Marton [Mon, 3 Sep 2018 13:10:53 +0000 (13:10 +0000)]
[ASTImporter] Merge ExprBits

Summary:
Some `Expr` classes set up default values for the `ExprBits` of `Stmt`.  These
default values are then overwritten by the parser sometimes.  One example is
`InitListExpr` which sets the value kind to be an rvalue in the ctor.  However,
this bit may change after the `InitListExpr` is created.  There may be other
expressions similar to `InitListExpr` in this sense, thus the safest solution
is to copy the expression bits.

The lack of copying `ExprBits` causes an assertion in the analyzer engine in a
specific case: Since the value kind is not imported, the analyzer engine
believes that the given InitListExpr is an rvalue, thus it creates a
nonloc::CompoundVal instead of creating memory region (as in case of an lvalue
reference).

Reviewers: a_sidorin, r.stahl, xazax.hun, a.sidorin

Subscribers: rnkovacs, dkrupp, cfe-commits

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

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

6 years ago[Index] Update tests allowing double4 type to be "invalid"
Alexey Sotkin [Mon, 3 Sep 2018 12:43:26 +0000 (12:43 +0000)]
[Index] Update tests allowing double4 type to be "invalid"

Fixes test failure after r341309

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

6 years ago[Aarch64] Fix linker emulation for Aarch64 big endian
Peter Smith [Mon, 3 Sep 2018 12:36:32 +0000 (12:36 +0000)]
[Aarch64] Fix linker emulation for Aarch64 big endian

This patch fixes target linker emulation for aarch64 big endian.
aarch64_be_linux is not recognized by gnu ld. The equivalent emulation
mode supported by gnu ld is aarch64linuxb.

Patch by: Bharathi Seshadri

Reviewed by: Peter Smith

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

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

6 years ago[OpenCL] Traverse vector types for ocl extensions support
Alexey Sotkin [Mon, 3 Sep 2018 11:43:22 +0000 (11:43 +0000)]
[OpenCL] Traverse vector types for ocl extensions support

Summary:
Given the following kernel:
__kernel void foo() {
  double d;
  double4 dd;
}

and cl_khr_fp64 is disabled, the compilation would fail due to
the presence of 'double d', but when removed, it passes.

The expectation is that extended vector types of unsupported types
will also be unsupported.

The patch adds the check for this scenario.

Patch by: Ofir Cohen

Reviewers: bader, Anastasia, AlexeySotkin, yaxunl

Reviewed By: Anastasia

Subscribers: cfe-commits

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

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

6 years agoFix Bug 38713: clang-format mishandles a short block after "default:" in a switch...
Jonas Toth [Sun, 2 Sep 2018 09:04:51 +0000 (09:04 +0000)]
Fix Bug 38713: clang-format mishandles a short block after "default:" in a switch statement

Summary:
See https://bugs.llvm.org/show_bug.cgi?id=38713

Patch by Owen Pan!

Reviewers: djasper, klimek, sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

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

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

6 years ago[X86] Add ktest intrinsics to match gcc and icc.
Craig Topper [Fri, 31 Aug 2018 22:29:56 +0000 (22:29 +0000)]
[X86] Add ktest intrinsics to match gcc and icc.

These aren't documented in the Intel Intrinsics Guide, but are supported by gcc and icc.

Includes these intrinsics:
_ktestc_mask8_u8, _ktestz_mask8_u8, _ktest_mask8_u8
_ktestc_mask16_u8, _ktestz_mask16_u8, _ktest_mask16_u8
_ktestc_mask32_u8, _ktestz_mask32_u8, _ktest_mask32_u8
_ktestc_mask64_u8, _ktestz_mask64_u8, _ktest_mask64_u8

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

6 years ago[WebAssembly] clang-format (NFC)
Heejin Ahn [Fri, 31 Aug 2018 20:57:00 +0000 (20:57 +0000)]
[WebAssembly] clang-format (NFC)

Summary: This patch runs clang-format on all wasm-only files.

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

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

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

6 years ago[X86] Add k-mask conversion and load/store instrinsics to match gcc and icc.
Craig Topper [Fri, 31 Aug 2018 20:41:06 +0000 (20:41 +0000)]
[X86] Add k-mask conversion and load/store instrinsics to match gcc and icc.

This adds:
_cvtmask8_u32, _cvtmask16_u32, _cvtmask32_u32, _cvtmask64_u64
_cvtu32_mask8, _cvtu32_mask16, _cvtu32_mask32, _cvtu64_mask64
_load_mask8, _load_mask16, _load_mask32, _load_mask64
_store_mask8, _store_mask16, _store_mask32, _store_mask64

These are currently missing from the Intel Intrinsics Guide webpage.

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

6 years agoTests: fix tests encoding specific hash values for 32-bit systems.
Tim Northover [Fri, 31 Aug 2018 19:24:37 +0000 (19:24 +0000)]
Tests: fix tests encoding specific hash values for 32-bit systems.

I changed the seed slightly, but forgot to run the tests on a 32-bit system, so
tests which hard-code a specific hash value started breaking.

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

6 years ago[X86] Add kshift intrinsics to match gcc and icc.
Craig Topper [Fri, 31 Aug 2018 18:22:52 +0000 (18:22 +0000)]
[X86] Add kshift intrinsics to match gcc and icc.

This adds the following intrinsics:
_kshiftli_mask8
_kshiftli_mask16
_kshiftli_mask32
_kshiftli_mask64
_kshiftri_mask8
_kshiftri_mask16
_kshiftri_mask32
_kshiftri_mask64

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

6 years agoRefactor Addlibgcc to make the when and what logic more straightfoward.
Sterling Augustine [Fri, 31 Aug 2018 17:59:03 +0000 (17:59 +0000)]
Refactor Addlibgcc to make the when and what logic more straightfoward.

Add Android tests.

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

6 years ago[DEBUGINFO] Add support for emission of the debug directives only.
Alexey Bataev [Fri, 31 Aug 2018 13:56:14 +0000 (13:56 +0000)]
[DEBUGINFO] Add support for emission of the debug directives only.

Summary:
Added option -gline-directives-only to support emission of the debug directives
only. It behaves very similar to -gline-tables-only, except that it sets
llvm debug info emission kind to
llvm::DICompileUnit::DebugDirectivesOnly.

Reviewers: echristo

Subscribers: aprantl, fedor.sergeev, JDevlieghere, cfe-commits

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

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

6 years agoImport lit.llvm after rC341132
Fangrui Song [Fri, 31 Aug 2018 00:24:36 +0000 (00:24 +0000)]
Import lit.llvm after rC341132

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

6 years agoRemove vestiges of configure buildsystem
Stephen Kelly [Thu, 30 Aug 2018 23:41:03 +0000 (23:41 +0000)]
Remove vestiges of configure buildsystem

Summary:

Subscribers: mgorny, cfe-commits

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

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

6 years agoAllow binding to NamedValue resulting from let expression
Stephen Kelly [Thu, 30 Aug 2018 23:11:09 +0000 (23:11 +0000)]
Allow binding to NamedValue resulting from let expression

Subscribers: cfe-commits

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

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

6 years agoExtract parseBindID method
Stephen Kelly [Thu, 30 Aug 2018 23:11:01 +0000 (23:11 +0000)]
Extract parseBindID method

Subscribers: cfe-commits

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

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

6 years agoAdd dump() method for SourceRange
Stephen Kelly [Thu, 30 Aug 2018 23:10:52 +0000 (23:10 +0000)]
Add dump() method for SourceRange

Subscribers: cfe-commits

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

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

6 years agoRemove LIT_SITE_CFG_IN_FOOTER, clang
Nico Weber [Thu, 30 Aug 2018 22:11:16 +0000 (22:11 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, clang

It's always replaced with the same (short) static string, so just put that
there directly.

No intended behavior change.
https://reviews.llvm.org/D51357

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

6 years agoRevert the tests that should've been reverted in rL341115
Artem Belevich [Thu, 30 Aug 2018 20:53:15 +0000 (20:53 +0000)]
Revert the tests that should've been reverted in rL341115

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

6 years ago[MS ABI] Fix mangling issue with dynamic initializer stubs.
Zachary Turner [Thu, 30 Aug 2018 20:53:11 +0000 (20:53 +0000)]
[MS ABI] Fix mangling issue with dynamic initializer stubs.

There are two types of dynamic initializer stubs.  There's

  `dynamic initializer for 'x''(void)

and

  `dynamic initializer for `static Foo::Bar StaticDataMember''(void)

The second case is disambiguated from the first by the presence of
a ? after the operator code.  So the first will appear something like
?__E<name> while the second will appear something like ?__E?<name>.
clang-cl was mangling these both the same though.  This patch
matches behavior with cl.

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

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

6 years agoReverted the "[CUDA/OpenMP] Define only some host macros during device compilation"
Artem Belevich [Thu, 30 Aug 2018 20:43:39 +0000 (20:43 +0000)]
Reverted the "[CUDA/OpenMP] Define only some host macros during device compilation"

The changes were breaking CUDA compilation.

Reverted revisions:
  r340681 D50845
   [CUDA/OpenMP] Define only some host macros during device compilation
  r340772 D51312
    [OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading
  r340967 D51441
     Add predefined macro __gnu_linux__ for proper aux-triple

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

6 years agoRevert r341107. That change breaks lto-android in a way is untested.
Sterling Augustine [Thu, 30 Aug 2018 20:42:49 +0000 (20:42 +0000)]
Revert r341107. That change breaks lto-android in a way is untested.

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

6 years ago[cxx_status] Use the correct color for a feature in "SVN" status
Richard Smith [Thu, 30 Aug 2018 20:15:28 +0000 (20:15 +0000)]
[cxx_status] Use the correct color for a feature in "SVN" status

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

6 years agoRefactor Addlibgcc to make the when and what logic more straightfoward.
Sterling Augustine [Thu, 30 Aug 2018 20:07:23 +0000 (20:07 +0000)]
Refactor Addlibgcc to make the when and what logic more straightfoward.

No functional change. A forthcoming change will add support
for -shared-libgcc.

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

6 years agoChange %clang++ to %clangxx in test run line as it was expanding to clang.exe++ on...
Douglas Yung [Thu, 30 Aug 2018 19:52:57 +0000 (19:52 +0000)]
Change %clang++ to %clangxx in test run line as it was expanding to clang.exe++ on Windows.

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

6 years agoUpdate FIXME as requested in code review.
Richard Smith [Thu, 30 Aug 2018 19:19:15 +0000 (19:19 +0000)]
Update FIXME as requested in code review.

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

6 years agoAdd test file missed from r341097.
Richard Smith [Thu, 30 Aug 2018 19:17:11 +0000 (19:17 +0000)]
Add test file missed from r341097.

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

6 years agoAdd missing -Wc++11-compat / -Wc++14-compat warnings for:
Richard Smith [Thu, 30 Aug 2018 19:16:35 +0000 (19:16 +0000)]
Add missing -Wc++11-compat / -Wc++14-compat warnings for:

 * generic lambdas
 * return type deduction
 * class template argument deduction

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

6 years agoImprove attribute documentation to list which spellings are used in which syntaxes.
Richard Smith [Thu, 30 Aug 2018 19:16:33 +0000 (19:16 +0000)]
Improve attribute documentation to list which spellings are used in which syntaxes.

Summary:
Instead of listing all the spellings (including attribute namespaces) in
the section heading, only list the actual attribute names there, and
list the spellings in the supported syntaxes table.

This allows us to properly describe things like [[fallthrough]], for
which we allow a clang:: prefix in C++ but not in C, and AlwaysInline,
which has one spelling as a GNU attribute and a different spelling as a
keyword, without needing to repeat the syntax description in the
documentation text.

Sample rendering: https://pste.eu/p/T1ZV.html

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

6 years ago[OPENMP] Fix PR38710: static functions are not emitted as implicitly
Alexey Bataev [Thu, 30 Aug 2018 18:56:11 +0000 (18:56 +0000)]
[OPENMP] Fix PR38710: static functions are not emitted as implicitly
'declare target'.

All the functions, referenced in implicit|explicit target regions must
be emitted during code emission for the device.

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

6 years ago[analyzer] InnerPointerChecker: Fix a segfault when checking symbolic strings.
Artem Dergachev [Thu, 30 Aug 2018 18:45:05 +0000 (18:45 +0000)]
[analyzer] InnerPointerChecker: Fix a segfault when checking symbolic strings.

Return value of dyn_cast_or_null should be checked before use.
Otherwise we may put a null pointer into the map as a key and eventually
crash in checkDeadSymbols.

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

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

6 years agoTest the cross-product of how libgcc-related arguments are passed to the linker.
Sterling Augustine [Thu, 30 Aug 2018 16:37:06 +0000 (16:37 +0000)]
Test the cross-product of how libgcc-related arguments are passed to the linker.

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

6 years ago[libFuzzer] Port to Windows
Matt Morehouse [Thu, 30 Aug 2018 15:54:44 +0000 (15:54 +0000)]
[libFuzzer] Port to Windows

Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Patch By: metzman

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman

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

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

6 years ago[HIP] Add -fvisibility hidden option to clang
Yaxun Liu [Thu, 30 Aug 2018 15:10:20 +0000 (15:10 +0000)]
[HIP] Add -fvisibility hidden option to clang

AMDGPU target need -fvisibility hidden option for clang to
work around a limitation of no PLT support, otherwise there is compilation
error at -O0.

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

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

6 years ago[Sema][NFC] Trivial cleanup in ActOnCallExpr
Jan Korous [Thu, 30 Aug 2018 14:46:48 +0000 (14:46 +0000)]
[Sema][NFC] Trivial cleanup in ActOnCallExpr

Use logical or operator instead of a bool variable and if/else.

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

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

6 years ago[OPENMP][NVPTX] Add options -f[no-]openmp-cuda-force-full-runtime.
Alexey Bataev [Thu, 30 Aug 2018 14:45:24 +0000 (14:45 +0000)]
[OPENMP][NVPTX] Add options -f[no-]openmp-cuda-force-full-runtime.

Added options -f[no-]openmp-cuda-force-full-runtime to [not] force use
of the full runtime for OpenMP offloading to CUDA devices.

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

6 years ago[CodeComplete] Report location of opening parens for signature help
Ilya Biryukov [Thu, 30 Aug 2018 13:08:03 +0000 (13:08 +0000)]
[CodeComplete] Report location of opening parens for signature help

Summary: Used in clangd.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ioeric, kadircet, cfe-commits

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

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

6 years agoAMDGPU: Default to hidden visibility
Matt Arsenault [Thu, 30 Aug 2018 08:18:06 +0000 (08:18 +0000)]
AMDGPU: Default to hidden visibility

Object linking isn't supported, so it's not useful
to emit default visibility. Default visibility requires
relocations we don't yet support for functions compiled
in another translation unit.

WebAssembly already does this, although they insert these
arguments in a different place for some reason.

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

6 years agoEnsure canonical type is actually canonical.
Richard Trieu [Thu, 30 Aug 2018 01:57:52 +0000 (01:57 +0000)]
Ensure canonical type is actually canonical.

ASTContext::applyObjCProtocolQualifiers will return a canonical type when given
a canonical type and an array of canonical protocols.  If the protocols are not
canonical then the returned type is also not canonical.  Since a canonical type is needed, canonicalize the returned type before using it.  This later prevents
a type from having a non-canonical canonical type.

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

6 years agoAdjust Attr representation so that changes to documentation don't affect
Richard Smith [Thu, 30 Aug 2018 01:01:07 +0000 (01:01 +0000)]
Adjust Attr representation so that changes to documentation don't affect
how we parse source code.

Instead of implicitly opting all undocumented attributes out of '#pragma
clang attribute' support, explicitly opt them all out and remove the
documentation check from TableGen.

(No new attributes should be added without documentation, so this has
little chance of backsliding. We already support the pragma on one
undocumented attribute, so we don't even want to enforce our old
"rule".)

No functionality change intended.

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

6 years ago[AttrDocs] Fix build bots: add missing GNUInline pragma to test.
Jordan Rupprecht [Thu, 30 Aug 2018 00:04:34 +0000 (00:04 +0000)]
[AttrDocs] Fix build bots: add missing GNUInline pragma to test.

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

6 years ago[analyzer] Document that pointer arithmetic is not represented by SymExprs.
Artem Dergachev [Wed, 29 Aug 2018 22:57:52 +0000 (22:57 +0000)]
[analyzer] Document that pointer arithmetic is not represented by SymExprs.

Add assertions to verify that.

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

6 years ago[AttrDocs]: document gnu_inline function attribute
Nick Desaulniers [Wed, 29 Aug 2018 22:50:47 +0000 (22:50 +0000)]
[AttrDocs]: document gnu_inline function attribute

Summary: This wasn't documented https://clang.llvm.org/docs/AttributeReference.html, and briefly mentioned https://clang.llvm.org/docs/UsersManual.html#differences-between-various-standard-modes.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: efriedma, cfe-commits, srhines

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

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

6 years ago[analyzer] Improve tracing for uninitialized struct fields
George Karpenkov [Wed, 29 Aug 2018 22:48:50 +0000 (22:48 +0000)]
[analyzer] Improve tracing for uninitialized struct fields

rdar://13729267

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

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

6 years ago[analyzer] Support modeling no-op BaseToDerived casts in ExprEngine.
Artem Dergachev [Wed, 29 Aug 2018 22:43:31 +0000 (22:43 +0000)]
[analyzer] Support modeling no-op BaseToDerived casts in ExprEngine.

Introduce a new MemRegion sub-class, CXXDerivedObjectRegion, which is
the opposite of CXXBaseObjectRegion, to represent such casts. Such region is
a bit weird because it is by design bigger than its super-region.
But it's not harmful when it is put on top of a SymbolicRegion
that has unknown extent anyway.

Offset computation for CXXDerivedObjectRegion and proper modeling of casts
still remains to be implemented.

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

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

6 years ago[analyzer] CFRetainReleaseChecker: Don't check C++ methods with the same name.
Artem Dergachev [Wed, 29 Aug 2018 22:39:20 +0000 (22:39 +0000)]
[analyzer] CFRetainReleaseChecker: Don't check C++ methods with the same name.

Don't try to understand what's going on when there's a C++ method called eg.
CFRetain().

Refactor the checker a bit, to use more modern APIs.

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

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

6 years ago[CFG] [analyzer] Disable argument construction contexts for variadic functions.
Artem Dergachev [Wed, 29 Aug 2018 22:05:35 +0000 (22:05 +0000)]
[CFG] [analyzer] Disable argument construction contexts for variadic functions.

The analyzer doesn't make use of them anyway and they seem to have
pretty weird AST from time to time, so let's just skip them for now.

Fixes a crash reported as pr37769.

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

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

6 years ago[CFG] [analyzer] Disable argument construction contexts for variadic functions.
Artem Dergachev [Wed, 29 Aug 2018 21:50:52 +0000 (21:50 +0000)]
[CFG] [analyzer] Disable argument construction contexts for variadic functions.

The analyzer doesn't make use of them anyway and they seem to have
pretty weird AST from time to time, so let's just skip them for now.

Fixes pr37769.

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

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

6 years ago[analyzer] Fix tests on 32-bit platforms by specifying the tuple explicitly
George Karpenkov [Wed, 29 Aug 2018 21:18:47 +0000 (21:18 +0000)]
[analyzer] Fix tests on 32-bit platforms by specifying the tuple explicitly

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

6 years ago[OPENMP] Do not create offloading entry for declare target variables
Alexey Bataev [Wed, 29 Aug 2018 20:41:37 +0000 (20:41 +0000)]
[OPENMP] Do not create offloading entry for declare target variables
declarations.

We should not create offloading entries for declare target var
declarations as it causes compiler crash.

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

6 years agoAdd predefined macro __gnu_linux__ for proper aux-triple
Yaxun Liu [Wed, 29 Aug 2018 20:39:22 +0000 (20:39 +0000)]
Add predefined macro __gnu_linux__ for proper aux-triple

Clang predefine macro __linx__ for aux-triple with Linux OS
but does not predefine macro __gnu_linux__. This causes
some compilation error for certain applications, e.g. Eigen.

This patch fixes that.

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

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

6 years ago[analyzer] Resolve the crash in ReturnUndefChecker
George Karpenkov [Wed, 29 Aug 2018 20:29:59 +0000 (20:29 +0000)]
[analyzer] Resolve the crash in ReturnUndefChecker

By making sure the returned value from getKnownSVal is consistent with
the value used inside expression engine.

PR38427

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

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

6 years ago[analyzer] [NFC] Move class definition out of the function
George Karpenkov [Wed, 29 Aug 2018 20:29:39 +0000 (20:29 +0000)]
[analyzer] [NFC] Move class definition out of the function

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

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

6 years ago[analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by default
George Karpenkov [Wed, 29 Aug 2018 20:29:17 +0000 (20:29 +0000)]
[analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by default

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

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

6 years ago[analyzer] [NFC] Remove unused "state" argument from makeSymExprValNN
George Karpenkov [Wed, 29 Aug 2018 20:28:54 +0000 (20:28 +0000)]
[analyzer] [NFC] Remove unused "state" argument from makeSymExprValNN

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

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

6 years ago[analyzer] Better retain count rules for OSObjects
George Karpenkov [Wed, 29 Aug 2018 20:28:33 +0000 (20:28 +0000)]
[analyzer] Better retain count rules for OSObjects

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

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

6 years ago[analyzer] [NFC] Follow the convention when naming classes
George Karpenkov [Wed, 29 Aug 2018 20:28:13 +0000 (20:28 +0000)]
[analyzer] [NFC] Follow the convention when naming classes

Renames InvalidateRegionsWorker and RemoveDeadBindingsWorker

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

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

6 years agoRevert "[libFuzzer] Port to Windows"
Matt Morehouse [Wed, 29 Aug 2018 18:40:41 +0000 (18:40 +0000)]
Revert "[libFuzzer] Port to Windows"

This reverts r340949 due to bot breakage again.

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

6 years ago[OPENMP][NVPTX] Add support for lightweight runtime.
Alexey Bataev [Wed, 29 Aug 2018 18:32:21 +0000 (18:32 +0000)]
[OPENMP][NVPTX] Add support for lightweight runtime.

If the target construct can be executed in SPMD mode + it is a loop
based directive with static scheduling, we can use lightweight runtime
support.

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

6 years ago[libFuzzer] Port to Windows
Matt Morehouse [Wed, 29 Aug 2018 18:08:34 +0000 (18:08 +0000)]
[libFuzzer] Port to Windows

Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman

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

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

6 years ago[MinGW] Don't mark external variables as DSO local
Martin Storsjo [Wed, 29 Aug 2018 17:26:58 +0000 (17:26 +0000)]
[MinGW] Don't mark external variables as DSO local

Since MinGW supports automatically importing external variables from
DLLs even without the DLLImport attribute, we shouldn't mark them
as DSO local unless we actually know them to be local for sure.

Keep marking thread local variables as DSO local.

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

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

6 years ago[Tooling] Do not restore working dir in ClangTool
Ilya Biryukov [Wed, 29 Aug 2018 16:35:31 +0000 (16:35 +0000)]
[Tooling] Do not restore working dir in ClangTool

Summary:
Resolve all relative paths before running the tool instead.

This fixes the usage of ClangTool in AllTUsExecutor. The executor will
try running multiple ClangTool instances in parallel with compile
commands that usually have the same working directory.

Changing working directory is a global operation, so we end up
changing working directory in the middle of running other actions,
which leads to spurious compile errors.

Reviewers: ioeric, sammccall

Reviewed By: ioeric

Subscribers: cfe-commits

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

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

6 years ago[OPENMP] Create non-const ident_t objects.
Mike Rice [Wed, 29 Aug 2018 15:45:11 +0000 (15:45 +0000)]
[OPENMP] Create non-const ident_t objects.

Currently ident_t objects are created const when debug info is not
enabled, but the libittnotify libray in the OpenMP runtime writes to
the reserved_2 field (See __kmp_itt_region_forking in
openmp/runtime/src/kmp_itt.inl).  Now create ident_t objects non-const.

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

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

6 years ago[Preamble] Fix incorrect usage of std::error_category
Alexandre Ganea [Wed, 29 Aug 2018 14:28:04 +0000 (14:28 +0000)]
[Preamble] Fix incorrect usage of std::error_category

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

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

6 years ago[ARM] Set __ARM_FEATURE_SIMD32 for +dsp cores
Sam Parker [Wed, 29 Aug 2018 10:39:03 +0000 (10:39 +0000)]
[ARM] Set __ARM_FEATURE_SIMD32 for +dsp cores

ARM_FEATURE_DSP is already set for targets with the +dsp feature. In
the backend, this target feature is also used to represent the
availability of the of the instructions that the ACLE guard through
the __ARM_FEATURE_SIMD32 macro. We don't have any cores that
implement one and not the other, so set this macro for cores later
than V6 or for Cortex-M cores that the target parser, or user, reports
that the 'dsp' instructions are supported.

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

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

6 years agoStart reserving x18 by default on Android targets.
Peter Collingbourne [Wed, 29 Aug 2018 01:38:47 +0000 (01:38 +0000)]
Start reserving x18 by default on Android targets.

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

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

6 years ago[X86] Add kadd intrinsics to match gcc and icc.
Craig Topper [Tue, 28 Aug 2018 22:32:14 +0000 (22:32 +0000)]
[X86] Add kadd intrinsics to match gcc and icc.

This adds the following intrinsics:
_kadd_mask64
_kadd_mask32
_kadd_mask16
_kadd_mask8

These are missing from the Intel Intrinsics Guide, but are implemented by both gcc and icc.

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

6 years ago[HIP] Fix output file extension
Yaxun Liu [Tue, 28 Aug 2018 21:09:09 +0000 (21:09 +0000)]
[HIP] Fix output file extension

OffloadBundlingJobAction constructor accepts a list of JobAction as inputs.
The host JobAction is the last one. The file type of OffloadBundlingJobAction
should be determined by the host JobAction (the last one) instead of the first
one.

Since HIP emits LLVM bitcode for device compilation, device JobAction has
different file type as host Job Action. This bug causes incorrect output file
extension for HIP.

This patch fixes it by using the last input JobAction (host JobAction) to determine
file type of OffloadBundlingJobAction.

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

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

6 years agoRevert "[libFuzzer] Port to Windows"
Matt Morehouse [Tue, 28 Aug 2018 19:07:24 +0000 (19:07 +0000)]
Revert "[libFuzzer] Port to Windows"

This reverts commit r340860 due to failing tests.

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

6 years ago[libFuzzer] Port to Windows
Matt Morehouse [Tue, 28 Aug 2018 18:34:32 +0000 (18:34 +0000)]
[libFuzzer] Port to Windows

Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Patch By: metzman

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: morehouse, kcc, eraman

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

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

6 years agoDefine variables in test case rather than using values from functions
Akira Hatanaka [Tue, 28 Aug 2018 18:18:01 +0000 (18:18 +0000)]
Define variables in test case rather than using values from functions
emitted ealier.

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

6 years ago[ubsan] Enable -fsanitize=vptr on Apple devices and simulators
Vedant Kumar [Tue, 28 Aug 2018 18:01:42 +0000 (18:01 +0000)]
[ubsan] Enable -fsanitize=vptr on Apple devices and simulators

It seems like an oversight that this check was not always enabled for
on-device or device simulator targets.

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

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

6 years ago[Driver] Delete last reference of lld -flavor old-gnu
Fangrui Song [Tue, 28 Aug 2018 17:20:28 +0000 (17:20 +0000)]
[Driver] Delete last reference of lld -flavor old-gnu

This is dead code because lld -flavor old-gnu was removed in 2016 by rLLD262158.

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

6 years agoParse compile commands lazily in InterpolatingCompilationDatabase
Ilya Biryukov [Tue, 28 Aug 2018 16:15:56 +0000 (16:15 +0000)]
Parse compile commands lazily in InterpolatingCompilationDatabase

Summary:
This greatly reduces the time to read 'compile_commands.json'.
For Chromium on my machine it's now 0.7 seconds vs 30 seconds before the
change.

Reviewers: sammccall, jfb

Reviewed By: sammccall

Subscribers: mgrang, jfb, cfe-commits

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

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

6 years ago[Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments
Adam Balogh [Tue, 28 Aug 2018 08:41:15 +0000 (08:41 +0000)]
[Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

We add check for invalidation of iterators. The only operation we handle here
is the (copy) assignment.

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

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

6 years ago[X86] Add kortest intrinsics for 8, 32, and 64 bit masks. Add new intrinsic names...
Craig Topper [Tue, 28 Aug 2018 06:28:25 +0000 (06:28 +0000)]
[X86] Add kortest intrinsics for 8, 32, and 64 bit masks. Add new intrinsic names for 16 bit masks.

This matches gcc and icc despite not being documented in the Intel Intrinsics Guide.

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

6 years ago[OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading
Gheorghe-Teodor Bercea [Mon, 27 Aug 2018 20:16:20 +0000 (20:16 +0000)]
[OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading

Summary: When offloading to a device and using the powerpc64le version of the auxiliary triple, the _CALL_ELF macro is not set correctly to 2 resulting in the attempt to include a header that does not exist. This patch fixes this problem.

Reviewers: Hahnfeld, ABataev, caomhin

Reviewed By: Hahnfeld

Subscribers: guansong, cfe-commits

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

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

6 years ago[PPC] Remove Darwin support from POWER backend.
Kit Barton [Mon, 27 Aug 2018 19:53:19 +0000 (19:53 +0000)]
[PPC] Remove Darwin support from POWER backend.
This patch removes uses of the Darwin ABI for PowerPC related test cases. This
is the first step in removing Darwin support from the POWER backend.

clang/test/CodeGen/darwin-ppc-varargs.c  was deleted because it was a darwin/ppc
specific test case.

All other tests were updated to remove the darwin/ppc specific invocation.

Phabricator Review: https://reviews.llvm.org/D50989.

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

6 years ago[Sema/Attribute] Make types declared with address_space an AttributedType
Leonard Chan [Mon, 27 Aug 2018 17:57:29 +0000 (17:57 +0000)]
[Sema/Attribute] Make types declared with address_space an AttributedType

Currently an address_space is stored in a qualifier. This makes any type
declared with an address_space attribute in the form
`__attribute__((address_space(1))) int 1;` be wrapped in an AttributedType.

This is for a later patch where if `address_space` is declared in a macro,
any diagnostics that would normally print the address space will instead dump
the macro name. This will require saving any macro information in the
AttributedType.

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

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

6 years agofix comment typo
Nico Weber [Mon, 27 Aug 2018 14:23:50 +0000 (14:23 +0000)]
fix comment typo

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

6 years agoTry to fix this clang driver test case after r340709.
Chandler Carruth [Mon, 27 Aug 2018 08:49:20 +0000 (08:49 +0000)]
Try to fix this clang driver test case after r340709.

If any of the bots complain about this, I'll just revert. This test case
is essentially trying to test the exact change made, but I think this
matches the intent of the patch in question.

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

6 years ago[X86] Add intrinsics for kand/kandn/knot/kor/kxnor/kxor with 8, 32, and 64-bit mask...
Craig Topper [Mon, 27 Aug 2018 06:20:22 +0000 (06:20 +0000)]
[X86] Add intrinsics for kand/kandn/knot/kor/kxnor/kxor with 8, 32, and 64-bit mask registers.

This also adds a second intrinsic name for the 16-bit mask versions.

These intrinsics match gcc and icc. They just aren't published in the Intel Intrinsics Guide so I only recently found they existed.

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

6 years ago[X86] Remove min_vector_width 512 from some intrinsics that operate only on k-registers.
Craig Topper [Mon, 27 Aug 2018 06:20:20 +0000 (06:20 +0000)]
[X86] Remove min_vector_width 512 from some intrinsics that operate only on k-registers.

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

6 years ago[X86] Rename __DEFAULT_FN_ATTRS to a__DEFAULT_FN_ATTRS512 in avx512dqintrin.h and...
Craig Topper [Mon, 27 Aug 2018 06:20:19 +0000 (06:20 +0000)]
[X86] Rename __DEFAULT_FN_ATTRS to a__DEFAULT_FN_ATTRS512 in avx512dqintrin.h and avx512bwintrin.h.

This is preparation for adding removing min_vector_width 512 from some intrinsics.

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

6 years ago[X86] Undef __DEFAULT_FN_ATTRS in avx512fintrin.h.
Craig Topper [Mon, 27 Aug 2018 05:44:45 +0000 (05:44 +0000)]
[X86] Undef __DEFAULT_FN_ATTRS in avx512fintrin.h.

Fixes test failure after r340713

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

6 years ago[X86] Don't set min_vector_width to 512 on intrinsics that only operate on k registers.
Craig Topper [Mon, 27 Aug 2018 05:27:15 +0000 (05:27 +0000)]
[X86] Don't set min_vector_width to 512 on intrinsics that only operate on k registers.

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

6 years ago[Xray] Darwin - Enable in the driver side
David Carlier [Mon, 27 Aug 2018 05:16:09 +0000 (05:16 +0000)]
[Xray] Darwin - Enable in the driver side

Reviewers: dberris

Reviered By: dberris

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

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

6 years ago[Driver] Change MipsLinux default linker from "lld" to "ld.lld"
Fangrui Song [Sun, 26 Aug 2018 19:47:23 +0000 (19:47 +0000)]
[Driver] Change MipsLinux default linker from "lld" to "ld.lld"

Reviewers: kzhuravl, atanasyan

Reviewed By: atanasyan

Subscribers: sdardis, arichardson, jrtc27, atanasyan, cfe-commits

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

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

6 years ago[index] Introduce 'ProtocolInterface' as part of SymbolPropertySet
Argyrios Kyrtzidis [Sun, 26 Aug 2018 06:27:23 +0000 (06:27 +0000)]
[index] Introduce 'ProtocolInterface' as part of SymbolPropertySet

This is useful to directly infer that a method or property is from a protocol interface
at the point of the symbol occurrences.

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

6 years ago[CUDA/OpenMP] Define only some host macros during device compilation
Jonas Hahnfeld [Sat, 25 Aug 2018 13:42:40 +0000 (13:42 +0000)]
[CUDA/OpenMP] Define only some host macros during device compilation

When compiling CUDA or OpenMP device code Clang parses header files
that expect certain predefined macros from the host architecture. To
make this work the compiler passes the host triple via the -aux-triple
argument and (until now) pulls in all macros for that "auxiliary triple"
unconditionally.

However this results in defines like __SSE_MATH__ that will trigger
inline assembly making use of the "advertised" target features. See
the discussion of D47849 and PR38464 for a detailed explanation of
the encountered problems.

Instead of blacklisting "known bad" examples this patch starts adding
defines that are needed for certain headers like bits/wordsize.h and
bits/mathinline.h.
The disadvantage of this approach is that it decouples the definitions
from their target toolchain. However in my opinion it's more important
to keep definitions for one header close together. For one this will
include a clear documentation why these particular defines are needed.
Furthermore it simplifies maintenance because adding defines for a new
header or support for a new aux-triple only needs to touch one piece
of code.

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

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

6 years agoRevert r323281 "Adjust MaxAtomicInlineWidth for i386/i486 targets."
Hans Wennborg [Fri, 24 Aug 2018 22:46:33 +0000 (22:46 +0000)]
Revert r323281 "Adjust MaxAtomicInlineWidth for i386/i486 targets."

As reported on http://lists.llvm.org/pipermail/cfe-dev/2018-August/058760.html,
this broke i386-freebsd11 due to its lack of atomic 64 bit primitives.

While that's not really this commit's fault, let's revert back to the old
behaviour until this can be fixed. This means generating cmpxchg8b etc for i386
and i486 which don't technically support those, but that's been the behaviour
for a long time, so a little longer probably doesn't hurt that much.

> Adjust MaxAtomicInlineWidth for i386/i486 targets.
>
> This is to fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6.
> Currently, all  MaxAtomicInlineWidth of x86-32 targets are set to 64. However,
> i386 doesn't support any cmpxchg related instructions. i486 only supports cmpxchg.
> So in this patch MaxAtomicInlineWidth is reset as follows:
> For i386, the MaxAtomicInlineWidth should be 0 because no cmpxchg is supported.
> For i486, the MaxAtomicInlineWidth should be 32 because it supports cmpxchg.
> For others 32 bits x86 cpu, the MaxAtomicInlineWidth should be 64 because of cmpxchg8b.
>
> Differential Revision: https://reviews.llvm.org/D42154

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

6 years agoReland r340552, "Driver: Enable address-significance tables by default when targeting...
Peter Collingbourne [Fri, 24 Aug 2018 20:38:15 +0000 (20:38 +0000)]
Reland r340552, "Driver: Enable address-significance tables by default when targeting COFF." which was reverted in r340579.

The underlying problem that caused the revert was fixed in r340648.

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

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