Commit Graph

81086 Commits

Author SHA1 Message Date
Bill Wendling ee10d934dd Fix typo so that '-O0' is correctly specified 2019-11-05 13:15:55 -08:00
Alexey Bataev dcec2ac4f3 [OPENMP50]Simplify processing of context selector scores.
If the context selector score was not specified, its value must be set
to 0. Simplify the processing of unspecified scores + save memory in
attribute representation.
2019-11-05 15:59:22 -05:00
Mark de Wever 743461090a [Sema] Fixes templated friend member assertion
Fixes PR41792: Clang assertion failure on templated friend member function

Differential Revision: https://reviews.llvm.org/D69481
2019-11-05 21:46:42 +01:00
Michael Liao 0a220de9e9 [HIP] Fix visibility for 'extern' device variables.
Summary:
- Fix a bug which misses the change for a variable to be set with
  target-specific attributes.

Reviewers: yaxunl

Subscribers: jvesely, nhaehnle, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63020
2019-11-05 14:19:32 -05:00
Michael Liao 15140e4bac [hip] Enable pointer argument lowering through coercing type.
Reviewers: tra, rjmccall, yaxunl

Subscribers: jvesely, nhaehnle, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69826
2019-11-05 13:05:05 -05:00
Alexey Bataev 7b710a4294 [OPENMP]Improve diagnostics for unsupported unified addressing.
Improved diagnostics for better user experience.
2019-11-05 10:31:59 -05:00
Alexey Bataev 642916adc9 [OPENMP][DOCS]Fix coloring of the implemented features status, NFC. 2019-11-05 10:13:58 -05:00
Jonas Paulsson 9376714314 [Clang FE] Recognize -mnop-mcount CL option (SystemZ only).
Recognize -mnop-mcount from the command line and add a function attribute
"mnop-mcount"="true" when passed.

When this option is used, a nop is added instead of a call to fentry. This
is used when building the Linux Kernel.

If this option is passed for any other target than SystemZ, an error is
generated.

Review: Ulrich Weigand
https://reviews.llvm.org/D67763
2019-11-05 12:12:36 +01:00
Sven van Haastregt 0e56b0f94b [OpenCL] Group builtin functions by prototype
The TableGen-generated file containing the function definitions can be
reorganized to save some memory in the Clang binary.  Functions having
the same prototype(s) will point to a shared list of prototype(s).

Patch by Pierre Gondois and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D63557
2019-11-05 10:26:47 +00:00
Sven van Haastregt 9a8d477a0e [OpenCL] Add builtin function attribute handling
Add handling for the "pure", "const" and "convergent" function
attributes for OpenCL builtin functions.

Patch by Pierre Gondois and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D64319
2019-11-05 10:26:47 +00:00
Simon Atanasyan 0d14656b9d [mips] Set __OCTEON__ macros 2019-11-05 12:10:58 +03:00
Simon Atanasyan e578d0fd29 [mips] Fix `__mips_isa_rev` macros value for Octeon CPU 2019-11-05 12:10:58 +03:00
Devin Coughlin abc04ff401 [analyzer] Require darwin for scan-build tests
Let's at least get some coverage from these tests. We can generalize to
other platforms later.
2019-11-04 21:17:55 -08:00
Devin Coughlin 48223d92a9 [analyzer] Fixup scan-build tests for non-Darwin platforms.
This is a fix to 0aba69eb1a to
address failing bots.
2019-11-04 21:12:11 -08:00
Devin Coughlin 0aba69eb1a [analyzer] Add test directory for scan-build.
The static analyzer's scan-build script is critical infrastructure but
is not well tested. To start to address this, add a new test directory under
tests/Analysis for scan-build lit tests and seed it with several tests. The
goal is that future scan-build changes will be accompanied by corresponding
tests.

Differential Revision: https://reviews.llvm.org/D69781
2019-11-04 20:26:35 -08:00
Yaxun (Sam) Liu 4264e7bbfd [CUDA][HIP] Disable emitting llvm.linker.options in device compilation
The linker options (e.g. pragma detect_mismatch) are intended for host
compilation only, therefore disable it for device compilation.

Differential Revision: https://reviews.llvm.org/D57829
2019-11-04 23:21:39 -05:00
Vedant Kumar a5c8ec4baa [CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood
Currently, clang emits subprograms for declared functions when the
target debugger or DWARF standard is known to support entry values
(DW_OP_entry_value & the GNU equivalent).

Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU
tail calls.

Pre-patch debug session with a cross-TU tail call:

```
  * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
    frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt]
```

Post-patch (note that the tail-calling frame, "helper", is visible):

```
  * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
    frame #1: 0x0000000100000f80 main`helper [opt] [artificial]
    frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt]
```

rdar://46577651

Differential Revision: https://reviews.llvm.org/D69743
2019-11-04 15:14:24 -08:00
Mark de Wever 403739b2fd [AST][NFC] Fixes a comment typo
Also a test for commit access.
2019-11-04 22:32:56 +01:00
Alexey Bataev 3eecd601ed [OPENMP][DOCS]Update list of implemented features, NFC. 2019-11-04 16:29:26 -05:00
James Y Knight d11a9018b7 Add release notes for commit ccc4d83cda.
(Which was "[ObjC] Diagnose implicit type coercion from ObjC 'Class'
to object pointer types.")
2019-11-04 16:26:53 -05:00
Alexey Bataev 8bbf2e3716 [OPENMP50]Support for imperfectly nested loops.
Added support for imperfectly nested loops introduced in OpenMP 5.0.
2019-11-04 16:09:25 -05:00
Duncan P. N. Exon Smith 8112a423a8 clang/Modules: Bring back optimization lost in 31e14f41a2
31e14f41a2 accidentally dropped caching of
failed module loads.  This brings it back by making
ModuleMap::getCachedModuleLoad return an Optional.
2019-11-04 11:40:03 -08:00
Craig Topper b2b6a54f84 [X86] Add support for -mvzeroupper and -mno-vzeroupper to match gcc
-mvzeroupper will force the vzeroupper insertion pass to run on
CPUs that normally wouldn't. -mno-vzeroupper disables it on CPUs
where it normally runs.

To support this with the default feature handling in clang, we
need a vzeroupper feature flag in X86.td. Since this flag has
the opposite polarity of the fast-partial-ymm-or-zmm-write we
used to use to disable the pass, we now need to add this new
flag to every CPU except KNL/KNM and BTVER2 to keep identical
behavior.

Remove -fast-partial-ymm-or-zmm-write which is no longer used.

Differential Revision: https://reviews.llvm.org/D69786
2019-11-04 11:03:54 -08:00
Eric Astor be6ac471f6 [ms] Fix Microsoft compatibility handling of commas in nested macro expansions.
In Microsoft-compatibility mode, single commas from nested macro expansions
should not be considered as argument separators; we already emulated this by
marking them to be ignored. However, in MSVC's preprocessor, subsequent
expansions DO treat these commas as argument separators... so we now ignore
each comma at most once.

Includes a small unit test that validates we match MSVC's behavior as shown
in https://gcc.godbolt.org/z/y0twaq

Fixes PR43282

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69626
2019-11-04 12:49:19 -05:00
Amy Huang ab76cfdd20 Recommit "[CodeView] Add option to disable inline line tables."
This reverts commit 004ed2b0d1.
Original commit hash 6d03890384

Summary:
This adds a clang option to disable inline line tables. When it is used,
the inliner uses the call site as the location of the inlined function instead of
marking it as an inline location with the function location.

https://reviews.llvm.org/D67723
2019-11-04 09:15:26 -08:00
Ilya Biryukov 9ba16615fa [Sema] Make helper in TreeTransform.h 'inline' instead of 'static'. NFC
Summary:
There seems to be no evidence that having internal linkage for the function
was intentional. Since 'static' functions are normally used only in .cpp
files, using 'inline' in the header file is more appropriate.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: merge_guards_bot, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69242
2019-11-04 17:07:53 +01:00
Dávid Bolvanský 55507110b9 [Diagnostics] Improve some error messages related to bad use of dynamic_cast 2019-11-04 16:26:43 +01:00
Simon Pilgrim a0324e9113 SanitizerMask::bitPosToMask - fix operator precedence warnings. NFCI.
Fix static analyzer operator precedence warnings with suitable bracketing. Pull out the mask generation code so clang-format doesn't make such a mess of it.
2019-11-04 15:12:01 +00:00
Sven van Haastregt 6c5827975c [OpenCL] Fix FileCheck pattern
For this test, FileCheck is not run with the CHECK prefix; it seems
COMMON was intended here.
2019-11-04 15:08:53 +00:00
Michael Liao d142ec6fef Fix compilation warning. NFC. 2019-11-04 10:01:50 -05:00
Sven van Haastregt 82888b78d4 [OpenCL] Fix address space for const method call from nonconst (PR43145)
Patch by Anastasia Stulova and Sven van Haastregt.

Differential Revision: https://reviews.llvm.org/D68781
2019-11-04 13:12:17 +00:00
David Spickett 91167e22ec [hwasan] Remove lazy thread-initialisation
This was an experiment made possible by a non-standard feature of the
Android dynamic loader.

It required introducing a flag to tell the compiler which ABI was being
targeted.
This flag is no longer needed, since the generated code now works for
both ABI's.

We leave that flag untouched for backwards compatibility. This also
means that if we need to distinguish between targeted ABI's again
we can do that without disturbing any existing workflows.

We leave a comment in the source code and mention in the help text to
explain this for any confused person reading the code in the future.

Patch by Matthew Malcomson

Differential Revision: https://reviews.llvm.org/D69574
2019-11-04 10:58:46 +00:00
Duncan P. N. Exon Smith 31e14f41a2 clang/Modules: Sink CompilerInstance::KnownModules into ModuleMap
Avoid use-after-frees when FrontendAction::BeginSourceFile is called
twice on the same CompilerInstance by sinking
CompilerInstance::KnownModules into ModuleMap.  On the way, rename the
map to CachedModuleLoads.  I considered (but rejected) merging this with
ModuleMap::Modules, since that only has top-level modules and this map
includes submodules.

This is an alternative to https://reviews.llvm.org/D58497.  Thanks to
nemanjai for the detailed analysis of the problem!
2019-11-03 19:57:33 -08:00
Craig Topper 910718bd03 [opaque pointer types] Add element type argument to IRBuilder CreatePreserveStructAccessIndex and CreatePreserveArrayAccessIndex
Summary:
These were the only remaining users of the GetElementPtrInst::getGEPReturnType
method that gets the element type from the pointer type.

Remove that method since its now dead.

Reviewers: jyknight, t.p.northover, arsenm

Reviewed By: arsenm

Subscribers: wdng, arsenm, arphaman, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69756
2019-11-03 10:27:18 -08:00
Aaron Puchert c96428d218 Drop spurious self-include [NFC]
This was introduced in D61357, probably by accident.
2019-11-03 14:29:59 +01:00
Simon Pilgrim 0b4c2ee381 ModuleMap::findHeader - fix null dereference warning. NFCI.
We were checking M for a null value after we'd already dereferenced it multiple times.
2019-11-03 11:33:57 +00:00
Fangrui Song e0b3a8c991 [CodeGenCXX][test] Use -fno-experimental-new-pass-manager for CodeGenCXX/union-tbaa2.cpp after D68593/llvmorg-10-init-8907-gcecc0d27ad5
It fails with -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=0 builds. Temporarily use -fno-experimental-new-pass-manager while we are investigating the root cause.
2019-11-02 15:58:54 -07:00
Simon Pilgrim d0f3c82216 Fix uninitialized variable warnings. NFCI. 2019-11-02 18:03:21 +00:00
Luboš Luňák 4f2104c5ad make -ftime-trace also trace time spent creating debug info
Differential Revision: https://reviews.llvm.org/D69750
2019-11-02 18:12:51 +01:00
Pengfei Wang af3a7de20c [X86] add mayRaiseFPException flag and FPCW registers for X87 instructions
Summary:
This patch adds flag "mayRaiseFPException"  , FPCW and FPSW for X87 instructions which could raise
float exception.

Reviewers: pengfei, RKSimon, andrew.w.kaylor, uweigand, kpn, spatel, cameron.mcinally, craig.topper

Reviewed By: craig.topper

Subscribers: thakis, hiraditya, llvm-commits

Patch by LiuChen.

Differential Revision: https://reviews.llvm.org/D68854
2019-11-01 21:12:43 -07:00
David Blaikie 1de2a05701 DebugInfo: Accept -gdwarf even in clang-cl
Fixes regression introduced by llvmorg-10-init-8908-g098d901bd1b
2019-11-01 15:36:15 -07:00
David Blaikie 098d901bd1 DebugInfo: Let -gdwarf use the toolchain default DWARF version, instead of hardcoded/aliased to -gdwarf-4 2019-11-01 15:17:51 -07:00
David Blaikie 42465f406b DebugInfo: (NFC) Refactor DWARF version calculation to make a future change (-fdebug-default-version) easier 2019-11-01 14:56:43 -07:00
Sourabh Singh Tomar 52ea308f70 [NFC]: Removed an implicit capture argument from lambda. 2019-11-02 01:37:46 +05:30
Vladimir Vereschaka a264e85dd9 [CMake] Add cross Windows to ARM Linux toolchain CMake cache file.
This cache file can be used to build a cross Windows to ARM Linux
toolchain.

Differential Revision: https://reviews.llvm.org/D69651
2019-11-01 12:40:25 -07:00
Thomas Lively 935c84c3c2 [WebAssembly] Add experimental SIMD dot product instruction
Summary:
This instruction is not merged to the spec proposal, but we need it to
be implemented in the toolchain to experiment with it. It is available
only on an opt-in basis through a clang builtin.

Defined in https://github.com/WebAssembly/simd/pull/127.

Depends on D69696.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69697
2019-11-01 10:45:48 -07:00
Yitzhak Mandelbaum 6e759daf2e [libTooling] Add Stencil constructor.
Summary:
Adds a constructor that takes a vector with which to initialize the `Parts`
field and a corresponding free function that forwards to the constructor. These
definitions are needed to assist in transitioning away from `Stencil` as a class
to defining it as a type alias.

Reviewers: ilya-biryukov

Subscribers: cfe-commits, gribozavr

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69632
2019-11-01 11:53:14 -04:00
Sven van Haastregt 0aed36d261 [OpenCL] Support -fdeclare-opencl-builtins in C++ mode
Support for C++ mode was accidentally lacking due to not checking the
OpenCLCPlusPlus LangOpts version.

Differential Revision: https://reviews.llvm.org/D69233
2019-11-01 13:56:43 +00:00
Thomas Lively a07019a275 [WebAssembly] SIMD integer min and max instructions
Summary:
Introduces a clang builtins and LLVM intrinsics representing integer
min/max instructions. These instructions have not been merged to the
SIMD spec proposal yet, so they are currently opt-in only via builtins
and not produced by general pattern matching. If these instructions
are accepted into the spec proposal the builtins and intrinsics will
be replaced with normal pattern matching.

Defined in https://github.com/WebAssembly/simd/pull/27.

Reviewers: aheejin

Reviewed By: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69696
2019-10-31 20:22:11 -07:00
Matt Arsenault c6da9ec0e9 clang: Fix assert on void pointer arithmetic with address_space
This attempted to always use the default address space void pointer
type instead of preserving the source address space.
2019-10-31 20:07:23 -07:00
Heejin Ahn b9903ec897 [clang][driver] Add ProfileData to LLVM_LINK_COMPONENTS
Summary:
After D68351 we need this to make builds with `-DBUILD_SHARED_LIB=ON`
work.

Reviewers: tlively

Subscribers: mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69699
2019-10-31 19:52:41 -07:00
Yaxun (Sam) Liu bb1616ba47 [CodeGen] Fix invalid llvm.linker.options about pragma detect_mismatch
When a target does not support pragma detect_mismatch, an llvm.linker.options
metadata with an empty entry is created, which causes diagnostic in backend
since backend expects name/value pair in llvm.linker.options entries.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D69678
2019-10-31 22:27:35 -04:00
Vedant Kumar d889d1efef [profile] Add a mode to continuously sync counter updates to a file
Add support for continuously syncing profile counter updates to a file.

The motivation for this is that programs do not always exit cleanly. On
iOS, for example, programs are usually killed via a signal from the OS.
Running atexit() handlers after catching a signal is unreliable, so some
method for progressively writing out profile data is necessary.

The approach taken here is to mmap() the `__llvm_prf_cnts` section onto
a raw profile. To do this, the linker must page-align the counter and
data sections, and the runtime must ensure that counters are mapped to a
page-aligned offset within a raw profile.

Continuous mode is (for the moment) incompatible with the online merging
mode. This limitation is lifted in https://reviews.llvm.org/D69586.

Continuous mode is also (for the moment) incompatible with value
profiling, as I'm not sure whether there is interest in this and the
implementation may be tricky.

As I have not been able to test extensively on non-Darwin platforms,
only Darwin support is included for the moment. However, continuous mode
may "just work" without modification on Linux and some UNIX-likes. AIUI
the default value for the GNU linker's `--section-alignment` flag is set
to the page size on many systems. This appears to be true for LLD as
well, as its `no_nmagic` option is on by default. Continuous mode will
not "just work" on Fuchsia or Windows, as it's not possible to mmap() a
section on these platforms. There is a proposal to add a layer of
indirection to the profile instrumentation to support these platforms.

rdar://54210980

Differential Revision: https://reviews.llvm.org/D68351
2019-10-31 16:04:09 -07:00
Michael Spencer d816d9bdc5 [clang][ScanDeps] Fix issue with multiple commands with the same input.
Previously, given a CompilationDatabase with two commands for the same
source file we would report that file twice with the union of the
dependencies for each command both times.

This was due to the way `ClangTool` runs actions given an input source
file (see the comment in `DependencyScanningTool.cpp`). This commit adds
a `SingleCommandCompilationDatabase` that is created with each
`CompileCommand` in the original CDB, which is then used for each
`ClangTool` invocation. This gives us a single run of
`DependencyScanningAction` per `CompileCommand`.

I looked at using `AllTUsToolExecutor` which is a parallel tool
executor, but I'm not sure it's suitable for `clang-scan-deps` as it
does a lot more sharing of state than `AllTUsToolExecutor` expects.

Differential Revision: https://reviews.llvm.org/D69643
2019-10-31 14:22:01 -07:00
Reid Kleckner 19f1dc7b52 Remove unneeded template alias, causes issues with some MSVC version
I built locally with the latest MSVC in c++14 and c++17, but it does not
complain for me. Osman Zakir on llvm-dev reports that they run into
compile errors here.

In any case, it seems prefereable to reuse clang's LLVM.h header to
bring in llvm::Optional and Expected.
2019-10-31 14:20:54 -07:00
Mitchell Balan 8d7bd57526 [clang-format] Fix SpacesInSquareBrackets for Lambdas with Initial "&ref" Parameter
Summary:
This fixes an edge case in the `SpacesInSquareBrackets` option where an initial `&ref` lambda parameter is not padded with an initial space.

`int foo = [&bar ]() {}` is fixed to give `int foo = [ &bar ]() {}`

Reviewers: MyDeveloperDay, klimek, sammccall

Reviewed by: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D69649
2019-10-31 11:08:05 -04:00
Nico Weber 257379855a Build fix after 4b6597f 2019-10-31 07:43:09 -04:00
Balázs Kéri 4980c1333f [clang][analyzer] Using CallDescription in StreamChecker.
Summary:
Recognization of function names is done now with the CallDescription
class instead of using IdentifierInfo. This means function name and
argument count is compared too.
A new check for filtering not global-C-functions was added.
Test was updated.

Reviewers: Szelethus, NoQ, baloghadamsoftware, Charusso

Reviewed By: Szelethus, NoQ, Charusso

Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67706
2019-10-31 12:38:50 +01:00
Nico Weber 4b6597f498 Make flang driver stuff work on macOS
6bf55804 added special-case code for TY_PP_Fortran to
ToolChain::LookupTypeForExtension(), but
Darwin::LookupTypeForExtension() overrode that method without calling
the superclass implementation.

Make it call the superclass implementation to fix things.

Differential Revision: https://reviews.llvm.org/D69636
2019-10-31 07:34:32 -04:00
David Candler 92aa0c2dbc [cfi] Add flag to always generate .debug_frame
This adds a flag to LLVM and clang to always generate a .debug_frame
section, even if other debug information is not being generated. In
situations where .eh_frame would normally be emitted, both .debug_frame
and .eh_frame will be used.

Differential Revision: https://reviews.llvm.org/D67216
2019-10-31 09:48:30 +00:00
Dávid Bolvanský b06305e449 [Diagnostics] Warn for std::is_constant_evaluated in constexpr mode
Summary:
constexpr int fn1() {
  if constexpr (std::is_constant_evaluated()) // condition is always true!
    return 0;
  else
    return 1;
}

constexpr int fn2() {
  if (std::is_constant_evaluated())
    return 0;
  else
    return 1;
}

Solves PR42977

Reviewers: rsmith, aaron.ballman

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69518
2019-10-31 10:03:11 +01:00
Akira Hatanaka c1d2927cc6 Run clang-format on lib/CodeGen/CGCall.h and fix indentation 2019-10-30 18:06:12 -07:00
Amy Huang 004ed2b0d1 Revert "[CodeView] Add option to disable inline line tables."
because it breaks compiler-rt tests.

This reverts commit 6d03890384.
2019-10-30 17:31:12 -07:00
Amy Huang 6d03890384 [CodeView] Add option to disable inline line tables.
Summary:
This adds a clang option to disable inline line tables. When it is used,
the inliner uses the call site as the location of the inlined function instead of
marking it as an inline location with the function location.

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

Reviewers: rnk

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D67723
2019-10-30 16:52:39 -07:00
Michael Spencer 17b64e36e9 [clang][ScanDeps] Fix shadowing warning. 2019-10-30 15:53:38 -07:00
Reid Kleckner 52194350cf Disable new clang-scan-deps test on Windows due to backslash path matching problems 2019-10-30 15:51:34 -07:00
Michael Spencer 33a745e6fe [clang][clang-scan-deps] Add support for extracting full module dependencies.
This is a recommit of d8a4ef0e68 with the nondeterminism fixed.

This adds experimental support for extracting a Clang module dependency graph
from a compilation database. The output format is experimental and will change.
It is currently a concatenation of JSON outputs for each compilation. Future
patches will change this to deduplicate modules between compilations.

Differential Revision: https://reviews.llvm.org/D69420
2019-10-30 15:27:27 -07:00
Michael Spencer 1c88d66223 Revert "[clang][clang-scan-deps] Add support for extracting full module dependencies."
This reverts commit d8a4ef0e68.

This commit broke some of the bots. I believe it's due to nondeterminism. Will fix and recommit.
2019-10-30 15:16:38 -07:00
Reid Kleckner 812bdb3c13 [MS] Don't reference deleted copy ctors from catchable types
When throwing objects with deleted copy constructors, the copy ctor
field of the catchable type should remain null and the mangle name
changes. This already worked in simple cases, but in cases involving
non-trivial subobjects, sometimes LookupCopyingConstructor could return
a non-null but deleted constructor decl. Skip those and don't reference
them.

Fixes PR43680
2019-10-30 15:06:26 -07:00
Michael Spencer d8a4ef0e68 [clang][clang-scan-deps] Add support for extracting full module dependencies.
This adds experimental support for extracting a Clang module dependency graph
from a compilation database. The output format is experimental and will change.
It is currently a concatenation of JSON outputs for each compilation. Future
patches will change this to deduplicate modules between compilations.

Differential Revision: https://reviews.llvm.org/D69420
2019-10-30 14:46:17 -07:00
Richard Smith bb06149131 Fix __attribute__((enable_if)) to treat arguments with side-effects as
non-constant.

We previously failed the entire condition evaluation if an unmodeled
side-effect was encountered in an argument, even if that argument was
unused in the attribute's condition.
2019-10-30 13:39:29 -07:00
Evandro Menezes 215da6606c [clang][llvm] Obsolete Exynos M1 and M2 2019-10-30 15:02:59 -05:00
David Tenty 23df0c783c Revert "[NFC] Rename LLVM_NO_DEAD_STRIP"
This reverts commit 11c2a85db8.
2019-10-30 14:56:20 -04:00
Daniel e477988309 Fix readability-identifier-naming to prevent variables becoming keywords.
Do not provide a fix-it when clang-tidy encounters a name that would become
a keyword.
2019-10-30 14:18:40 -04:00
Peter Waller c75cd3c7f0 [clang][driver][flang] Mark test as unsupported on darwin
D63607 made mac builders unhappy by failing this test, and it isn't
yet obvious why. Mark as unsupported as a temporary measure.

Signed-off-by: Peter Waller <peter.waller@arm.com>
2019-10-30 17:01:59 +00:00
Aaron Ballman 8dcf1c654e Updating the documentation for the _Noreturn attribute; NFC. 2019-10-30 11:42:18 -04:00
Alexey Bataev 37c8baf821 [OPENMP][DOC]Provide correct info about supported features, NFC.
Removed the explicit list of supported features from OpenMP 5.0 and used
the reference to the table instead. Also, fixed info about constructs
that can be executed in SPMD mode, if and num_threads clauses do not
affect it anymore.
2019-10-30 10:38:11 -04:00
Alexey Bataev 8aa74414bf [OPENMP][DOC]Update list of supported functions, NFC.
Added support for parallel master taskloop simd construct.
2019-10-30 10:33:04 -04:00
Alexey Bataev 14a388f43b [OPENMP50]Add support for parallel master taskloop simd directive.
Added full support for parallel master taskloop simd directive.
2019-10-30 10:23:33 -04:00
Raphael Isemann ba7bde65dc [ASTImporter] Add support for BuiltinTemplateDecl
Summary:
That decl kind is currently not implemented. BuiltinTemplateDecl is for decls that are hardcoded in the
ASTContext, so we can import them like we do other builtin decls by just taking the equivalent
decl from the target ASTContext.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong, shafik

Subscribers: rnkovacs, kristina, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69566
2019-10-30 14:53:35 +01:00
Jeremy Morse 6c0a160c2d Rename a flang test case
On Windows and macOS, the filesystem is case insensitive, and these files
interfere with each other. Reading through, the case of the file extension
is part of the test. I've altered the rest of the name instead.
2019-10-30 13:29:47 +00:00
Peter Waller 6bf5580492 [clang][driver] Add basic --driver-mode=flang support for fortran
This patch adds a new Flang mode. When in Flang mode, the driver will
invoke flang for fortran inputs instead of falling back to the GCC
toolchain as it would otherwise do.

The behaviour of other driver modes are left unmodified to preserve
backwards compatibility.

It is intended that a soon to be implemented binary in the flang project
will import libclangDriver and run the clang driver in the new flang
mode.

Please note that since the binary invoked by the driver is under
development, there will no doubt be further tweaks necessary in future
commits.

* Initial support is added for basic driver phases
  * -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified)
  * -### tests are added for all of the above
  * This is more than is supported by f18 so far, which will emit errors
    for those options which are unimplemented.

* A test is added that ensures that clang gives a reasonable error
  message if flang is not available in the path (without -###).

* Test that the driver accepts multiple inputs in --driver-mode=flang.

* Test that a combination of C and Fortran inputs run both clang and
  flang in --driver-mode=flang.

* clang/test/Driver/fortran.f95 is fixed to use the correct fortran
  comment character.

Differential revision: https://reviews.llvm.org/D63607
2019-10-30 10:42:22 +00:00
Richard Smith cbb3104b1c Suppress useless GCC "bitfield is too small to hold all values of enum class" warning. 2019-10-29 17:20:46 -07:00
Reid Kleckner 07ee46d613 [MS] Fix constexpr data member pointer conversions
Constexpr data member conversions work by starting with the class that
originally introduced the field, and converting from there to the type
that the user desires. Before this change, Clang was using the
inheritance model from the final destination class type instead of the
model from the class that originally introduced the field. To fix this,
find the relevant FieldDecl and take its parent class instead of using
the member pointer type the user provided.

Indirect field decls require some special handling to find the parent
class.

Fixes PR43803
2019-10-29 16:58:00 -07:00
Aaron Puchert ae3159e497 Thread safety analysis: Peel away NoOp implicit casts in initializers
Summary:
This happens when someone initializes a variable with guaranteed copy
elision and an added const qualifier. Fixes PR43826.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D69533
2019-10-30 00:37:32 +01:00
Richard Smith dbcb690fb7 Replace std::function in PrintingPolicy with a callbacks object.
This makes PrintingPolicy significantly more lightweight and provides
groundwork for more printing customization hooks.
2019-10-29 15:29:44 -07:00
Eli Friedman 98286b569d [Headers] Fix compatibility between arm_acle.h and intrin.h
Make sure they don't both define __nop.

Differential Revision: https://reviews.llvm.org/D69012
2019-10-29 14:52:56 -07:00
Richard Smith eb535d2341 Accept __is_same_as as a GCC-compatibility synonym for the proper trait name __is_same. 2019-10-29 14:44:38 -07:00
Adrian Prantl f919be3365 [DWARF5] Added support for deleted C++ special member functions.
This patch adds support for deleted C++ special member functions in
clang and llvm. Also added Defaulted member encodings for future
support for defaulted member functions.

Patch by Sourabh Singh Tomar!

Differential Revision: https://reviews.llvm.org/D69215
2019-10-29 13:44:06 -07:00
Richard Smith 52590319a2 Fix argument numbering confusion when diagnosing a non-viable operator().
This could lead to crashes if operator() is a variadic template, as we
could end up asking for an out-of-bounds argument.
2019-10-29 13:08:39 -07:00
Vlad Tsyrklevich efed314118 Revert "[clang-format] Remove the dependency on frontend"
This reverts commit ec66603ac7. It was
causing ubsan failures like the following on the ubsan bot:
llvm/lib/Support/SourceMgr.cpp:440:48: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffa
2019-10-29 10:48:03 -07:00
Guillaume Chatelet 1c85a2e8dc isBuiltinFunc() uses StringRef instead of const char*
Summary: This prevents a bug when passing nullptr, StringRef ctor would call strlen(nullptr).

Reviewers: vlad.tsyrklevich

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69569
2019-10-29 17:36:55 +01:00
Guillaume Chatelet 5607ff12fa Fix missing memcpy builtin on ppc64be
See D68028
2019-10-29 16:35:32 +01:00
Guillaume Chatelet 98f3151a7d [clang] Add no_builtin attribute
Summary:
This is a follow up on https://reviews.llvm.org/D61634
This patch is simpler and only adds the no_builtin attribute.

Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert

Subscribers: mgrang, cfe-commits

Tags: #clang

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

This is a re-submit after it got reverted in https://reviews.llvm.org/rGbd8791610948 since the breakage doesn't seem to come from this patch.
2019-10-29 15:50:29 +01:00
Alexey Bataev c09c0651a4 [OPENMP]Fix PR43772: No warning in non-combined target regions.
Need to analyze inner target regions in case of implicit mapping of the
data members when target region is created in one of the class member
functions.
2019-10-29 10:31:24 -04:00
Krzysztof Parzyszek 99f51960fd [Hexagon] Handle remaining registers in getRegisterByName()
This fixes https://llvm.org/PR43829.
2019-10-29 08:56:01 -05:00
Michael Spencer dddec1f184 [clang][clang-scan-deps] Add -fcxx-modules to test for Darwin. 2019-10-28 17:37:25 -07:00
Reid Kleckner 9ecd3225d1 [NFC] Fix some indentation disturbed in D67368 2019-10-28 17:12:43 -07:00
Dávid Bolvanský dfece0a108 [Builtins] Teach Clang about memccpy
Summary: Hopefully, -fno-builtin-memccpy will work now. Required for https://reviews.llvm.org/D67986.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Subscribers: RKSimon, kristina, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68377
2019-10-28 23:27:08 +01:00
Vlad Tsyrklevich ad531fff81 Revert "[clang] Add no_builtin attribute"
This reverts commit bd87916109. It was
causing ASan/MSan failures on the sanitizer buildbots.
2019-10-28 15:21:59 -07:00
Vlad Tsyrklevich 38839d08b8 Revert "[Concepts] Constraint Enforcement & Diagnostics"
This reverts commit ffa214ef22, it was
causing ASAN test failures on sanitizer-x86_64-linux-bootstrap.
2019-10-28 15:00:40 -07:00
Reid Kleckner 7cd595df96 Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"
This reverts commit 9d4806a387.

There seem to be bugs in llvm-cov --path-equivalence that are causing
Chromium problems. Revert this until they are understood or fixed.
2019-10-28 14:40:17 -07:00
Leonard Chan 85b718f53a [Driver] Enable ShadowCallStack, not SafeStack, by default on AArch64 Fuchsia
Submitted for mcgrathr.

On AArch64, Fuchsia fully supports both SafeStack and ShadowCallStack ABIs.
The latter is now preferred and will be the default. It's possible to
enable both simultaneously, but ShadowCallStack is believed to have most
of the practical benefit of SafeStack with less cost.

Differential Revision: https://reviews.llvm.org/D66712
2019-10-28 14:19:38 -07:00
Francis Visoiu Mistrih f5094e1829 [Remarks] Fix Sphinx formatting 2019-10-28 13:13:39 -07:00
Francis Visoiu Mistrih 025166cf48 [Remarks] Add bitstream to the list of supported formats in clang 2019-10-28 13:08:05 -07:00
Simon Pilgrim f2132070d9 Lexer::ReadToEndOfLine - fix Token uninitialised value warnings. NFCI.
Use Token::startToken to initialize Token.
2019-10-28 18:28:18 +00:00
Alexey Bataev 7c86069820 [OPENMP]Fix PR43771: Do not capture contexprs variables.
If the variable is a constexpr variable, it should not be captured in the OpenMP region.
2019-10-28 13:29:02 -04:00
Guillaume Chatelet bd87916109 [clang] Add no_builtin attribute
Summary:
This is a follow up on https://reviews.llvm.org/D61634
This patch is simpler and only adds the no_builtin attribute.

Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert

Subscribers: mgrang, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68028
2019-10-28 17:30:11 +01:00
Andrew Paverd d157a9bc8b Add Windows Control Flow Guard checks (/guard:cf).
Summary:
A new function pass (Transforms/CFGuard/CFGuard.cpp) inserts CFGuard checks on
indirect function calls, using either the check mechanism (X86, ARM, AArch64) or
or the dispatch mechanism (X86-64). The check mechanism requires a new calling
convention for the supported targets. The dispatch mechanism adds the target as
an operand bundle, which is processed by SelectionDAG. Another pass
(CodeGen/CFGuardLongjmp.cpp) identifies and emits valid longjmp targets, as
required by /guard:cf. This feature is enabled using the `cfguard` CC1 option.

Reviewers: thakis, rnk, theraven, pcc

Subscribers: ychen, hans, metalcanine, dmajor, tomrittervg, alex, mehdi_amini, mgorny, javed.absar, kristof.beyls, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D65761
2019-10-28 15:19:39 +00:00
vhscampos f6e11a36c4 [ARM][AArch64] Implement __cls, __clsl and __clsll intrinsics from ACLE
Summary:
Writing support for three ACLE functions:
  unsigned int __cls(uint32_t x)
  unsigned int __clsl(unsigned long x)
  unsigned int __clsll(uint64_t x)

CLS stands for "Count number of leading sign bits".

In AArch64, these two intrinsics can be translated into the 'cls'
instruction directly. In AArch32, on the other hand, this functionality
is achieved by implementing it in terms of clz (count number of leading
zeros).

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69250
2019-10-28 11:06:58 +00:00
vhscampos 5d35b7d9e1 [ARM][AArch64] Implement __arm_rsrf, __arm_rsrf64, __arm_wsrf & __arm_wsrf64
Summary:
Adding support for ACLE intrinsics.

Patch by Michael Platings.

Reviewers: chill, t.p.northover, efriedma

Reviewed By: chill

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69297
2019-10-28 10:59:18 +00:00
Ilya Biryukov d9971d0b2e [clangd] Do not insert parentheses when completing a using declaration
Summary:
Would be nice to also fix this in clang, but that looks like more work
if we want to preserve signatures in informative chunks.

Fixes https://github.com/clangd/clangd/issues/118

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69382
2019-10-28 09:45:10 +01:00
Richard Smith a4facd355d [c++20] Enforce rule that a union-like class or class with reference
members cannot have defaulted comparisons.
2019-10-27 23:26:44 -07:00
Richard Smith 39eef2cbb6 PR43775: don't produce a bogus 'auto' -Wc++98-compat warning for CTAD 2019-10-27 21:42:58 -07:00
Matt Arsenault 56a503bdba OpenMP: Add convergent to more runtime functions
Several of these other functions are probably also convergent, but
these two seem obviously convergent.
2019-10-27 21:26:55 -07:00
Matt Arsenault 40ab8ae9fb OpenMP: Add helper function for convergent runtime calls
Most of the functions emitted here should probably be convergent, but
only barriers are currently marked. Introduce this helper before
adding convergent to more functions.
2019-10-27 21:26:55 -07:00
Richard Smith 06d3fce01d PR43400: Add test that we can instantiate a friend function that is
defined as deleted.

The actual bug was fixed in commit d052a578.
2019-10-27 12:41:53 -07:00
Richard Smith faee39baa8 PR43762: when implicitly changing the active union member for an
assignment during constant evaluation, only start the lifetime of
trivially-default-constructible union members.
2019-10-27 12:31:16 -07:00
Greg Bedwell d4758d4a8d Fix a spelling mistake in a couple of intrinsic description comments. NFC 2019-10-27 09:42:14 +00:00
Sergey Dmitriev edb1a1de1b Reland "[Clang][Bundler] Error reporting improvements"
- Changed FileHandler read/write methods to return llvm::Error
- Using unified way of reporting errors
- Removed trailing '.' from the error messages

Differential Revision: https://reviews.llvm.org/D67031
2019-10-25 19:00:06 -07:00
Sergey Dmitriev 93b29d3882 Revert "[Clang][Bundler] Error reporting improvements"
This reverts commit dd501045cd.
2019-10-25 17:57:55 -07:00
John McCall baf91d02da [NFC] Add a tablegen node for the root of the AST node hierarchies.
This is useful for the property databases we want to add for abstract
serialization, since root classes can have interesting properties.
2019-10-25 16:39:21 -07:00
Sergey Dmitriev dd501045cd [Clang][Bundler] Error reporting improvements
- Changed FileHandler read/write methods to return llvm::Error
- Using unified way of reporting errors
- Removed trailing '.' from the error messages

Differential Revision: https://reviews.llvm.org/D67031
2019-10-25 16:29:57 -07:00
Michael Spencer 8da20560ab [clang][DependencyScanning] 80-col. 2019-10-25 15:43:57 -07:00
David Goldman 7a2b704bf0 [Sema][Typo Correction] Fix another infinite loop on ambiguity
See also: D67515

- For the given call expression we would end up repeatedly
   trying to transform the same expression over and over again

- Fix is to keep the old TransformCache when checking for ambiguity

Differential Revision: https://reviews.llvm.org/D69060
2019-10-25 13:20:27 -04:00
paulhoad 6df7ef0d8b [clang-format] [NFC] update the documentation in Format.h to allow dump_format_style.py to get a little closer to being correct.
Summary:
Running dump_format_style.py on the tip of the trunk causes ClangFormatStyleOptions.rst to have changes, which I think ideally it shouldn't.

Some recent commits have meant Format.h and ClangFormatStyleOptions.rst have become out of sync such that dump_format_style.py either couldn't be run or generated incorrect .rst files.

It's also important to remember to edit the IncludeStyles from Tooling.

Make a couple of changes {D6833} {D64695} which came from recent clang-format commits that missed this step. There are still a couple of other changes  from commit {D67541} {D68296} which also need to be looked at, but I'd like to park these first two changes first.

The authors of these original commits I've included in the reviewers, I'm happy to work on the changes, just really need to know which is the ground truth of the changes you want to keep (whats in the Format.h) or what is in the ClangFormatStyleOptions.rst

Reviewers: klimek, mitchell-stellar, owenpan, jvoung, Manikishan, sammccall

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D69404
2019-10-25 14:46:19 +01:00
David Tenty 11c2a85db8 [NFC] Rename LLVM_NO_DEAD_STRIP
Summary:
The variable LLVM_NO_DEAD_STRIP is set in LLVM cmake files when building executables that might make use of plugins .The name of the variable does not convey the actual intended usage (i.e. for use with tools that have plugins), just what the eventual effect of setting in on some (i.e. not garbage collecting unused symbols).

This patch renames it to LLVM_SUPPORT_PLUGINS to convey the intended usage, which will allow subsequent patches to add behavior to support that in different ways without confusion about whether it will do on, for example, non-gnu platforms.

Reviewers: hubert.reinterpretcast, stevewan

Reviewed By: stevewan

Subscribers: cfe-commits, mgorny, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D69356
2019-10-25 09:32:00 -04:00
Haojian Wu 3d9632a997 [clang-rename] NFC, make getCanonicalSymbolDeclaration robust on nullptr input. 2019-10-25 14:33:04 +02:00
Simon Tatham 11ce19d211 [clang] Switch arm-mve-intrinsics tests to use %clang_cc1.
It isn't really necessary for them to run the clang driver, and it's
more efficient not to (and also more stable against driver changes).
Now they invoke cc1 directly, more like the analogous NEON tests.

Reviewers: dmgreen

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69426
2019-10-25 12:00:38 +01:00
Simon Tatham 24ef631f43 Fix file-ordering nit in D67161.
Re-sorted the module names in clang/utils/TableGen/CMakeLists.txt back
into alphabetical order.
2019-10-25 09:22:07 +01:00
Michael Liao 45787e5682 Fix compilation warning. NFC. 2019-10-25 01:06:52 -04:00
Michael Liao 5a48678a6a [hip] Allow the declaration of functions with variadic arguments in HIP.
Summary:
- As variadic parameters have the lowest rank in overload resolution,
  without real usage of `va_arg`, they are commonly used as the
  catch-all fallbacks in SFINAE. As the front-end still reports errors
  on calls to `va_arg`, the declaration of functions with variadic
  arguments should be allowed in general.

Reviewers: jlebar, tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69389
2019-10-25 00:39:24 -04:00
Michael Spencer 7af309a4ed [clang][DependencyScanning] clang-format. 2019-10-24 18:28:01 -07:00
Yuanfang Chen ef7a154d17 [clang][ThinLTO] Promote cc1 -fthin_link_bitcode to driver -fthinlto_link_bitcode
Summary:
A necessary step to let build system caching work for its output.

Reviewers: tejohnson, steven_wu

Reviewed by: tejohnson

Subscribers: mehdi_amini, inglorion, dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69406
2019-10-24 16:54:45 -07:00
Jordan Rupprecht 6d424a161b Revert "Recommit "[Clang] Pragma vectorize_width() implies vectorize(enable)""
This reverts commit 80371c74ae.

Given the following source:
```
void a() {
  for (;;)
    ;
}
```

It incorrectly enables vectorization (with vector width 1), as well as generating a warning that vectorization could not be performed.
2019-10-24 16:35:45 -07:00
Petr Hosek 7fff716ec4 [CMake] Update Fuchsia build configuration
This includes several changes to our toolchain build:
- Switch from RelWithDebInfo to Release as we don't currently use the
  debug info and therefore don't need to produce it.
- Disable unwind tables since we don't need them.
- Disable Clang static analyzer and ARCMT since we don't use it.
- Disable Go tests since we don't distribute Go bindings.
- Set the deployment target for macOS to 10.7 to make the toolchain
  usable on older systems.
- Restrict the targets we build runtimes for on Darwin only the ones
  we actually need.
- Drop llc and opt from the distribution since we don't need them.

Differential Revision: https://reviews.llvm.org/D69415
2019-10-24 16:35:29 -07:00
Michael Spencer 9ab6d8236b [clang-scan-deps] Add basic support for modules.
This fixes two issues that prevent simple uses of modules from working.

* We would previously minimize _every_ file opened by clang, even module maps
  and module pcm files. Now we only minimize files with known extensions. It
  would be better if we knew which files clang intended to open as a source
  file, but this works for now.

* We previously cached every lookup, even failed lookups. This is a problem
  because clang stats the module cache directory before building a module and
  creating that directory. If we cache that failure then the subsequent pcm
  load doesn't see the module cache and fails.

Overall this still leaves us building minmized modules on disk during scanning.
This will need to be improved eventually for performance, but this is correct,
and works for now.

Differential Revision: https://reviews.llvm.org/D68835
2019-10-24 16:19:11 -07:00
Jinsong Ji 9671d1dc17 [clang]Fixup clang -Werror,,-Wcovered-switch-default build failures
llvm/clang/lib/CodeGen/CGBuiltin.cpp:6877:3: error: default label in
switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]

Similar to
https://reviews.llvm.org/rG7b3de1e811972b874d91554642ccb2ef5b32eed6
2019-10-24 22:49:17 +00:00
Richard Smith 70f59b5bbc When diagnosing an ambiguity, only note the candidates that contribute
to the ambiguity, rather than noting all viable candidates.
2019-10-24 14:58:29 -07:00
Saar Raz ffa214ef22 [Concepts] Constraint Enforcement & Diagnostics
Part of the C++20 concepts implementation effort.
- Associated constraints (requires clauses, currently) are now enforced when instantiating/specializing templates and when considering partial specializations and function overloads.
- Elaborated diagnostics give helpful insight as to why the constraints were not satisfied.
Phabricator: D41569
2019-10-25 00:19:51 +03:00
David Tenty 201ed14aea Follow on to Namespace fixup for D68340
remove using directive that can make lookup ambiguous.
2019-10-24 17:01:17 -04:00
Simon Pilgrim 126a72fcbf Fix MSVC "not all control paths return a value" warnings. NFCI. 2019-10-24 13:40:13 -07:00
Stephan T. Lavavej 2e4f1e112d [www] Change URLs to HTTPS.
This changes most URLs in llvm's html files to HTTPS. Most changes were
search-and-replace with manual verification; some changes were manual.
For a few URLs, the websites were performing redirects or had changed
their anchors; I fixed those up manually. This consistently uses the
official https://wg21.link redirector. This also strips trailing
whitespace and fixes a couple of typos.

Fixes D69363.

There are a very small number of dead links for which I don't know any
replacements (they are equally dead as HTTP or HTTPS):

https://llvm.org/cmds/llvm2cpp.html
https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-desktop.mp4
https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-mobile.mp4
https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-desktop.mov
https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-mobile.mp4
https://llvm.org/perf/db_default/v4/nts/22463
https://polly.llvm.org/documentation/memaccess.html
2019-10-24 13:25:15 -07:00
paulhoad 23b7836415 [clang-format] update documentation
Summary:
  - Added example code for BreakStringLiterals;

Reviewers: MyDeveloperDay

Reviewed By: MyDeveloperDay

Patch By: mrexodia

Subscribers: cfe-commits, MyDeveloperDay

Tags: #clang-tools-extra, #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D31574
2019-10-24 21:10:13 +01:00
David Tenty 76ee21e1d0 Namespace fixup for D68340 build on MSVC
we seem to run into issues with nested namespace lookups in recently landed
D68340 so just make them explicit.
2019-10-24 15:47:08 -04:00
paulhoad 8fa5e98fd1 [clang-format] Remove duplciate code from Invalid BOM detection
Summary:
Review comments on {D68767} asked that this duplicated code in clang-format was moved to one central location that being SourceManager (where it had originally be copied from I assume)

Moved function into static function  ContentCache::getInvalidBOM(...)  - (closest class to where it was defined before)
Updated clang-format to call this static function

Added unit tests for said new function in BasicTests

Sorry not my normal code area so may have the wrong reviewers. (but your names were on the recent history)

Reviewers: bruno, arphaman, klimek, owenpan, mitchell-stellar, dexonsmith

Reviewed By: owenpan

Subscribers: cfe-commits

Tags: #clang, #clang-format, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D68914
2019-10-24 20:24:44 +01:00
David Green 78700ef886 [ARM] Fixup MVE intrinsic tests with no assert builds
The labels will be missing, so -fno-discard-value-names is added to the tests.
2019-10-24 19:59:15 +01:00
stevewan bb6a27fc25 Add AIX toolchain and basic linker functionality
Summary:
This patch adds AIX toolchain infrastructure into driver, and enables AIX
system linker invocation with some basic functionality support

Reviewers: daltenty, hubert.reinterpretcast, jasonliu, Xiangling_L

Reviewed By: jasonliu

Subscribers: Xiangling_L, jasonliu, ormris, wuzish, nemanjai, mgorny, kbarton, jfb, jsji, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68340
2019-10-24 14:47:57 -04:00
David Green 7b3de1e811 [ARM] Attempt to fixup MveEmitter warnings
Change-Id: I3fb06de2202c3b7a9ce511a40e758d0971ef9fdb
2019-10-24 19:43:15 +01:00
paulhoad ec66603ac7 [clang-format] Remove the dependency on frontend
Summary:
Address review comments from {D68554} by trying to drop the dependency again on Frontend whilst keeping the same format diagnostic messages

Not completely happy with having to do a split in order to get the StringRef for the Line the error occurred on, but could see a way to use SourceManager and SourceLocation to give me a single line?

But this removes the dependency on frontend which should keep the binary size down.

Reviewers: thakis, klimek, mitchell-stellar

Reviewed By: klimek

Subscribers: mgorny, cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D68969
2019-10-24 19:03:57 +01:00
Simon Tatham 08074cc965 [clang,ARM] Initial ACLE intrinsics for MVE.
This commit sets up the infrastructure for auto-generating <arm_mve.h>
and doing clang-side code generation for the builtins it relies on,
and demonstrates that it works by implementing a representative sample
of the ACLE intrinsics, more or less matching the ones introduced in
LLVM IR by D67158,D68699,D68700.

Like NEON, that header file will provide a set of vector types like
uint16x8_t and C functions with names like vaddq_u32(). Unlike NEON,
the ACLE spec for <arm_mve.h> includes a polymorphism system, so that
you can write plain vaddq() and disambiguate by the vector types you
pass to it.

Unlike the corresponding NEON code, I've arranged to make every user-
facing ACLE intrinsic into a clang builtin, and implement all the code
generation inside clang. So <arm_mve.h> itself contains nothing but
typedefs and function declarations, with the latter all using the new
`__attribute__((__clang_builtin))` system to arrange that the user-
facing function names correspond to the right internal BuiltinIDs.

So the new MveEmitter tablegen system specifies the full sequence of
IRBuilder operations that each user-facing ACLE intrinsic should
translate into. Where possible, the ACLE intrinsics map to standard IR
operations such as vector-typed `add` and `fadd`; where no standard
representation exists, I call down to the sample IR intrinsics
introduced in an earlier commit.

Doing it like this means that you get the polymorphism for free just
by using __attribute__((overloadable)): the clang overload resolution
decides which function declaration is the relevant one, and _then_ its
BuiltinID is looked up, so by the time we're doing code generation,
that's all been resolved by the standard system. It also means that
you get really nice error messages if the user passes the wrong
combination of types: clang will show the declarations from the header
file and explain why each one doesn't match.

(The obvious alternative approach would be to have wrapper functions
in <arm_mve.h> which pass their arguments to the underlying builtins.
But that doesn't work in the case where one of the arguments has to be
a constant integer: the wrapper function can't pass the constantness
through. So you'd have to do that case using a macro instead, and then
use C11 `_Generic` to handle the polymorphism. Then you have to add
horrible workarounds because `_Generic` requires even the untaken
branches to type-check successfully, and //then// if the user gets the
types wrong, the error message is totally unreadable!)

Reviewers: dmgreen, miyuki, ostannard

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67161
2019-10-24 16:33:13 +01:00
Simon Tatham 7c11da0cfd [clang] New __attribute__((__clang_arm_mve_alias)).
This allows you to declare a function with a name of your choice (say
`foo`), but have clang treat it as if it were a builtin function (say
`__builtin_foo`), by writing

  static __inline__ __attribute__((__clang_arm_mve_alias(__builtin_foo)))
  int foo(args);

I'm intending to use this for the ACLE intrinsics for MVE, which have
to be polymorphic on their argument types and also need to be
implemented by builtins. To avoid having to implement the polymorphism
with several layers of nested _Generic and make error reporting
hideous, I want to make all the user-facing intrinsics correspond
directly to clang builtins, so that after clang resolves
__attribute__((overloadable)) polymorphism it's already holding the
right BuiltinID for the intrinsic it selected.

However, this commit itself just introduces the new attribute, and
doesn't use it for anything.

To avoid unanticipated side effects if this attribute is used to make
aliases to other builtins, there's a restriction mechanism: only
(BuiltinID, alias) pairs that are approved by the function
ArmMveAliasValid() will be permitted. At present, that function
doesn't permit anything, because the Tablegen that will generate its
list of valid pairs isn't yet implemented. So the only test of this
facility is one that checks that an unapproved builtin _can't_ be
aliased.

Reviewers: dmgreen, miyuki, ostannard

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67159
2019-10-24 16:33:13 +01:00
evgeny 1ae8e8d25f Don't add -fsplit-lto-unit for thin LTO builds with PS4 and Darwin toolchains
These toolchains use legacy thin LTO API, which is not capable of unit splitting
Differential revision: https://reviews.llvm.org/D69173
2019-10-24 14:10:03 +03:00
Chandler Carruth dc1499b90d Improve Clang's getting involved document and make it more inclusive in wording.
Summary: Working with Meike and others to improve the wording in this document.

Reviewers: klimek

Subscribers: mcrosier, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69351
2019-10-23 16:11:24 -07:00
Artem Dergachev be86fdb86e [analyzer] Fix off-by-one in operator call parameter binding.
Member operator declarations and member operator expressions
have different numbering of parameters and arguments respectively:
one of them includes "this", the other does not.

Account for this inconsistency when figuring out whether
the parameter needs to be manually rebound from the Environment
to the Store when entering a stack frame of an operator call,
as opposed to being constructed with a constructor and as such
already having the necessary Store bindings.

Differential Revision: https://reviews.llvm.org/D69155
2019-10-23 08:17:02 -07:00
Sam McCall a9c3c176ad Reland "[Support] Add a way to run a function on a detached thread""
This reverts commit 7bc7fe6b78.
The immediate callers have been fixed to pass nullopt where appropriate.
2019-10-23 15:51:44 +02:00
Mirko Brkusanin 4b63ca1379 [Mips] Use appropriate private label prefix based on Mips ABI
MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64
regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo
we can find out Mips ABI and pick appropriate prefix.

Tags: #llvm, #clang, #lldb

Differential Revision: https://reviews.llvm.org/D66795
2019-10-23 12:24:35 +02:00
Richard Smith d052a578de [c++2a] Allow comparison functions to be explicitly defaulted.
This adds some initial syntactic checking that only the appropriate
function signatures can be defaulted. No implicit definitions are
generated yet.
2019-10-22 18:16:17 -07:00
Hans Wennborg 4c539e8da1 Revert r374202"[ObjC generics] Fix not inheriting type bounds in categories/extensions."
This introduced new errors, see below. Reverting until that can be investigated
properly.

  #import <AVFoundation/AVFoundation.h>

  void f(int width, int height) {
    FourCharCode best_fourcc = kCMPixelFormat_422YpCbCr8_yuvs;
    NSDictionary* videoSettingsDictionary = @{
      (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc),
    };
  }

  $ clang++ -c /tmp/a.mm

  /tmp/a.mm:6:5: error: cannot initialize a parameter of type
  'KeyType<NSCopying>  _Nonnull const' (aka 'const id') with an rvalue
  of type 'id'
      (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc),
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

> When a category/extension doesn't repeat a type bound, corresponding
> type parameter is substituted with `id` when used as a type argument. As
> a result, in the added test case it was causing errors like
>
> > type argument 'T' (aka 'id') does not satisfy the bound ('id<NSCopying>') of type parameter 'T'
>
> We are already checking that type parameters should be consistent
> everywhere (see `checkTypeParamListConsistency`) and update
> `ObjCTypeParamDecl` to have correct underlying type. And when we use the
> type parameter as a method return type or a method parameter type, it is
> substituted to the bounded type. But when we use the type parameter as a
> type argument, we check `ObjCTypeParamType` that ignores the updated
> underlying type and remains `id`.
>
> Fix by desugaring `ObjCTypeParamType` to the underlying type, the same
> way we are doing with `TypedefType`.
>
> rdar://problem/54329242
>
> Reviewers: erik.pilkington, ahatanak
>
> Reviewed By: erik.pilkington
>
> Subscribers: jkorous, dexonsmith, ributzka, cfe-commits
>
> Differential Revision: https://reviews.llvm.org/D66696
2019-10-22 22:39:01 +02:00
Yaxun (Sam) Liu 1c98ff49a3 Fix name of warn_ignored_hip_only_option
Differential Revision: https://reviews.llvm.org/D69268
2019-10-22 16:36:28 -04:00
Simon Cook aed9d6d64a [RISCV] Add support for -ffixed-xX flags
This adds support for reserving GPRs such that the compiler will not
choose a register for register allocation. The implementation follows
the same design as for AArch64; each reserved register becomes a target
feature and used for getting the reserved registers for a given
MachineFunction. The backend checks that it does not need to write to
any reserved register; if it does a relevant error is generated.

Differential Revision: https://reviews.llvm.org/D67185
2019-10-22 21:25:01 +01:00
Yaxun (Sam) Liu 68f5ca4e19 [HIP] Add option -fgpu-allow-device-init
Add this option to allow device side class type global variables
with non-trivial ctor/dtor. device side init/fini functions will
be emitted, which will be executed by HIP runtime when
the fat binary is loaded/unloaded.

This feature is to facilitate implementation of device side
sanitizer which requires global vars with non-trival ctors.

By default this option is disabled.

Differential Revision: https://reviews.llvm.org/D69268
2019-10-22 16:06:20 -04:00
Benjamin Kramer ecc999101a [FrontendTests] Try again to make test not write an output file
Setting the output stream to nulls seems to work.

llvm-svn: 375491
2019-10-22 08:44:34 +00:00
Benjamin Kramer 2108a974f7 Revert "[FrontendTests] Don't actually run the full compiler, parsing is sufficient."
This reverts commit 375488.

llvm-svn: 375489
2019-10-22 08:37:15 +00:00
Benjamin Kramer 3ca2b17f84 [FrontendTests] Don't actually run the full compiler, parsing is sufficient.
llvm-svn: 375488
2019-10-22 08:10:51 +00:00
Benjamin Kramer 64226b2df6 [clang-fuzzer] Update proto fuzzer example for r375453.
llvm-svn: 375487
2019-10-22 07:51:37 +00:00
Kousik Kumar fb042b094f Refactor DependencyScanningTool to its own file
Summary:
There's no behavior change - just moving DependencyScanningTool to its own file
since this tool can be reused across both clang-scan-deps binary and an interface
exposed as part of libClang APIs.

Reviewers: arphaman, jkorous, Bigcheese, dexonsmith

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 375483
2019-10-22 05:05:18 +00:00
Michael Liao 114de1eab2 Minor coding style fix. NFC.
llvm-svn: 375478
2019-10-22 04:32:30 +00:00
Joerg Sonnenberger cb92413c52 Fix -fuse-init-array decision logic on NetBSD
For NetBSD 9 and later, it is the default. On older versions, only ARM
and AArch64 use it by default.

llvm-svn: 375468
2019-10-21 23:35:33 +00:00
Michael J. Spencer 8896d073b1 [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics.
This is a recommit of r375322 and r375327 with a fix for the Windows test breakage.

llvm-svn: 375466
2019-10-21 22:51:13 +00:00
David Goldman e5ecba4f53 [clang-fuzzer] Add new fuzzer target for Objective-C
Summary:
- Similar to that of `clang-fuzzer` itself but instead only
  targets Objective-C source files via cc1

- Also adds an example corpus directory containing some
  input for Objective-C

Subscribers: mgorny, jfb, cfe-commits

Tags: #clang

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

llvm-svn: 375453
2019-10-21 20:45:02 +00:00
Simon Pilgrim 502a509e47 SemaTemplateDeduction - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375443
2019-10-21 19:08:31 +00:00
Scott Linder 87cb734c04 [Clang] Add VerboseOutputStream to CompilerInstance
Remove one instance of a hardcoded output stream in
CompilerInstance::ExecuteAction. There are still other cases of output
being hard-coded to standard streams in ExecuteCompilerInvocation, but
this patch covers the case when no flags like -version or -help are
passed, namely the "X warnings and Y errors generated." diagnostic.

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

llvm-svn: 375442
2019-10-21 19:04:56 +00:00
Simon Pilgrim afb163f53a SemaExceptionSpec - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375440
2019-10-21 18:28:31 +00:00
Fangrui Song 0cfd9e5b58 [test] Merge Driver/as-w-warnings.c into as-no-warnings.c
For -integrated-as RUN lines we can remove -target.

llvm-svn: 375439
2019-10-21 18:04:52 +00:00
Bjorn Pettersson 78424e5f84 Prune include of DataLayout.h from include/clang/Basic/TargetInfo.h. NFC
Summary:
Use a forward declaration of DataLayout instead of including
DataLayout.h in clangs TargetInfo.h. This reduces include
dependencies toward DataLayout.h (and other headers such as
DerivedTypes.h, Type.h that is included by DataLayout.h).

Needed to move implemantation of TargetInfo::resetDataLayout
from TargetInfo.h to TargetInfo.cpp.

Reviewers: rnk

Reviewed By: rnk

Subscribers: jvesely, nhaehnle, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 375438
2019-10-21 17:58:14 +00:00
Bjorn Pettersson 1f43ea41c3 Prune Pass.h include from DataLayout.h. NFCI
Summary:
Reduce include dependencies by no longer including Pass.h from
DataLayout.h. That include seemed irrelevant to DataLayout, as
well as being irrelevant to several users of DataLayout.

Reviewers: rnk

Reviewed By: rnk

Subscribers: mehdi_amini, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 375436
2019-10-21 17:51:54 +00:00
Simon Pilgrim 67854aa33d Fix Wdocumentation warning. NFCI.
llvm-svn: 375434
2019-10-21 17:45:18 +00:00
Adrian Prantl 122e7af03d PCH debug info: Avoid appending the source directory to an absolute path
When building a precompiled header in -fmodule-format=obj (i.e.,
`-gmodules) in an absolute path, the locig in
CGDebugInfo::createCompileUnit would unconditionally append the source
directory to the -main-file-name. This patch avoids that behavior for
absolute paths.

rdar://problem/46045865

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

llvm-svn: 375423
2019-10-21 16:44:37 +00:00
Yaxun Liu e6125fc0ec [AMDGPU] Fix assertion due to initializer list
Sometimes a global var is replaced by a different llvm value. clang use GetAddrOfGlobalVar to get the original llvm global variable.
For most targets, GetAddrOfGlobalVar returns either the llvm global variable or a bitcast of the llvm global variable.
However, for AMDGPU target, GetAddrOfGlobalVar returns the addrspace cast or addrspace cast plus bitcast of the llvm global variable.
To get the llvm global variable, these casts need to be stripped, otherwise there is assertion.

This patch fixes that.

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

llvm-svn: 375362
2019-10-20 15:02:22 +00:00
Michael J. Spencer 81a01e73fa Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics." and "[Docs] Fix header level."
The test doesn't work on Windows. I'll fix it and recommit later.

llvm-svn: 375338
2019-10-19 09:45:28 +00:00
Artem Dergachev 4a5df7312e [analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.
Patch by Kristóf Umann!

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

llvm-svn: 375329
2019-10-19 01:50:46 +00:00
Artem Dergachev ab2cec8b85 [analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.
'self' was previously never tracked, but now it can be tracked
because it may be part of a condition.

llvm-svn: 375328
2019-10-19 01:50:43 +00:00
Michael J. Spencer d7cf99ae03 [Docs] Fix header level.
llvm-svn: 375327
2019-10-19 01:48:57 +00:00
Richard Trieu 637af4cc37 Add -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"
Extend -Wparentheses to cover mixing bitwise-and and bitwise-or with the
conditional operator. There's two main cases seen with this:

unsigned bits1 = 0xf0 | cond ? 0x4 : 0x1;
unsigned bits2 = cond1 ? 0xf0 : 0x10 | cond2 ? 0x5 : 0x2;

// Intended order of evaluation:
unsigned bits1 = 0xf0 | (cond ? 0x4 : 0x1);
unsigned bits2 = (cond1 ? 0xf0 : 0x10) | (cond2 ? 0x5 : 0x2);

// Actual order of evaluation:
unsigned bits1 = (0xf0 | cond) ? 0x4 : 0x1;
unsigned bits2 = cond1 ? 0xf0 : ((0x10 | cond2) ? 0x5 : 0x2);

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

llvm-svn: 375326
2019-10-19 01:47:49 +00:00
Michael J. Spencer 14a3f77ba1 [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics.
Differential Revision: https://reviews.llvm.org/D68528

llvm-svn: 375322
2019-10-19 01:36:37 +00:00
Richard Trieu 8b0d14a8f0 New tautological warning for bitwise-or with non-zero constant always true.
Taking a value and the bitwise-or it with a non-zero constant will always
result in a non-zero value. In a boolean context, this is always true.

if (x | 0x4) {}  // always true, intended '&'

This patch creates a new warning group -Wtautological-bitwise-compare for this
warning. It also moves in the existing tautological bitwise comparisons into
this group. A few other changes were needed to the CFGBuilder so that all bool
contexts would be checked. The warnings in -Wtautological-bitwise-compare will
be off by default due to using the CFG.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=42666
Differential Revision: https://reviews.llvm.org/D66046

llvm-svn: 375318
2019-10-19 00:57:23 +00:00
Reid Kleckner 90c64a3456 Move endian constant from Host.h to SwapByteOrder.h, prune include
Works on this dependency chain:
  ArrayRef.h ->
  Hashing.h -> --CUT--
  Host.h ->
  StringMap.h / StringRef.h

ArrayRef is very popular, but Host.h is rarely needed. Move the
IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
more likely to need it.

llvm-svn: 375316
2019-10-19 00:48:11 +00:00
Peter Collingbourne 766f15814a Sema: Create a no-op implicit cast for lvalue function conversions.
This fixes an assertion failure in the case where an implicit conversion for a
function call involves an lvalue function conversion, and makes the AST for
initializations involving implicit lvalue function conversions more accurate.

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

llvm-svn: 375313
2019-10-19 00:34:54 +00:00
Michael Liao d7a487adfe [clang][driver] Print compilation phases with indentation.
Reviewers: tra, sfantao, echristo

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375310
2019-10-19 00:17:00 +00:00
Michael Liao 243ebfba17 [hip][cuda] Fix the extended lambda name mangling issue.
Summary:
- HIP/CUDA host side needs to use device kernel symbol name to match the
  device side binaries. Without a consistent naming between host- and
  device-side compilations, it's risky that wrong device binaries are
  executed. Consistent naming is usually not an issue until unnamed
  types are used, especially the lambda. In this patch, the consistent
  name mangling is addressed for the extended lambdas, i.e. the lambdas
  annotated with `__device__`.
- In [Itanium C++ ABI][1], the mangling of the lambda is generally
  unspecified unless, in certain cases, ODR rule is required to ensure
  consisent naming cross TUs. The extended lambda is such a case as its
  name may be part of a device kernel function, e.g., the extended
  lambda is used as a template argument and etc. Thus, we need to force
  ODR for extended lambdas as they are referenced in both device- and
  host-side TUs. Furthermore, if a extended lambda is nested in other
  (extended or not) lambdas, those lambdas are required to follow ODR
  naming as well. This patch revises the current lambda mangle numbering
  to force ODR from an extended lambda to all its parent lambdas.
- On the other side, the aforementioned ODR naming should not change
  those lambdas' original linkages, i.e., we cannot replace the original
  `internal` with `linkonce_odr`; otherwise, we may violate ODR in
  general. This patch introduces a new field `HasKnownInternalLinkage`
  in lambda data to decouple the current linkage calculation based on
  mangling number assigned.

[1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html

Reviewers: tra, rsmith, yaxunl, martong, shafik

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375309
2019-10-19 00:15:19 +00:00
Artem Dergachev b0914e7276 [analyzer] Specify the C++ standard in more tests.
Makes life easier for downstream developers with different default standard.

llvm-svn: 375308
2019-10-19 00:08:17 +00:00
Richard Smith 974c8b7e2f [c++20] Add rewriting from comparison operators to <=> / ==.
This adds support for rewriting <, >, <=, and >= to a normal or reversed
call to operator<=>, for rewriting != to a normal or reversed call to
operator==, and for rewriting <=> and == to reversed forms of those same
operators.

Note that this is a breaking change for various C++17 code patterns,
including some in use in LLVM. The most common patterns (where an
operator== becomes ambiguous with a reversed form of itself) are still
accepted under this patch, as an extension (with a warning). I'm hopeful
that we can get the language rules fixed before C++20 ships, and the
extension warning is aimed primarily at providing data to inform that
decision.

llvm-svn: 375306
2019-10-19 00:04:43 +00:00
Richard Smith 778dc0f1d4 [c++20] Add CXXRewrittenBinaryOperator to represent a comparison
operator that is rewritten as a call to multiple other operators.

No functionality change yet: nothing creates these expressions.

llvm-svn: 375305
2019-10-19 00:04:38 +00:00
David Blaikie 9fdd09a4cc DebugInfo: Render the canonical name of a class template specialization, even when nested in another class template specialization
Differential Revision: https://reviews.llvm.org/D63031

llvm-svn: 375304
2019-10-18 23:58:34 +00:00
Vedant Kumar 937241b0d9 [profile] Do not cache __llvm_profile_get_filename result
When the %m filename pattern is used, the filename is unique to each
image, so the cached value is wrong.

It struck me that the full filename isn't something that's recomputed
often, so perhaps it doesn't need to be cached at all. David Li pointed
out we can go further and just hide lprofCurFilename. This may regress
workflows that depend on using the set-filename API to change filenames
across all loaded DSOs, but this is expected to be very rare.

rdar://55137071

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

llvm-svn: 375301
2019-10-18 23:33:40 +00:00
Artem Dergachev 3ff26e27d9 [analyzer] exploded-graph-rewriter: Unforget to censor stmt_ids in the test.
They're not stable across machines.

Fixes buildbots after r375278.

llvm-svn: 375286
2019-10-18 20:48:21 +00:00
Artem Dergachev c6921379f5 [analyzer] exploded-graph-rewriter: Rename Environment to Expressions.
It's less confusing for newcomers.

llvm-svn: 375282
2019-10-18 20:15:41 +00:00
Artem Dergachev 2b4f6df917 [analyzer] Fix FieldRegion dumps.
The '->' thing has always been confusing; the actual operation '->'
translates to a pointer dereference together with adding a FieldRegion,
but FieldRegion on its own doesn't imply an additional pointer
dereference.

llvm-svn: 375281
2019-10-18 20:15:39 +00:00
Artem Dergachev b3e34e043c [analyzer] Drop the logic for collapsing the state if it's same as in preds.
One of the first attempts to reduce the size of the exploded graph dumps
was to skip the state dump as long as the state is the same as in all of
the predecessor nodes. With all the new facilities in place (node joining,
diff dumps), this feature doesn't do much, and when it does,
it's more harmful than useful. Let's remove it.

llvm-svn: 375280
2019-10-18 20:15:35 +00:00
Artem Dergachev d93b810cd6 [analyzer] exploded-graph-rewriter: Fix dump for state 0.
It shouldn't say "unspecified" when the state is specified to be empty.

llvm-svn: 375279
2019-10-18 20:15:32 +00:00
Artem Dergachev 7a17f19709 [analyzer] Fix hidden node traversal in exploded graph dumps.
The joined nodes now actually have the same state. That was intended
from the start but the original implementation turned out to be buggy.

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

llvm-svn: 375278
2019-10-18 20:15:29 +00:00
Brian Gesiak 7f704320b0 [Format] Add format check for throwing negative numbers
Summary:
The code `throw -1;` is currently formatted by clang-format as
`throw - 1;`. This diff adds a fix for this edge case and a test to check
for this in the future.

For context, I am looking into a related bug in the clang-formatting of
coroutine keywords: `co_yield -1;` is also reformatted in this manner
as `co_yield - 1;`. A later diff will add these changes and tests for the
`co_yield` and `co_return` keywords.

Patch by Jonathan Thomas (jonathoma)!

Reviewers: modocache, sammccall, Quuxplusone

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

llvm-svn: 375258
2019-10-18 16:59:02 +00:00
Alexey Bataev 80fe5cffd2 [DOCS]Update list of implemented constructs, NFC.
llvm-svn: 375257
2019-10-18 16:53:54 +00:00
Alexey Bataev b8552abfe7 [OPENMP50]Add support for master taskloop simd.
Added  trsing/semantics/codegen for combined construct master taskloop simd.

llvm-svn: 375255
2019-10-18 16:47:35 +00:00
Krasimir Georgiev eff2a2ab2b [clang-format] fix regression recognizing casts in Obj-C calls
Summary:
r373922 added checks for a few tokens that, following an `)` make it
unlikely that the `)` is the closing paren of a cast expression. The
specific check for `tok::l_square` there introduced a regression for
casts of Obj-C calls, like:
```
(cast)[func arg]
```
From the tests added in r373922, I believe the `tok::l_square` case is added to
capture the case where a non-cast `)` is directly followed by an
attribute specifier, like:
```
int f(int x) [[noreturn]];
```

I've specialized the code to look for such attribute specifier instead
of `tok::l_square` in general. Also, I added a regression test and moved
the test cases added in r373922 to an already existing place documenting
other instances of historically misidentified casts.

Reviewers: MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375247
2019-10-18 15:21:06 +00:00
Michael Liao 7e5d5ee873 [tooling] Relax an assert when multiple GPU targets are specified.
llvm-svn: 375245
2019-10-18 15:03:34 +00:00
Eugene Leviant bc887a8d4a [ThinLTOCodeGenerator] Add support for index-based WPD
This is clang part of the patch. It adds -flto-unit flag for thin LTO
builds on Mac and PS4

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

llvm-svn: 375224
2019-10-18 11:58:21 +00:00
Thomas Lively 807cecad5d [WebAssembly] -pthread implies -target-feature +sign-ext
Summary:
The sign extension proposal was motivated by a desire to not have
separate sign-extending atomic operations, so it is meant to be
enabled when threads are used.

Reviewers: aheejin, dschuff

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

Tags: #clang

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

llvm-svn: 375199
2019-10-18 04:34:26 +00:00
Artem Dergachev 8b3ef1e45b [analyzer] exploded-graph-rewriter: Fix typo in r375186. Unbreaks tests.
llvm-svn: 375189
2019-10-17 23:27:35 +00:00
Artem Dergachev 14e9eb3d7c [analyzer] Assign truly stable identifiers to exploded nodes.
ExplodedGraph nodes will now have a numeric identifier stored in them
which will keep track of the order in which the nodes were created
and it will be fully deterministic both accross runs and across machines.

This is extremely useful for debugging as it allows reliably setting
conditional breakpoints by node IDs.

llvm-svn: 375186
2019-10-17 23:10:09 +00:00
Artem Dergachev d325196f19 [analyzer] Display cast kinds in program point dumps.
Because cast expressions have their own hierarchy, it's extremely useful
to have some information about what kind of casts are we dealing with.

llvm-svn: 375185
2019-10-17 23:10:05 +00:00
Artem Dergachev 73b67f0b1a [analyzer] exploded-graph-rewriter: Make node headers a bit lighter.
The 50% grey color is too dark on some monitors.

llvm-svn: 375184
2019-10-17 23:10:02 +00:00
Eli Friedman 5b0e039a7a [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 3
It's completely impossible to check that I've actually found all the
issues, due to the use of macros in arm_neon.h, but hopefully this time
it'll take more than a few hours for someone to find another issue.

I have no idea why, but apparently there's a rule that some, but not
all, builtins which should take an fp16 vector actually take an int8
vector as an argument.  Fix this, and add test coverage.

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

llvm-svn: 375179
2019-10-17 21:57:28 +00:00
Sergey Dmitriev 6caada4eb4 [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test
Differential Revision: https://reviews.llvm.org/D69140

llvm-svn: 375177
2019-10-17 21:55:39 +00:00
Alexey Bataev 9c5d76ff4d [OPENMP]Dow not emit warnings for uninitialized loop counters.
In OpenMP constructs all counters are initialized and we should not emit
warnings about uninitialized privatized loop control variables.

llvm-svn: 375167
2019-10-17 20:35:08 +00:00
Alexey Bataev 780f555155 [OPENMP]Improve use of the global tid parameter.
If we can determined, that the global tid parameter can be used in the
function, better to use it rather than calling __kmpc_global_thread_num
function.

llvm-svn: 375134
2019-10-17 17:12:03 +00:00
James Y Knight ccc4d83cda [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object
pointer types.

For example, in Objective-C mode, the initialization of 'x' in:
```
  @implementation MyType
  + (void)someClassMethod {
    MyType *x = self;
  }
  @end
```
is correctly diagnosed with an incompatible-pointer-types warning, but
in Objective-C++ mode, it is not diagnosed at all -- even though
incompatible pointer conversions generally become an error in C++.

This patch fixes that oversight, allowing implicit conversions
involving Class only to/from unqualified-id, and between qualified and
unqualified Class, where the protocols are compatible.

Note that this does change some behaviors in Objective-C, as well, as
shown by the modified tests.

Of particular note is that assignment from from 'Class<MyProtocol>' to
'id<MyProtocol>' now warns. (Despite appearances, those are not
compatible types. 'Class<MyProtocol>' is not expected to have instance
methods defined by 'MyProtocol', while 'id<MyProtocol>' is.)

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

llvm-svn: 375125
2019-10-17 15:27:04 +00:00
James Y Knight 1c982af059 [ObjC] Add some additional test cases around pointer conversions.
This is especially important for Objective-C++, which is entirely
missing this testing at the moment.

This annotates with "FIXME" the cases which I change in the next
patch -- I primarily wanted to document the current state of things so
that the effect of the code change is made clear.

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

llvm-svn: 375124
2019-10-17 15:18:59 +00:00
Alexey Bataev 3e0f4f8e92 [OPENMP]Fix thread id passed to outlined region in sequential parallel
regions.

The real global thread id must be passed to the outlined region instead
of the zero thread id.

llvm-svn: 375119
2019-10-17 14:36:43 +00:00
Sven van Haastregt af6248cbb9 [OpenCL] Preserve addrspace in CGClass (PR43145)
PR43145 revealed two places where Clang was attempting to create a
bitcast without considering the address space of class types during
C++ class code generation.

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

llvm-svn: 375118
2019-10-17 14:12:51 +00:00
Sven van Haastregt 5e962e8d7d [OpenCL] Add doc to describe OpenCL support
The idea of this page is to document work in progress functionality
and also describe the plan of future development work.

Patch by Anastasia Stulova.

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

llvm-svn: 375111
2019-10-17 12:56:02 +00:00
Stephan Bergmann dc3957ec21 Include leading attributes in DeclStmt's SourceRange
Differential Revision: https://reviews.llvm.org/D68581

llvm-svn: 375104
2019-10-17 11:20:21 +00:00
Simon Pilgrim e14851259e SemaExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375101
2019-10-17 11:12:31 +00:00
Simon Pilgrim a867cca091 SemaDeclObjC - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375097
2019-10-17 10:35:29 +00:00
Oliver Stannard 3b598b9c86 Reland: Dead Virtual Function Elimination
Remove dead virtual functions from vtables with
replaceNonMetadataUsesWith, so that CGProfile metadata gets cleaned up
correctly.

Original commit message:

Currently, it is hard for the compiler to remove unused C++ virtual
functions, because they are all referenced from vtables, which are referenced
by constructors. This means that if the constructor is called from any live
code, then we keep every virtual function in the final link, even if there
are no call sites which can use it.

This patch allows unused virtual functions to be removed during LTO (and
regular compilation in limited circumstances) by using type metadata to match
virtual function call sites to the vtable slots they might load from. This
information can then be used in the global dead code elimination pass instead
of the references from vtables to virtual functions, to more accurately
determine which functions are reachable.

To make this transformation safe, I have changed clang's code-generation to
always load virtual function pointers using the llvm.type.checked.load
intrinsic, instead of regular load instructions. I originally tried writing
this using clang's existing code-generation, which uses the llvm.type.test
and llvm.assume intrinsics after doing a normal load. However, it is possible
for optimisations to obscure the relationship between the GEP, load and
llvm.type.test, causing GlobalDCE to fail to find virtual function call
sites.

The existing linkage and visibility types don't accurately describe the scope
in which a virtual call could be made which uses a given vtable. This is
wider than the visibility of the type itself, because a virtual function call
could be made using a more-visible base class. I've added a new
!vcall_visibility metadata type to represent this, described in
TypeMetadata.rst. The internalization pass and libLTO have been updated to
change this metadata when linking is performed.

This doesn't currently work with ThinLTO, because it needs to see every call
to llvm.type.checked.load in the linkage unit. It might be possible to
extend this optimisation to be able to use the ThinLTO summary, as was done
for devirtualization, but until then that combination is rejected in the
clang driver.

To test this, I've written a fuzzer which generates random C++ programs with
complex class inheritance graphs, and virtual functions called through object
and function pointers of different types. The programs are spread across
multiple translation units and DSOs to test the different visibility
restrictions.

I've also tried doing bootstrap builds of LLVM to test this. This isn't
ideal, because only classes in anonymous namespaces can be optimised with
-fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not
work correctly with -fvisibility=hidden. However, there are only 12 test
failures when building with -fvisibility=hidden (and an unmodified compiler),
and this change does not cause any new failures for either value of
-fvisibility.

On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size
reduction of ~6%, over a baseline compiled with "-O2 -flto
-fvisibility=hidden -fwhole-program-vtables". The best cases are reductions
of ~14% in 450.soplex and 483.xalancbmk, and there are no code size
increases.

I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which
show a geomean size reduction of ~3%, again with no size increases.

I had hoped that this would have no effect on performance, which would allow
it to awlays be enabled (when using -fwhole-program-vtables). However, the
changes in clang to use the llvm.type.checked.load intrinsic are causing ~1%
performance regression in the C++ parts of SPEC2006. It should be possible to
recover some of this perf loss by teaching optimisations about the
llvm.type.checked.load intrinsic, which would make it worth turning this on
by default (though it's still dependent on -fwhole-program-vtables).

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

llvm-svn: 375094
2019-10-17 09:58:57 +00:00
Kousik Kumar 9e7e36d4c2 Revert "Include sanitize blacklist and other extra deps as part of scan-deps output"
This test is failing on Windows bots, revert for now (will check the right fix and retry the patch).

Summary: This reverts commit 962ca076e5.

Reviewers: Bigcheese, jkorous, arphaman

Subscribers: dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 375079
2019-10-17 04:50:12 +00:00
Kousik Kumar 962ca076e5 Include sanitize blacklist and other extra deps as part of scan-deps output
Summary:
Clang's -M mode includes these extra dependencies in its output and clang-scan-deps
should have equivalent behavior, so adding these extradeps to output just like
how its being done for ".d" file generation mode.

Reviewers: arphaman, dexonsmith, Bigcheese, jkorous

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375074
2019-10-17 02:14:44 +00:00
Dmitry Mikulin 15984457a6 Revert Tag CFI-generated data structures with "#pragma clang section" attributes.
This reverts r375022 (git commit e2692b3bc0)

llvm-svn: 375069
2019-10-17 00:55:38 +00:00
Saar Raz f567b00880 [Concepts] ConceptSpecializationExprs mangling
Implement mangling for CSEs to match regular template-ids.
Reviewed as part of D41569 <https://reviews.llvm.org/D41569>.

Re-commit fixing failing test.

llvm-svn: 375063
2019-10-17 00:16:01 +00:00
Volodymyr Sapsai 930ada91ce Replace platform-dependent `stat` with `llvm::sys::fs::status`. NFC intended.
Reviewers: bruno, sammccall

Reviewed By: sammccall

Subscribers: jkorous, dexonsmith, arphaman, ributzka, cfe-commits

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

llvm-svn: 375031
2019-10-16 19:12:34 +00:00
Steven Wu 87cf73e956 Fix darwin-ld-lto test for some speical path
Fix the test by not assuming the prefix path of the temp directory can
be matched by a regex.

rdar://problem/56259195

llvm-svn: 375027
2019-10-16 18:12:41 +00:00
Alexey Bataev 31ba47646b [OPENMP]Allow priority clause in combined task-based directives.
The expression of the priority clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.

llvm-svn: 375026
2019-10-16 18:09:37 +00:00
Dmitry Mikulin e2692b3bc0 Tag CFI-generated data structures with "#pragma clang section" attributes.
Differential Revision: https://reviews.llvm.org/D68808

llvm-svn: 375022
2019-10-16 17:51:40 +00:00
Alexey Bataev f89cf21337 [OPENMP]Use different addresses for zeroed thread_id/bound_id.
When the parallel region is called directly in the sequential region,
the zeroed tid/bound id are used. But they must point to the different
memory locations as the parameters are marked as noalias.

llvm-svn: 375017
2019-10-16 16:59:01 +00:00
Adrian Prantl a9cfde1f6a [DWARF5] Added support for DW_AT_noreturn attribute to be emitted for
C++ class member functions.

Patch by Sourabh Singh Tomar!

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

llvm-svn: 375012
2019-10-16 16:30:38 +00:00
Yitzhak Mandelbaum c14f1ea25e [libTooling] Fix r374962: add more Transformer forwarding decls.
Summary:
The move to a new, single namespace in r374962 left out some type definitions
from the old namespace and resulted in one naming conflict (`text`).  This
revision adds aliases for those definitions and removes one of the `text`
functions from the new namespace.

Reviewers: alexfh

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375003
2019-10-16 14:26:20 +00:00
Simon Tatham fdccf28697 [Driver,ARM] Make -mfloat-abi=soft turn off MVE.
Since `-mfloat-abi=soft` is taken to mean turning off all uses of the
FP registers, it should turn off the MVE vector instructions as well
as NEON and scalar FP. But it wasn't doing so.

So the options `-march=armv8.1-m.main+mve.fp+fp.dp -mfloat-abi=soft`
would cause the underlying LLVM to //not// support MVE (because it
knows the real target feature relationships and turned off MVE when
the `fpregs` feature was removed), but the clang layer still thought
it //was// supported, and would misleadingly define the feature macro
`__ARM_FEATURE_MVE`.

The ARM driver code already has a long list of feature names to turn
off when `-mfloat-abi=soft` is selected. The fix is to add the missing
entries `mve` and `mve.fp` to that list.

Reviewers: dmgreen

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 375001
2019-10-16 13:23:39 +00:00
Simon Pilgrim b150494fc7 RewriteModernObjC - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 374991
2019-10-16 10:50:06 +00:00
Simon Pilgrim cfee2efc57 CGDebugInfo - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use cast<> directly and if not assert will fire for us.

llvm-svn: 374989
2019-10-16 10:38:49 +00:00
Simon Pilgrim cebfddc0b5 CGExprConstant - silence static analyzer getAs<> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 374988
2019-10-16 10:38:40 +00:00
Simon Pilgrim 729a2f6c2b CGBuiltin - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 374987
2019-10-16 10:38:32 +00:00
Nico Weber b13d257028 Revert 374967 "[Concepts] ConceptSpecializationExprs mangling"
This reverts commit 5e34ad109c.

The mangling test fails on Windows:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15944

It also fails on ppc64le:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/21092

Also revert follow-up  374971 "Fix failing mangle-concept.cpp test."
(it did not help on Win/ppc64le).

llvm-svn: 374985
2019-10-16 10:23:53 +00:00
Saar Raz 1e3e77e0b6 Fix failing mangle-concept.cpp test.
llvm-svn: 374971
2019-10-16 02:56:40 +00:00
Saar Raz 5e34ad109c [Concepts] ConceptSpecializationExprs mangling
Implement mangling for CSEs to match regular template-ids.
Reviewed as part of D41569.

llvm-svn: 374967
2019-10-16 02:33:41 +00:00
Yitzhak Mandelbaum 8bb47cd8c3 [libTooling] Put all Transformer declarations in a single namespace.
Summary:
This revision introduces a new namespace, `clang::transformer`, to hold
the declarations for the Transformer library.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 374962
2019-10-16 01:06:46 +00:00
Richard Smith 61dadfc894 PR43674: fix incorrect constant evaluation of 'switch' where no case
label corresponds to the condition.

llvm-svn: 374954
2019-10-15 22:23:11 +00:00
Richard Smith 666f977166 Remove unnecessary and inappropriate forward-declaration of Sema from
AST.

llvm-svn: 374952
2019-10-15 21:50:24 +00:00
Alexey Bataev d498d606b9 [OPENMP]Fix comments/params, NFC.
llvm-svn: 374943
2019-10-15 19:51:30 +00:00
Alexey Bataev 3a842ec3ca [OPENMP]Allow final clause in combined task-based directives.
The condition of the final clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.

llvm-svn: 374942
2019-10-15 19:37:05 +00:00