]> granicus.if.org Git - clang/log
clang
6 years agoPR38870: Add warning for zero-width unicode characters appearing in
Richard Smith [Fri, 7 Sep 2018 19:25:39 +0000 (19:25 +0000)]
PR38870: Add warning for zero-width unicode characters appearing in
identifiers.

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

6 years ago[X86] Custom emit __builtin_rdtscp so we can emit an explicit store for the out parameter
Craig Topper [Fri, 7 Sep 2018 19:14:24 +0000 (19:14 +0000)]
[X86] Custom emit __builtin_rdtscp so we can emit an explicit store for the out parameter

This is the clang side of D51803. The llvm intrinsic now returns two results. So we need to emit an explicit store in IR for the out parameter. This is similar to addcarry/subborrow/rdrand/rdseed.

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

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

6 years agowarn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'
Alex Lorenz [Fri, 7 Sep 2018 18:59:45 +0000 (18:59 +0000)]
warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'

Addresses first post-commit feedback for r335081 from Nico

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

6 years ago[X86] Modify addcarry/subborrow builtins to emit an 2 result and intrinsic and an...
Craig Topper [Fri, 7 Sep 2018 16:58:57 +0000 (16:58 +0000)]
[X86] Modify addcarry/subborrow builtins to emit an 2 result and intrinsic and an store instruction.

This is the clang side of D51769. The llvm intrinsics now return two results instead of using an out parameter.

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

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

6 years agoRevert "[OPENMP][NVPTX] Disable runtime-type info for CUDA devices."
Alexey Bataev [Fri, 7 Sep 2018 14:50:25 +0000 (14:50 +0000)]
Revert "[OPENMP][NVPTX] Disable runtime-type info for CUDA devices."

Still need the RTTI for NVPTX target to pass sema checks.

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

6 years ago[CodeComplete] Clearly distinguish signature help and code completion.
Ilya Biryukov [Fri, 7 Sep 2018 14:04:39 +0000 (14:04 +0000)]
[CodeComplete] Clearly distinguish signature help and code completion.

Summary:
Code completion in clang is actually a mix of two features:
- Code completion is a familiar feature. Results are exposed via the
  CodeCompleteConsumer::ProcessCodeCompleteResults callback.
- Signature help figures out if the current expression is an argument of
  some function call and shows corresponding signatures if so.
  Results are exposed via CodeCompleteConsumer::ProcessOverloadCandidates.

This patch refactors the implementation to untangle those two from each
other and makes some naming tweaks to avoid confusion when reading the
code.

The refactoring is required for signature help fixes, see D51038.

The only intended behavior change is the order of callbacks.
ProcessOverloadCandidates is now called before ProcessCodeCompleteResults.

Reviewers: sammccall, kadircet

Reviewed By: sammccall

Subscribers: cfe-commits

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

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

6 years ago[libclang] Return the proper pointee type for 'auto' deduced to pointer
Ivan Donchevskii [Fri, 7 Sep 2018 13:23:51 +0000 (13:23 +0000)]
[libclang] Return the proper pointee type for 'auto' deduced to pointer

Currently the resulting type is always invalid in such case.

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

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

6 years agoDifferential Revision: https://reviews.llvm.org/D50246
Kristina Brooks [Fri, 7 Sep 2018 13:03:31 +0000 (13:03 +0000)]
Differential Revision: https://reviews.llvm.org/D50246

[RISCV] Add support for computing sysroot for riscv32-unknown-elf

Extends r338385 to allow the driver to compute the sysroot when an explicit path is not provided. This allows the linker to find C runtime files and the correct include directory for header files.

Patch by lewis-revill (Lewis Revill)

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

6 years agoReland r341390 clang-cl: Pass /Brepro to linker if it was passed to the compiler
Nico Weber [Fri, 7 Sep 2018 12:47:02 +0000 (12:47 +0000)]
Reland r341390 clang-cl: Pass /Brepro to linker if it was passed to the compiler

The test was missing  '--' on mac as pointed out by -Wslash-u-filename:
<stdin>:5:69: note: possible intended match here
clang: warning: '/Users/thakis/src/llvm-mono/clang/test/Driver/msvc-link.c' treated as the '/U' option [-Wslash-u-filename]

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

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

6 years agoRevert "Revert "Revert "[analyzer] Add coverage information to plist output, update...
Simon Pilgrim [Fri, 7 Sep 2018 10:27:16 +0000 (10:27 +0000)]
Revert "Revert "Revert "[analyzer] Add coverage information to plist output, update tests"""

Reverts analyzer tests from rL341627 again as they still broke windows buildbots

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

6 years agoReplaces __inline by __inline__ / C89 compatible
Diogo N. Sampaio [Fri, 7 Sep 2018 09:37:27 +0000 (09:37 +0000)]
Replaces __inline by __inline__ / C89 compatible

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

6 years ago[MSan] add KMSAN support to Clang driver
Alexander Potapenko [Fri, 7 Sep 2018 09:21:09 +0000 (09:21 +0000)]
[MSan] add KMSAN support to Clang driver

Boilerplate code for using KMSAN instrumentation in Clang.

We add a new command line flag, -fsanitize=kernel-memory, with a
corresponding SanitizerKind::KernelMemory, which, along with
SanitizerKind::Memory, maps to the memory_sanitizer feature.

KMSAN is only supported on x86_64 Linux.

It's incompatible with other sanitizers, but supports code coverage
instrumentation.

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

6 years ago[Sema] Check that the destructor for each element of class type is
Akira Hatanaka [Fri, 7 Sep 2018 02:38:01 +0000 (02:38 +0000)]
[Sema] Check that the destructor for each element of class type is
accessible from the context where aggregate initialization occurs.

rdar://problem/38168772

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

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

6 years agoRevert "Revert "[analyzer] Add coverage information to plist output, update tests""
George Karpenkov [Fri, 7 Sep 2018 02:02:35 +0000 (02:02 +0000)]
Revert "Revert "[analyzer] Add coverage information to plist output, update tests""

This reverts commit a39bcab414dd7ace7e490363ecdf01ecce7743fc.

Reverting the revert, fixing tests.

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

6 years agoRevert "[analyzer] Add coverage information to plist output, update tests"
George Karpenkov [Fri, 7 Sep 2018 01:39:23 +0000 (01:39 +0000)]
Revert "[analyzer] Add coverage information to plist output, update tests"

This reverts commit 03d183b6b94eda27ce66a4f9b87a00b0a148cf9e.

Temporary revert until the tests are fixed.

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

6 years ago[analyzer] Add coverage information to plist output, update tests
George Karpenkov [Fri, 7 Sep 2018 00:44:17 +0000 (00:44 +0000)]
[analyzer] Add coverage information to plist output, update tests

Split tests which were still using FileCheck to compare plists.

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

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

6 years ago[analyzer] [NFC] Prefer passing around reference to std::unique_ptr&
George Karpenkov [Fri, 7 Sep 2018 00:43:55 +0000 (00:43 +0000)]
[analyzer] [NFC] Prefer passing around reference to std::unique_ptr&

When object is owned elsewhere

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

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

6 years ago[analyzer] Executed lines: store file IDs, not hashes.
George Karpenkov [Fri, 7 Sep 2018 00:43:37 +0000 (00:43 +0000)]
[analyzer] Executed lines: store file IDs, not hashes.

Raw FileIDs are needed for the PlistDiagnostics to produce stable filenames.

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

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

6 years ago[analyzer] Do not add invalid source location to the coverage information
George Karpenkov [Fri, 7 Sep 2018 00:43:17 +0000 (00:43 +0000)]
[analyzer] Do not add invalid source location to the coverage information

Invalid source locations may arise from generated code.

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

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

6 years ago[analyzer] Push updating-the-executed-lines logic into the BugReporter.
George Karpenkov [Fri, 7 Sep 2018 00:42:53 +0000 (00:42 +0000)]
[analyzer] Push updating-the-executed-lines logic into the BugReporter.

So it can be reused across different consumers.

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

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

6 years ago[analyzer] Skip printing trivial nodes in exploded graph
George Karpenkov [Fri, 7 Sep 2018 00:42:32 +0000 (00:42 +0000)]
[analyzer] Skip printing trivial nodes in exploded graph

A node is considered to be trivial if it only has one successor, one
predecessor, and a state equal to the predecessor.
Can drastically (> 2x) reduce the size of the generated exploded
graph.

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

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

6 years ago[analyzer] [NFC] Move dumping program point into a separate function
George Karpenkov [Thu, 6 Sep 2018 23:08:27 +0000 (23:08 +0000)]
[analyzer] [NFC] Move dumping program point into a separate function

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

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

6 years ago[analyzer] Dump stable identifiers for exploded nodes
George Karpenkov [Thu, 6 Sep 2018 23:08:07 +0000 (23:08 +0000)]
[analyzer] Dump stable identifiers for exploded nodes

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

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

6 years ago[analyzer] Remove traces of ubigraph visualization
George Karpenkov [Thu, 6 Sep 2018 23:07:47 +0000 (23:07 +0000)]
[analyzer] Remove traces of ubigraph visualization

Ubigraph project has been dead since about 2008, and to the best of my
knowledge, no one was using it.
Previously, I wasn't able to launch the existing binary at all.

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

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

6 years ago[analyzer] Dump a reproducible, deterministic ID of program state to exploded graph
George Karpenkov [Thu, 6 Sep 2018 23:07:26 +0000 (23:07 +0000)]
[analyzer] Dump a reproducible, deterministic ID of program state to exploded graph

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

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

6 years agoRemove deprecated API
Stephen Kelly [Thu, 6 Sep 2018 18:26:30 +0000 (18:26 +0000)]
Remove deprecated API

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years agoRe-land r334417 "[MS] Use mangled names and comdats for string merging with ASan"
Reid Kleckner [Thu, 6 Sep 2018 18:25:39 +0000 (18:25 +0000)]
Re-land r334417 "[MS] Use mangled names and comdats for string merging with ASan"

The issue with -fprofile-generate was fixed and the dependent CL
relanded in r340232.

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

6 years ago[OPENMP] Fix PR38823: Do not emit vtable if it is not used in target
Alexey Bataev [Thu, 6 Sep 2018 17:56:28 +0000 (17:56 +0000)]
[OPENMP] Fix PR38823: Do not emit vtable if it is not used in target
context.

If the explicit template instantiation definition defined outside of the
target context, its vtable should not be marked as used. This is true
for other situations where the compiler want to emit vtables
unconditionally.

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

6 years ago[Sema] Clean up some __builtin_*_chk diagnostics
Erik Pilkington [Thu, 6 Sep 2018 17:19:33 +0000 (17:19 +0000)]
[Sema] Clean up some __builtin_*_chk diagnostics

Namely, print the likely macro name when it's used, and include the actual
computed sizes in the diagnostic message, which are sometimes not obvious.

rdar://43909200

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

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

6 years agoRe-commit "Enable DWARF accelerator tables by default when tuning for lldb (-glldb...
Pavel Labath [Thu, 6 Sep 2018 17:01:45 +0000 (17:01 +0000)]
Re-commit "Enable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)""

This recommits r341472, which was reverted due to test failures on macos bots.

The issue was that a macos target implies -glldb which, together with
this patch added a -gpubnames switch where there previously wasn't one.
The intentions of those checks was to check that -gpubnames is not
emitted by default so I add an explicit -ggdb arg to those command lines
to get same behavior on all platforms (the fact that -glldb *does* set
-gpubnames is tested by a separate test).

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

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

6 years agoReverting r 341390 because it is causing test failures on GreenDragon.
A Bergen [Thu, 6 Sep 2018 16:29:40 +0000 (16:29 +0000)]
Reverting r 341390 because it is causing test failures on GreenDragon.

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/52810/

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

6 years agoRemove unnecessary semicolon to silence -Wpedantic warning. NFCI.
Simon Pilgrim [Thu, 6 Sep 2018 15:16:17 +0000 (15:16 +0000)]
Remove unnecessary semicolon to silence -Wpedantic warning. NFCI.

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

6 years ago[OpenCL] Relax diagnostics on OpenCL access qualifiers
Andrew Savonichev [Thu, 6 Sep 2018 15:10:26 +0000 (15:10 +0000)]
[OpenCL] Relax diagnostics on OpenCL access qualifiers

Summary:
Emit warning for multiple access qualifiers if they do not conflict.

Patch by Alexey Bader

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: asavonic, bader, cfe-commits

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

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

6 years agoRevert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"
Sam McCall [Thu, 6 Sep 2018 14:27:40 +0000 (14:27 +0000)]
Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"

This reverts commit r341519, which generates debug info that causes
backend crashes. (with -split-dwarf-file)

Details in https://reviews.llvm.org/D50495

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

6 years agoFix march triple used test from rL341475
Diogo N. Sampaio [Thu, 6 Sep 2018 14:13:10 +0000 (14:13 +0000)]
Fix march triple used test from rL341475

Change the march triple of test files, possible fixing
test failures due rL341475

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

6 years agoFix the -print-multi-directory flag to print the selected multilib.
Christian Bruel [Thu, 6 Sep 2018 14:03:44 +0000 (14:03 +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: jroelofs, timshen, thakis, srhines, cfe-commits

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

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

6 years ago[OpenCL] Disallow negative attribute arguments
Andrew Savonichev [Thu, 6 Sep 2018 11:54:09 +0000 (11:54 +0000)]
[OpenCL] Disallow negative attribute arguments

Summary:
Negative arguments in kernel attributes are silently bitcast'ed to
unsigned, for example:

    __attribute__((reqd_work_group_size(1, -1, 1)))
    __kernel void k() {}

is a complete equivalent of:

    __attribute__((reqd_work_group_size(1, 4294967294, 1)))
    __kernel void k() {}

This is likely an error, so the patch forbids negative arguments in
several OpenCL attributes. Users who really want 4294967294 can still
use it as an unsigned representation.

Reviewers: Anastasia, yaxunl, bader

Reviewed By: Anastasia, yaxunl, bader

Subscribers: bader, cfe-commits

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

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

6 years ago[DebugInfo] Generate debug information for labels. (Fix PR37395)
Hsiangkai Wang [Thu, 6 Sep 2018 06:03:36 +0000 (06:03 +0000)]
[DebugInfo] Generate debug information for labels. (Fix PR37395)

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.

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

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

6 years agoPR38627: Fix handling of exception specification adjustment for
Richard Smith [Wed, 5 Sep 2018 22:30:37 +0000 (22:30 +0000)]
PR38627: Fix handling of exception specification adjustment for
destructors.

We previously tried to patch up the exception specification after
completing the class, which went wrong when the exception specification
was needed within the class body (in particular, by a friend
redeclaration of the destructor in a nested class). We now mark the
destructor as having a not-yet-computed exception specification
immediately after creating it.

This requires delaying various checks against the exception
specification (where we'd previously have just got the wrong exception
specification, and now find we have an exception specification that we
can't compute yet) when those checks fire while the class is being
defined.

This also exposed an issue that we were missing a CodeSynthesisContext
for computation of exception specifications (otherwise we'd fail to make
the module containing the definition of the class visible when computing
its members' exception specs). Adding that incidentally also gives us a
diagnostic quality improvement.

This has also exposed an pre-existing problem: making the exception
specification evaluation context a non-SFINAE context (as it should be)
results in a bootstrap failure; PR38850 filed for this.

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

6 years agoRemove unnecessary options from test RUN lines.
Richard Trieu [Wed, 5 Sep 2018 22:14:46 +0000 (22:14 +0000)]
Remove unnecessary options from test RUN lines.

These tests do not check the color printing, so color options should not
be used when running them.

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

6 years agoAdd triple to test case.
Richard Trieu [Wed, 5 Sep 2018 21:55:09 +0000 (21:55 +0000)]
Add triple to test case.

This test uses enums, which have different behavior when targeting different
systems.  Specifying a triple will give predictable behavior to this test.

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

6 years agoRevert "Enable DWARF accelerator tables by default when tuning for lldb (-glldb ...
Pavel Labath [Wed, 5 Sep 2018 20:20:28 +0000 (20:20 +0000)]
Revert "Enable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)"

This reverts commit r341472 due to breakage in green dragon bots.

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

6 years agoForbid address spaces on compound literals in local scope.
John McCall [Wed, 5 Sep 2018 19:22:40 +0000 (19:22 +0000)]
Forbid address spaces on compound literals in local scope.

Patch by Bevin Hansson!

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

6 years ago[Sema] Don't warn about omitting unavailable enum constants in a switch
Erik Pilkington [Wed, 5 Sep 2018 19:13:27 +0000 (19:13 +0000)]
[Sema] Don't warn about omitting unavailable enum constants in a switch

rdar://42717026

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

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

6 years agoAdd -Wobjc-property-assign-on-object-type.
John McCall [Wed, 5 Sep 2018 19:02:00 +0000 (19:02 +0000)]
Add -Wobjc-property-assign-on-object-type.

This is a warning about using 'assign' instead of 'unsafe_unretained'
in Objective-C property declarations.  It's off by default because there
isn't consensus in the Objective-C steering group that this is the right
thing to do, but we're nonetheless okay with adding it because there's a
substantial pool of Objective-C programmers who will appreciate the warning.

Patch by Alfred Zien!

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

6 years agoTest Commit for git-svn-cleanup comment.
Erich Keane [Wed, 5 Sep 2018 17:14:21 +0000 (17:14 +0000)]
Test Commit for git-svn-cleanup comment.

Removes the class name for the Expr class, which isn't necessary.

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

6 years ago[OPENMP][NVPTX] Disable runtime-type info for CUDA devices.
Alexey Bataev [Wed, 5 Sep 2018 17:10:30 +0000 (17:10 +0000)]
[OPENMP][NVPTX] Disable runtime-type info for CUDA devices.

RTTI is not supported by the NVPTX target.

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

6 years ago[Sema] Store MacroInfo in CodeCompletionResult for macro results.
Eric Liu [Wed, 5 Sep 2018 14:59:17 +0000 (14:59 +0000)]
[Sema] Store MacroInfo in CodeCompletionResult for macro results.

Summary:
This provides information about the macro definition. For example, it
can be used to compute macro USRs.

Reviewers: sammccall

Subscribers: cfe-commits

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

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

6 years agoFix arm_neon.h and arm_fp16.h generation for compiling with std=c89
Diogo N. Sampaio [Wed, 5 Sep 2018 14:56:21 +0000 (14:56 +0000)]
Fix arm_neon.h and arm_fp16.h generation for compiling with std=c89

Summary:
The inline attribute is not valid for C standard 89. Replace the argument in the generation of header files with __inline, as well adding tests for both header files.

Reviewers: pbarrio, SjoerdMeijer, javed.absar, t.p.northover

Subscribers: t.p.northover, kristof.beyls, chrib, cfe-commits

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

test/Headers/arm-fp16-header.c
test/Headers/arm-neon-header.c
utils/TableGen/NeonEmitter.cpp

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

6 years agoEnable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)
Pavel Labath [Wed, 5 Sep 2018 14:38:44 +0000 (14:38 +0000)]
Enable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)

Summary:
DWARF v5 accelerator tables provide a considerable performance
improvement for lldb and will make the default -glldb behavior same on
all targets (right now we emit apple tables on apple targets, but these
are not controlled by -gpubnames, only by -glldb).

Reviewers: dblaikie

Subscribers: probinson, clayborg, JDevlieghere, aprantl, cfe-commits

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

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

6 years agoFix -Wdocumentation warning. NFCI.
Simon Pilgrim [Wed, 5 Sep 2018 10:44:03 +0000 (10:44 +0000)]
Fix -Wdocumentation warning. NFCI.

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

6 years ago[VFS] Cache the current working directory for the real FS.
Eric Liu [Wed, 5 Sep 2018 09:45:27 +0000 (09:45 +0000)]
[VFS] Cache the current working directory for the real FS.

Reviewers: sammccall

Subscribers: cfe-commits

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

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

6 years agoclang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier
Sam McCall [Wed, 5 Sep 2018 07:44:02 +0000 (07:44 +0000)]
clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

This fixes formatting namespaces with preceding 'inline' and 'export' (Modules TS) specifiers.

This change fixes namespaces not being identified as such with preceding 'inline' or 'export' specifiers.

Motivation: I was experimenting with the Modules TS (-fmodules-ts) and found it would be useful if clang-format would correctly format 'export namespace'. While making the changes, I noticed that similar issues still exist with 'inline namespace', and addressed them as well.

Patch by Marco Elver!

Reviewers: klimek, djasper, owenpan, sammccall

Reviewed By: owenpan, sammccall

Subscribers: owenpan, cfe-commits

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

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

6 years agoAllow all supportable non-type attributes to be used with #pragma clang attribute.
Richard Smith [Wed, 5 Sep 2018 00:28:57 +0000 (00:28 +0000)]
Allow all supportable non-type attributes to be used with #pragma clang attribute.

Summary:
We previously disallowed use of undocumented attributes with #pragma clang
attribute, but the justification for doing so was weak and it prevented many
reasonable use cases.

Reviewers: aaron.ballman, arphaman

Subscribers: cfe-commits, rnk, benlangmuir, dexonsmith, erik.pilkington

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

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

6 years ago[ODRHash] Extend hash to support all Type's.
Richard Trieu [Tue, 4 Sep 2018 22:53:19 +0000 (22:53 +0000)]
[ODRHash] Extend hash to support all Type's.

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

6 years agoRevert r341373, since it fails on some targets.
Tim Shen [Tue, 4 Sep 2018 22:20:11 +0000 (22:20 +0000)]
Revert r341373, since it fails on some targets.

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

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

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