]> granicus.if.org Git - clang/log
clang
5 years ago[OpenCL] Fix invalid address space generation for clk_event_t
Alexey Sotkin [Wed, 14 Nov 2018 09:40:05 +0000 (09:40 +0000)]
[OpenCL] Fix invalid address space generation for clk_event_t

Summary:
Addrspace(32) was generated when putting 0 in clk_event_t * event_ret
parameter for enqueue_kernel function.

Patch by Viktoria Maksimova

Reviewers: Anastasia, yaxunl, AlexeySotkin

Reviewed By:  Anastasia, AlexeySotkin

Subscribers: cfe-commits

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

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

5 years ago[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.
George Rimar [Wed, 14 Nov 2018 09:22:16 +0000 (09:22 +0000)]
[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.

The DWARF5 specification says(Appendix F.1):

"The sections that do not require relocation, however, can be
written to the relocatable object (.o) file but ignored by the
linker or they can be written to a separate DWARF object (.dwo)
file that need not be accessed by the linker."

The first part describes a single file split DWARF feature and there
is no way to trigger this behavior atm.
Fortunately, no many changes are required to keep *.dwo sections
in a .o, the patch does that.

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

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

5 years ago[HIP] Fix device only compilation
Yaxun Liu [Wed, 14 Nov 2018 04:47:31 +0000 (04:47 +0000)]
[HIP] Fix device only compilation

Fix a bug causing host code being compiled when --cude-device-only is set.

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

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

5 years ago[CMake] Include clang-apply-replacements in Fuchsia toolchain
Petr Hosek [Wed, 14 Nov 2018 04:06:47 +0000 (04:06 +0000)]
[CMake] Include clang-apply-replacements in Fuchsia toolchain

This is needed for run-clang-tidy.py.

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

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

5 years ago[HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory
Alex Lorenz [Wed, 14 Nov 2018 01:08:03 +0000 (01:08 +0000)]
[HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory

Include search paths can be relative paths. The loadSubdirectoryModuleMaps function
should account for that and respect the -working-directory parameter given to Clang.

rdar://46045849

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

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

5 years agoComplete reverting r346191
Tatyana Krasnukha [Wed, 14 Nov 2018 00:08:34 +0000 (00:08 +0000)]
Complete reverting r346191

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

5 years agoComplete reverting r346191
Tatyana Krasnukha [Tue, 13 Nov 2018 23:59:25 +0000 (23:59 +0000)]
Complete reverting r346191

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

5 years agoOpenCL: Don't warn on v printf modifier
Matt Arsenault [Tue, 13 Nov 2018 22:30:35 +0000 (22:30 +0000)]
OpenCL: Don't warn on v printf modifier

This avoids spurious warnings, but could use
a lot of work. For example the number of vector
elements is not verified, and the passed
value type is not checked.

Fixes bug 39486

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

5 years ago[Driver] Support g++ headers in include/g++
David Greene [Tue, 13 Nov 2018 21:38:45 +0000 (21:38 +0000)]
[Driver] Support g++ headers in include/g++

ray's gcc installation puts C++ headers in PREFIX/include/g++ without
indicating a gcc version at all. Typically this is because the version
is encoded somewhere in PREFIX.

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

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

5 years ago[AST] Revert r346793 and r346781
Bruno Ricci [Tue, 13 Nov 2018 21:33:22 +0000 (21:33 +0000)]
[AST] Revert r346793 and r346781

This somehow breaks the msan bots. Revert while I figure it out.

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

5 years ago[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td
Bruno Ricci [Tue, 13 Nov 2018 20:23:11 +0000 (20:23 +0000)]
[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td

Reorder the bit-field classes and the members of the anonymous union
so that they both match the order in StmtNodes.td.

There is already a fair amount of them, and this is not going to
improve. Therefore lets try to keep some order here.

Strictly NFC.

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

5 years agoDebugInfo: Add a driver flag for DWARF debug_ranges base address specifier use.
David Blaikie [Tue, 13 Nov 2018 20:08:13 +0000 (20:08 +0000)]
DebugInfo: Add a driver flag for DWARF debug_ranges base address specifier use.

Summary:
This saves a lot of relocations in optimized object files (at the cost
of some cost/increase in linked executable bytes), but gold's 32 bit
gdb-index support has a bug (
https://sourceware.org/bugzilla/show_bug.cgi?id=21894 ) so we can't
switch to this unconditionally. (& even if it weren't for that bug, one
might argue that some users would want to optimize in one direction or
the other - prioritizing object size or linked executable size)

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

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

5 years ago[AST][NFC] Style fixes for UnaryOperator
Bruno Ricci [Tue, 13 Nov 2018 19:27:39 +0000 (19:27 +0000)]
[AST][NFC] Style fixes for UnaryOperator

In preparation for the patch which will move some data to the bit-fields
of Stmt. In particular, rename the private variable "Val" -> "Operand"
since the substatement is the operand of the unary operator.
Run clang-format on UnaryOperator. NFC otherwise.

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

5 years ago[AST][NFC] Pack DeclRefExpr
Bruno Ricci [Tue, 13 Nov 2018 17:56:44 +0000 (17:56 +0000)]
[AST][NFC] Pack DeclRefExpr

Move the SourceLocation to the bit-fields of Stmt + clang-format.
This saves one pointer per DeclRefExpr but otherwise NFC.

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

5 years ago[NFC] Move storage of dispatch-version to GlobalDecl
Erich Keane [Tue, 13 Nov 2018 15:48:08 +0000 (15:48 +0000)]
[NFC] Move storage of dispatch-version to GlobalDecl

As suggested by Richard Smith, and initially put up for review here:
https://reviews.llvm.org/D53341, this patch removes a hack that was used
to ensure that proper target-feature lists were used when emitting
cpu-dispatch (and eventually, target-clones) implementations. As a part
of this, the GlobalDecl object is proliferated to a bunch more
locations.

Originally, this was put up for review (see above) to get acceptance on
the approach, though discussion with Richard in San Diego showed he
approved of the approach taken here.  Thus, I believe this is acceptable
for Review-After-commit

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

Change-Id: I0a0bd673340d334d93feac789d653e03d9f6b1d5

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

5 years ago[clang-format] Do not treat the asm clobber [ as ObjCExpr
Krasimir Georgiev [Tue, 13 Nov 2018 15:38:12 +0000 (15:38 +0000)]
[clang-format] Do not treat the asm clobber [ as ObjCExpr

Summary:
The opening square of an inline asm clobber was being annotated as an ObjCExpr.
This caused, amongst other things, the ObjCGuesser to guess header files
containing that pattern as ObjC files.

Reviewers: benhamilton

Reviewed By: benhamilton

Subscribers: cfe-commits

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

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

5 years agoUserManual: Tweak the /Zc:dllexportInlines- docs some
Hans Wennborg [Tue, 13 Nov 2018 09:05:12 +0000 (09:05 +0000)]
UserManual: Tweak the /Zc:dllexportInlines- docs some

Addressing comments on https://reviews.llvm.org/D54319

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

5 years ago[clang-cl] Do not allow using both /Zc:dllexportInlines- and /fallback flag
Takuto Ikuta [Tue, 13 Nov 2018 04:14:09 +0000 (04:14 +0000)]
[clang-cl] Do not allow using both /Zc:dllexportInlines- and /fallback flag

Summary: /Zc:dllexportInlines with /fallback may cause unexpected linker error. It is better to disallow compile rather than warn for this combination.

Reviewers: hans, thakis

Reviewed By: hans

Subscribers: cfe-commits, llvm-commits

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

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

5 years agoCMake: Deprecate using llvm-config to detect llvm installation
Tom Stellard [Tue, 13 Nov 2018 03:42:46 +0000 (03:42 +0000)]
CMake: Deprecate using llvm-config to detect llvm installation

Summary:
clang currently uses llvm-config to determine the installation paths
for llvm's headers and binaries.  clang is also using LLVM's cmake
files to determine other information about the LLVM build, like
LLVM_LIBDIR_SUFFIX, LLVM_VERSION_*, etc.  Since the installation
paths are also available via the cmake files, we can simplify the code
by only relying on information from cmake about the LLVM install and
dropping the use of llvm-config altogether.

In addition to simplifying the code, the cmake files have more
accurate information about the llvm installation paths.  llvm-config
assumes that the lib, bin, and cmake directories are always located
in the same place relative to the path of the llvm-config executable.
This can be wrong if a user decides to install headers, binaries
or libraries to a non-standard location: e.g. static libraries
installed to /usr/lib/llvm6.0/

This patch takes the first step towards dropping llvm-config by
removing the automatic detection of llvm-config (users can still
manually supply a path to llvm-config by passing
-DLLVM_CONFIG=/usr/bin/llvm-config to cmake) and adding a
deprecation warning when users try to use this option.

Reviewers: chandlerc, beanz, mgorny, chapuni

Subscribers: mehdi_amini, dexonsmith, cfe-commits

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

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

5 years agoCMake: Replace open-coded find_package
Tom Stellard [Tue, 13 Nov 2018 03:16:45 +0000 (03:16 +0000)]
CMake: Replace open-coded find_package

Reviewers: beanz, mgorny

Reviewed By: mgorny

Subscribers: cfe-commits, chapuni, llvm-commits

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

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

5 years agoConvert a condition into an assertion per post-review feedback; NFC intended.
Aaron Ballman [Mon, 12 Nov 2018 22:32:38 +0000 (22:32 +0000)]
Convert a condition into an assertion per post-review feedback; NFC intended.

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

5 years ago[Sema] Make sure we substitute an instantiation-dependent default template argument
Erik Pilkington [Mon, 12 Nov 2018 21:31:06 +0000 (21:31 +0000)]
[Sema] Make sure we substitute an instantiation-dependent default template argument

Fixes llvm.org/PR39623

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

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

5 years agoFix the 'fixit' for inline namespace replacement.
Erich Keane [Mon, 12 Nov 2018 21:08:41 +0000 (21:08 +0000)]
Fix the 'fixit' for inline namespace replacement.

I'd neglected to add to the fixit for r346677.  Richard Smith mentioned
this in a review-after-commit, so fixing it here.

Change-Id: I77e612be978d4eedda8d5bbd60b812b88f875cda

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

5 years agoPR39628 Treat all non-zero values as 'true' in bool compound-assignment
Richard Smith [Mon, 12 Nov 2018 20:11:57 +0000 (20:11 +0000)]
PR39628 Treat all non-zero values as 'true' in bool compound-assignment
in constant evaluation, not just odd values.

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

5 years ago[NFC] Fix formatting in inline nested namespace definition.
Erich Keane [Mon, 12 Nov 2018 19:29:26 +0000 (19:29 +0000)]
[NFC] Fix formatting in inline nested namespace definition.

Apparently my invocation of clang-format in VIM didn't get this right,
but the patch-version DID. This patch just runs CF on this file.

Change-Id: Ied462a2d921cbb813fa427740d3ef6e97959b56d

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

5 years ago[clang-format] Support breaking consecutive string literals for TableGen
Jordan Rupprecht [Mon, 12 Nov 2018 18:15:04 +0000 (18:15 +0000)]
[clang-format] Support breaking consecutive string literals for TableGen

Summary:
clang-format can get confused by string literals in TableGen: it knows that strings can be broken up, but doesn't seem to understand how that can be indented across line breaks, and arranges them in a weird triangular pattern. Take this output example from `clang-format tools/llvm-objcopy/ObjcopyOpts.td` (which has now been formatted in rL345896 with this patch applied):

```
defm keep_global_symbols
: Eq<
      "keep-global-symbols", "Reads a list of symbols from <filename> and "
                             "runs as if " "--keep-global-symbol=<symbol> "
                                           "is set for each one. "
                                           "<filename> " "contains one "
                                                         "symbol per line "
                                                         "and may contain "
                                                         "comments "
                                                         "beginning " "with"
                                                                      " '#'"
                                                                      ". "
                                                                      "Lead"
                                                                      "ing "
```

Reviewers: alexshap, MaskRay, djasper

Reviewed By: MaskRay

Subscribers: krasimir, mgorny, cfe-commits

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

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

5 years ago[analyzer] Drastically simplify the tblgen files used for checkers
Kristof Umann [Mon, 12 Nov 2018 17:49:51 +0000 (17:49 +0000)]
[analyzer] Drastically simplify the tblgen files used for checkers

Interestingly, only about the quarter of the emitter file is used, the DescFile
entry hasn't ever been touched [1], and the entire concept of groups is a
mystery, so I removed them.

[1] http://lists.llvm.org/pipermail/cfe-dev/2018-October/059664.html

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

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

5 years agoImplement P1094R2 (nested inline namespaces)
Erich Keane [Mon, 12 Nov 2018 17:19:48 +0000 (17:19 +0000)]
Implement P1094R2 (nested inline namespaces)

As approved for the Working Paper in San Diego, support annotating
inline namespaces with 'inline'.

Change-Id: I51a654e11ffb475bf27cccb2458768151619e384

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

5 years agoRevert "Make clang-based tools find libc++ on MacOS"
Jonas Devlieghere [Mon, 12 Nov 2018 16:59:50 +0000 (16:59 +0000)]
Revert "Make clang-based tools find libc++ on MacOS"

This breaks the LLDB bots.

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

5 years agoRevert rL346644, rL346642: the added test test/CodeGen/code-coverage-filter.c is...
Calixte Denizet [Mon, 12 Nov 2018 14:57:17 +0000 (14:57 +0000)]
Revert rL346644, rL346642: the added test test/CodeGen/code-coverage-filter.c is failing under windows

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

5 years agoMake clang-based tools find libc++ on MacOS
Ilya Biryukov [Mon, 12 Nov 2018 13:55:55 +0000 (13:55 +0000)]
Make clang-based tools find libc++ on MacOS

Summary:
When they read compiler args from compile_commands.json.
This change allows to run clang-based tools, like clang-tidy or clangd,
built from head using the compile_commands.json file produced for XCode
toolchains.

On MacOS clang can find the C++ standard library relative to the
compiler installation dir.

The logic to do this was based on resource dir as an approximation of
where the compiler is installed. This broke the tools that read
'compile_commands.json' and don't ship with the compiler, as they
typically change resource dir.

To workaround this, we now use compiler install dir detected by the driver
to better mimic the behavior of the original compiler when replaying the
compilations using other tools.

Reviewers: sammccall, arphaman, EricWF

Reviewed By: sammccall

Subscribers: ioeric, christof, kadircet, cfe-commits

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

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

5 years ago[GCOV] fix test after patch rL346642
Calixte Denizet [Mon, 12 Nov 2018 09:52:14 +0000 (09:52 +0000)]
[GCOV] fix test after patch rL346642

Summary:
Test is failing under windows, so fix it.
Should fix:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/1390/steps/stage%201%20check/logs/stdio

Reviewers: marco-c

Reviewed By: marco-c

Subscribers: cfe-commits, sylvestre.ledru, marco-c

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

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

5 years ago[Clang] Add options -fprofile-filter-files and -fprofile-exclude-files to filter...
Calixte Denizet [Mon, 12 Nov 2018 09:12:27 +0000 (09:12 +0000)]
[Clang] Add options -fprofile-filter-files and -fprofile-exclude-files to filter the files to instrument with gcov

Summary:
These options are taking regex separated by colons to filter files.
- if both are empty then all files are instrumented
- if -fprofile-filter-files is empty then all the filenames matching any of the regex from exclude are not instrumented
- if -fprofile-exclude-files is empty then all the filenames matching any of the regex from filter are instrumented
- if both aren't empty then all the filenames which match any of the regex in filter and which don't match all the regex in filter are instrumented
- this patch is a follow-up of https://reviews.llvm.org/D52033

Reviewers: marco-c, vsk

Reviewed By: marco-c, vsk

Subscribers: cfe-commits, sylvestre.ledru

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

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

5 years agoRelease notes: Mention clang-cl's /Zc:dllexportInlines- flag
Hans Wennborg [Mon, 12 Nov 2018 08:42:21 +0000 (08:42 +0000)]
Release notes: Mention clang-cl's /Zc:dllexportInlines- flag

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

5 years agoclang-cl: Add documentation for /Zc:dllexportInlines-
Hans Wennborg [Mon, 12 Nov 2018 08:38:10 +0000 (08:38 +0000)]
clang-cl: Add documentation for /Zc:dllexportInlines-

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

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

5 years agoFix compatibility with z3-4.8.1
Jan Kratochvil [Mon, 12 Nov 2018 06:48:02 +0000 (06:48 +0000)]
Fix compatibility with z3-4.8.1

With z3-4.8.1:
../tools/clang/lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp:49:40: error:
'Z3_get_error_msg_ex' was not declared in this scope
../tools/clang/lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp:49:40: note:
suggested alternative: 'Z3_get_error_msg'

Formerly used Z3_get_error_msg_ex() as one could find in z3-4.7.1 states:
"Retained function name for backwards compatibility within v4.1"
And it is implemented only as a forwarding call:
return Z3_get_error_msg(c, err);

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

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

6 years agoSupport Swift in platform availability attribute
Michael Wu [Mon, 12 Nov 2018 02:44:33 +0000 (02:44 +0000)]
Support Swift in platform availability attribute

Summary: This adds support for Swift platform availability attributes. It's largely a port of the changes made to https://github.com/apple/swift-clang/ for Swift availability attributes. Specifically, https://github.com/apple/swift-clang/commit/84b5a21c31cb5b0d7d958a478bc01964939b6952 and https://github.com/apple/swift-clang/commit/e5b87f265aede41c8381094bbf54e2715c8293b0 . The implementation of attribute_availability_swift is a little different and additional tests in test/Index/availability.c were added.

Reviewers: manmanren, friss, doug.gregor, arphaman, jfb, erik.pilkington, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, ColinKinloch, jrmuizel, cfe-commits

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

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

6 years ago[CodeGen][CXX]: Fix no_destroy CG bug under specific circumstances
Kristina Brooks [Mon, 12 Nov 2018 01:19:16 +0000 (01:19 +0000)]
[CodeGen][CXX]: Fix no_destroy CG bug under specific circumstances

Summary:

Class with no user-defined destructor that has an inherited member that has a
non-trivial destructor and a non-default constructor will attempt to emit a
destructor despite being marked as __attribute((no_destroy)) in which case it
would trigger an assertion due to an incorrect assumption.

In addition this adds missing test coverage for IR generation for no_destroy.

(Note that here use of no_destroy is synonymous with its global flag
counterpart `-fno-c++-static-destructors` being enabled)

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

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

6 years agoPass the function type instead of the return type to FunctionDecl::Create
Jonas Devlieghere [Sun, 11 Nov 2018 00:56:15 +0000 (00:56 +0000)]
Pass the function type instead of the return type to FunctionDecl::Create

Fix places where the return type of a FunctionDecl was being used in
place of the function type

FunctionDecl::Create() takes as its T parameter the type of function
that should be created, not the return type. Passing in the return type
looks to have been copypasta'd around a bit, but the number of correct
usages outweighs the incorrect ones so I've opted for keeping what T is
the same and fixing up the call sites instead.

This fixes a crash in Clang when attempting to compile the following
snippet of code with -fblocks -fsanitize=function -x objective-c++ (my
original repro case):

  void g(void(^)());
  void f()
  {
      __block int a = 0;
        g(^(){ a++; });
  }

as well as the following which only requires -fsanitize=function -x c++:

  void f(char * buf)
  {
      __builtin_os_log_format(buf, "");
  }

Patch by: Ben (bobsayshilol)

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

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

6 years ago[cxx_status] Update for San Diego motions.
Richard Smith [Sat, 10 Nov 2018 18:02:40 +0000 (18:02 +0000)]
[cxx_status] Update for San Diego motions.

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

6 years ago[python] Support PathLike filenames and directories
Michal Gorny [Sat, 10 Nov 2018 11:41:36 +0000 (11:41 +0000)]
[python] Support PathLike filenames and directories

Python 3.6 introduced a file system path protocol (PEP 519[1]).
The standard library APIs accepting file system paths now accept path
objects too. It could be useful to add this here as well
for convenience.

[1] https://www.python.org/dev/peps/pep-0519

Authored by: jstasiak (Jakub Stasiak)

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

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

6 years ago[clang]: Fix misapplied patch in 346582.
Kristina Brooks [Sat, 10 Nov 2018 08:04:38 +0000 (08:04 +0000)]
[clang]: Fix misapplied patch in 346582.

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

6 years agoCorrect naming conventions and 80 col rule violation in CGDeclCXX.cpp. NFC.
Kristina Brooks [Sat, 10 Nov 2018 07:53:47 +0000 (07:53 +0000)]
Correct naming conventions and 80 col rule violation in CGDeclCXX.cpp. NFC.

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

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

6 years agoFix ClangFormat issue of recognizing ObjC subscript as C++ attributes when message...
Yan Zhang [Fri, 9 Nov 2018 23:19:14 +0000 (23:19 +0000)]
Fix ClangFormat issue of recognizing ObjC subscript as C++ attributes when message target is a result of a C-style method.

Summary:
The issue is that for array subscript like:

```
arr[[Foo() bar]];
```
ClangFormat will recognize it as C++11 attribute syntax and put a space between 'arr' and first '[', like:

```
arr [[Foo() bar]];
```

Now it is fixed. Tested with:
```
ninja FormatTests
```

Reviewers: benhamilton

Reviewed By: benhamilton

Subscribers: cfe-commits

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

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

6 years agoRevert "Revert rL346454: Fix a use-after-free introduced by r344915."
Adrian Prantl [Fri, 9 Nov 2018 21:17:38 +0000 (21:17 +0000)]
Revert "Revert rL346454: Fix a use-after-free introduced by r344915."

This un-reverts commit 346454 with a relaxed CHECK for Windows.

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

6 years ago[ASTMatchers] overload ignoringParens for Expr
Jonas Toth [Fri, 9 Nov 2018 20:54:06 +0000 (20:54 +0000)]
[ASTMatchers] overload ignoringParens for Expr

Summary: This patch allows fixing PR39583.

Reviewers: aaron.ballman, sbenza, klimek

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

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

6 years ago[OPENMP][NVPTX]Extend number of constructs executed in SPMD mode.
Alexey Bataev [Fri, 9 Nov 2018 20:03:19 +0000 (20:03 +0000)]
[OPENMP][NVPTX]Extend number of constructs executed in SPMD mode.

If the statements between target|teams|distribute directives does not
require execution in master thread, like constant expressions, null
statements, simple declarations, etc., such construct can be xecuted in
SPMD mode.

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

6 years agoRevert rL346454: Fix a use-after-free introduced by r344915.
Simon Pilgrim [Fri, 9 Nov 2018 19:42:53 +0000 (19:42 +0000)]
Revert rL346454: Fix a use-after-free introduced by r344915.

r344915 added a call to ApplyDebugLocation to the sanitizer check
function emitter. Some of the sanitizers are emitted in the function
epilogue though and the LexicalScopeStack is emptied out before. By
detecting this situation and early-exiting from ApplyDebugLocation the
fallback location is used, which is equivalent to the return location.

rdar://problem/45859802
........
Causes EXPENSIVE_CHECKS build bot failures: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win

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

6 years agoUse the correct address space when bitcasting func pointer to int pointer
Dylan McKay [Fri, 9 Nov 2018 19:42:05 +0000 (19:42 +0000)]
Use the correct address space when bitcasting func pointer to int pointer

When we cast a function pointer to an int pointer, at some pointer later
it gets bitcasted back to a function and called.

In backends that have a nonzero program memory address space specified
in the data layout, the old code would lose the address space data. When
LLVM later attempted to generate the bitcast from i8* to i8(..)*
addrspace(1), it would fail because the pointers are not in the same
address space.

With this patch, the address space of the function will carry on to the
address space of the i8* pointer. This is because all function pointers
in Harvard architectures need to be assigned to the correct address
space.

This has no effect to any in-tree backends except AVR.

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

6 years agoAllow a double-underscore spelling of Clang attributes using double square bracket...
Aaron Ballman [Fri, 9 Nov 2018 19:37:18 +0000 (19:37 +0000)]
Allow a double-underscore spelling of Clang attributes using double square bracket syntax.

This matches a similar behavior with GCC accepting [[gnu::__attr__]] as a alias for [[gnu::attr]] in that clang attributes can now be spelled with two leading and trailing underscores.

I had always intended for this to work, but missed the critical bit. We already had an existing test in test/Preprocessor/has_attribute.cpp for [[clang::__fallthrough__]] but using that spelling would still give an "unknown attribute" diagnostic.

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

6 years agoFix a nondeterminism in the debug info for VLA size expressions.
Adrian Prantl [Fri, 9 Nov 2018 19:17:56 +0000 (19:17 +0000)]
Fix a nondeterminism in the debug info for VLA size expressions.

The artificial variable describing the array size is supposed to be
called "__vla_expr", but this was implemented by retrieving the name
of the associated alloca, which isn't a reliable source for the name,
since nonassert compilers may drop names from LLVM IR.

rdar://problem/45924808

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

6 years ago[HIP] Remove useless sections in linked files
Yaxun Liu [Fri, 9 Nov 2018 18:52:05 +0000 (18:52 +0000)]
[HIP] Remove useless sections in linked files

clang-offload-bundler creates __CLANG_OFFLOAD_BUNDLE__* sections in the bundles,
which get into the linked files. These sections are useless after linking. They waste disk
space and cause confusion for clang when directly linked with other object files, therefore
should be removed.

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

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

6 years agoDriver: Make -fsanitize=shadow-call-stack compatible with -fsanitize-minimal-runtime.
Peter Collingbourne [Fri, 9 Nov 2018 17:54:49 +0000 (17:54 +0000)]
Driver: Make -fsanitize=shadow-call-stack compatible with -fsanitize-minimal-runtime.

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

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

6 years agoIntroduce the _Clang scoped attribute token.
Aaron Ballman [Fri, 9 Nov 2018 17:19:45 +0000 (17:19 +0000)]
Introduce the _Clang scoped attribute token.

Currently, we only accept clang as the scoped attribute identifier for double square bracket attributes provided by Clang, but this has the potential to conflict with user-defined macros. To help alleviate these concerns, this introduces the _Clang scoped attribute identifier as an alias for clang. It also introduces a warning with a fixit on the off chance someone attempts to use __clang__ as the scoped attribute (which is a predefined compiler identification macro).

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

6 years agoUse the correct address space when emitting the ctor function list
Dylan McKay [Fri, 9 Nov 2018 17:15:06 +0000 (17:15 +0000)]
Use the correct address space when emitting the ctor function list

This patch modifies clang so that, if compiling for a target that
explicitly specifies a nonzero program memory address space, the
constructor list global will have the same address space as the
functions it contains.

AVR is the only in-tree backend which has a nonzero program memory
address space.

Without this, the IR verifier would always fail if a constructor
was used on a Harvard architecture backend.

This has no functional change to any in-tree backends except AVR.

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

6 years ago[OPENMP][NVPTX]Allow to use shared memory for the
Alexey Bataev [Fri, 9 Nov 2018 16:18:04 +0000 (16:18 +0000)]
[OPENMP][NVPTX]Allow to use shared memory for the
target|teams|distribute variables.

If the total size of the variables, declared in target|teams|distribute
regions, is less than the maximal size of shared memory available, the
buffer is allocated in the shared memory.

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

6 years ago[clang-cl] Add warning for /Zc:dllexportInlines- when the flag is used with /fallback
Takuto Ikuta [Fri, 9 Nov 2018 13:25:45 +0000 (13:25 +0000)]
[clang-cl] Add warning for /Zc:dllexportInlines- when the flag is used with /fallback

Summary:
This is followup of
https://reviews.llvm.org/D51340

Reviewers: hans, thakis

Reviewed By: hans

Subscribers: cfe-commits, llvm-commits

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

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

6 years ago[Tooling] Avoid diagnosing missing input files in an edge-case where it's incorrect.
Sam McCall [Fri, 9 Nov 2018 11:49:22 +0000 (11:49 +0000)]
[Tooling] Avoid diagnosing missing input files in an edge-case where it's incorrect.

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

6 years ago[PowerPC] [Clang] [AltiVec] The second parameter of vec_sr function should be modulo...
Zi Xuan Wu [Fri, 9 Nov 2018 03:35:32 +0000 (03:35 +0000)]
[PowerPC] [Clang] [AltiVec] The second parameter of vec_sr function should be modulo the number of bits in the element

The second parameter of vec_sr function is representing shift bits and it should be modulo the number of bits in the element like what vec_sl does now.
This is actually required by the ABI:

Each element of the result vector is the result of logically right shifting the corresponding
element of ARG1 by the number of bits specified by the value of the corresponding
element of ARG2, modulo the number of bits in the element. The bits that are shifted out
are replaced by zeros.

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

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

6 years agoFix test from r346439 to also work on Windows due to path separator differences.
Douglas Yung [Fri, 9 Nov 2018 02:44:07 +0000 (02:44 +0000)]
Fix test from r346439 to also work on Windows due to path separator differences.

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

6 years agoUse correct parameter name in comment.
Bill Wendling [Fri, 9 Nov 2018 01:04:05 +0000 (01:04 +0000)]
Use correct parameter name in comment.

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

6 years agoCompound literals, enums, et al require const expr
Bill Wendling [Fri, 9 Nov 2018 00:41:36 +0000 (00:41 +0000)]
Compound literals, enums, et al require const expr

Summary:
Compound literals,  enums, file-scoped arrays, etc. require their
initializers and size specifiers to be constant. Wrap the initializer
expressions in a ConstantExpr so that we can easily check for this later
on.

Reviewers: rsmith, shafik

Reviewed By: rsmith

Subscribers: cfe-commits, jyknight, nickdesaulniers

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

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

6 years agoFix a use-after-free introduced by r344915.
Adrian Prantl [Fri, 9 Nov 2018 00:26:15 +0000 (00:26 +0000)]
Fix a use-after-free introduced by r344915.

r344915 added a call to ApplyDebugLocation to the sanitizer check
function emitter. Some of the sanitizers are emitted in the function
epilogue though and the LexicalScopeStack is emptied out before. By
detecting this situation and early-exiting from ApplyDebugLocation the
fallback location is used, which is equivalent to the return location.

rdar://problem/45859802

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

6 years ago[Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too
David Blaikie [Thu, 8 Nov 2018 20:47:30 +0000 (20:47 +0000)]
[Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too

The current version only emits  the below error for a module (attempted to be loaded) from the `prebuilt-module-path`:

```
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

With this change, if the prebuilt module is used, we allow the proper diagnostic behind the configuration mismatch to be shown.

```
error: POSIX thread support was disabled in PCH file but is currently enabled
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

(A few lines later an error is emitted anyways, so there is no reason not to complain for configuration mismatches if a config mismatch is found and kills the build.)

Reviewed By: dblaikie

Tags: #clang

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

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

6 years ago[Tooling] Produce diagnostics for missing input files.
Sam McCall [Thu, 8 Nov 2018 16:57:01 +0000 (16:57 +0000)]
[Tooling] Produce diagnostics for missing input files.

Summary:
This was disabled way back in 2011, in the dark times before Driver was VFS-aware.

Also, make driver more VFS-aware :-)

This breaks one ClangTidy test (we improved the error message), will fix when
submitting.

Reviewers: ioeric

Subscribers: cfe-commits, alexfh

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

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

6 years agoFix bitcast to address space cast for coerced load/stores
Yaxun Liu [Thu, 8 Nov 2018 16:55:46 +0000 (16:55 +0000)]
Fix bitcast to address space cast for coerced load/stores

Coerced load/stores through memory do not take into account potential
address space differences when it creates its bitcasts.

Patch by David Salinas.

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

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

6 years ago[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.
Alexey Bataev [Thu, 8 Nov 2018 15:47:39 +0000 (15:47 +0000)]
[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.

The base pointer for the lambda mapping must point to the lambda capture
placement and pointer must point to the captured variable itself. Patch
fixes this problem.

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

6 years agoclang-cl: Add "/clang:" pass-through arg support.
Hans Wennborg [Thu, 8 Nov 2018 11:27:04 +0000 (11:27 +0000)]
clang-cl: Add "/clang:" pass-through arg support.

The clang-cl driver disables access to command line options outside of the
"Core" and "CLOption" sets of command line arguments. This filtering makes it
impossible to pass arguments that are interpreted by the clang driver and not
by either 'cc1' (the frontend) or one of the other tools invoked by the driver.

An example driver-level flag is the '-fno-slp-vectorize' flag, which is
processed by the driver in Clang::ConstructJob and used to set the cc1 flag
"-vectorize-slp". There is no negative cc1 flag or -mllvm flag, so it is not
currently possible to disable the SLP vectorizer from the clang-cl driver.

This change introduces the "/clang:" argument that is available when the
driver mode is set to CL compatibility. This option works similarly to the
"-Xclang" option, except that the option values are processed by the clang
driver rather than by 'cc1'. An example usage is:

  clang-cl /clang:-fno-slp-vectorize /O2 test.c

Another example shows how "/clang:" can be used to pass a flag where there is
a conflict between a clang-cl compat option and an overlapping clang driver
option:

  clang-cl /MD /clang:-MD /clang:-MF /clang:test_dep_file.dep test.c

In the previous example, the unprefixed /MD selects the DLL version of the msvc
CRT, while the prefixed -MD flag and the -MF flags are used to create a make
dependency file for included headers.

One note about flag ordering: the /clang: flags are concatenated to the end of
the argument list, so in cases where the last flag wins, the /clang: flags
will be chosen regardless of their order relative to other flags on the driver
command line.

Patch by Neeraj K. Singh!

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

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

6 years ago[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension
Andrew Savonichev [Thu, 8 Nov 2018 11:25:41 +0000 (11:25 +0000)]
[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

Summary:
Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt

Patch by Kristina Bessonova

Reviewers: Anastasia, yaxunl, shafik

Reviewed By: Anastasia

Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits

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

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

6 years ago[clang] Set CMP0075 to new
Shoaib Meenai [Thu, 8 Nov 2018 00:29:33 +0000 (00:29 +0000)]
[clang] Set CMP0075 to new

Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results, and I verified that a clean configure before and after this
change resulted in identical CMake caches on my machine. The same change
was done for LLVM in r346377.

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

6 years ago[OPENMP]Fix handling of the globals during compilation for the device.
Alexey Bataev [Wed, 7 Nov 2018 19:11:14 +0000 (19:11 +0000)]
[OPENMP]Fix handling of the globals during compilation for the device.

Fixed lookup for the target regions in unused virtual functions + fixed
processing of the global variables not marked as declare target but
emitted during debug info emission.

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

6 years agoRevert r346326 [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation
Andrew Savonichev [Wed, 7 Nov 2018 18:34:19 +0000 (18:34 +0000)]
Revert r346326 [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation

This patch breaks Index/opencl-types.cl LIT test:

Script:
--
: 'RUN: at line 1';   stage1/bin/c-index-test -test-print-type llvm/tools/clang/test/Index/opencl-types.cl -cl-std=CL2.0 | stage1/bin/FileCheck llvm/tools/clang/test/Index/opencl-types.cl
--
Command Output (stderr):
--
llvm/tools/clang/test/Index/opencl-types.cl:3:26: warning: unsupported OpenCL extension 'cl_khr_fp16' - ignoring [-Wignored-pragmas]
llvm/tools/clang/test/Index/opencl-types.cl:4:26: warning: unsupported OpenCL extension 'cl_khr_fp64' - ignoring [-Wignored-pragmas]
llvm/tools/clang/test/Index/opencl-types.cl:8:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:11:8: error: declaring variable of type 'half' is not allowed
llvm/tools/clang/test/Index/opencl-types.cl:15:3: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:16:3: error: use of type 'double4' (vector of 4 'double' values) requires cl_khr_fp64 extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:26:26: warning: unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring [-Wignored-pragmas]
llvm/tools/clang/test/Index/opencl-types.cl:35:44: error: use of type '__read_only image2d_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:36:49: error: use of type '__read_only image2d_array_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:37:49: error: use of type '__read_only image2d_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:38:54: error: use of type '__read_only image2d_array_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled

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

6 years ago[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension
Andrew Savonichev [Wed, 7 Nov 2018 15:44:01 +0000 (15:44 +0000)]
[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

Summary:
Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt

Patch by Kristina Bessonova

Reviewers: Anastasia, yaxunl, shafik

Reviewed By: Anastasia

Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits

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

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

6 years ago[OpenCL] Fix diagnostic message about overload candidates
Andrew Savonichev [Wed, 7 Nov 2018 13:07:18 +0000 (13:07 +0000)]
[OpenCL] Fix diagnostic message about overload candidates

Summary:
I wonder if there are some extension which need to be disabled to get
overloadable candidate available.

Reviewers: asavonic, Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, sidorovd, cfe-commits

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

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

6 years ago[NFC][Clang][Aarch64] Add missing test file
Diogo N. Sampaio [Wed, 7 Nov 2018 11:42:02 +0000 (11:42 +0000)]
[NFC][Clang][Aarch64] Add missing test file

The commit rL345273 by @LukeCheeseman has a missing test file,
see https://reviews.llvm.org/D51429
This patch adds the missing test file.

Patch by Luke Cheeseman

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

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

6 years ago[mips][msa] Fix msa_[st/ld] offset check
Aleksandar Beserminji [Wed, 7 Nov 2018 11:37:05 +0000 (11:37 +0000)]
[mips][msa] Fix msa_[st/ld] offset check

This patch fixes a minimum divider for offset in intrinsics
msa_[st/ld]_[b/h/w/d], when value is known in compile time.

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

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

6 years ago[CodeComplete] Do not complete self-initializations
Ilya Biryukov [Wed, 7 Nov 2018 10:02:31 +0000 (10:02 +0000)]
[CodeComplete] Do not complete self-initializations

Summary:
Removes references to initialized variable from the following completions:

    int x = ^;

Handles only the trivial cases where the variable name is completed
immediately at the start of initializer or assignment, more complicated
cases aren't covered, e.g. these completions still contain 'x':

    // More complicated expressions.
    int x = foo(^);
    int x = 10 + ^;
    // Other kinds of initialization.
    int x{^};
    int x(^);
    // Constructor initializers.
    struct Foo {
      Foo() : x(^) {}
      int x;
    };

We should address those in the future, but they are outside of the scope of
this initial change.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: arphaman, cfe-commits

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

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

6 years ago[Darwin] Export new weak external symbols when compiling with coverage
Vedant Kumar [Tue, 6 Nov 2018 22:25:00 +0000 (22:25 +0000)]
[Darwin] Export new weak external symbols when compiling with coverage

Some weak external symbols were added to the profile runtime in D49953,
and on Darwin, these need to be exported for tapi verification purposes.

I've tightened the test so that future breakages can be caught earlier.

rdar://45831054

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

6 years agoDon't use std::next() on an input iterator; NFC.
Aaron Ballman [Tue, 6 Nov 2018 21:12:44 +0000 (21:12 +0000)]
Don't use std::next() on an input iterator; NFC.

Instead, advance the old-fashioned way, as std::next() cannot be used on an input iterator until C++17.

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

6 years ago[MS] Zero out ECX in __cpuid in intrin.h
Reid Kleckner [Tue, 6 Nov 2018 20:45:26 +0000 (20:45 +0000)]
[MS] Zero out ECX in __cpuid in intrin.h

Summary:
Some CPUID leafs depend on the value of ECX as well as EAX, but we left
it uninitialized.

Originally reported as https://crbug.com/901547

Reviewers: craig.topper, hans

Subscribers: cfe-commits

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

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

6 years agoT was unused on assertion disabled builds.
Kadir Cetinkaya [Tue, 6 Nov 2018 08:59:25 +0000 (08:59 +0000)]
T was unused on assertion disabled builds.

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

6 years agoCast to uint64_t instead of to unsigned.
Akira Hatanaka [Tue, 6 Nov 2018 07:12:28 +0000 (07:12 +0000)]
Cast to uint64_t instead of to unsigned.

This is a follow-up to r346211.

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

6 years agoos_log: Allow specifying mask type in format string.
Akira Hatanaka [Tue, 6 Nov 2018 07:05:14 +0000 (07:05 +0000)]
os_log: Allow specifying mask type in format string.

A mask type is a 1 to 8-byte string that follows the "mask." annotation
in the format string. This enables obfuscating data in the event the
provided privacy level isn't enabled.

rdar://problem/36756282

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

6 years agoos_log: Add a new privacy annotation "sensitive".
Akira Hatanaka [Tue, 6 Nov 2018 06:26:17 +0000 (06:26 +0000)]
os_log: Add a new privacy annotation "sensitive".

This is a stricter privacy annotation than "private", which will be used
for data that shouldn’t be logged to disk. For backward compatibility,
the "private" bit is set too.

rdar://problem/36755912

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

6 years agoos_log: Minor code cleanups. NFC.
Akira Hatanaka [Tue, 6 Nov 2018 05:41:33 +0000 (05:41 +0000)]
os_log: Minor code cleanups. NFC.

Also, add a new test case and fix an incorrect comment.

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

6 years ago[COFF, ARM64] Implement InterlockedDecrement*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 05:07:43 +0000 (05:07 +0000)]
[COFF, ARM64] Implement InterlockedDecrement*_* builtins

This is eight in a series of patches to move intrinsic definitions out of intrin.h.

Differential: https://reviews.llvm.org/D54068

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

6 years ago[COFF, ARM64] Implement InterlockedIncrement*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 05:05:32 +0000 (05:05 +0000)]
[COFF, ARM64] Implement InterlockedIncrement*_* builtins

This is seventh in a series of patches to move intrinsic definitions out of intrin.h.

Differential: https://reviews.llvm.org/D54067

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

6 years ago[COFF, ARM64] Implement InterlockedAnd*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 05:03:13 +0000 (05:03 +0000)]
[COFF, ARM64] Implement InterlockedAnd*_* builtins

This is sixth in a series of patches to move intrinsic definitions out of intrin.h.

Differential: https://reviews.llvm.org/D54066

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

6 years ago[COFF, ARM64] Implement InterlockedXor*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 04:55:20 +0000 (04:55 +0000)]
[COFF, ARM64] Implement InterlockedXor*_* builtins

This is fifth in a series of patches to move intrinsic definitions out of intrin.h.

Note: This was reviewed and approved in D54065 but somehow that diff was messed
up. Committing this again with the proper diff.

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

6 years ago[CodeGenCXX] XFAIL test for ASAN on Darwin.
Volodymyr Sapsai [Tue, 6 Nov 2018 02:16:28 +0000 (02:16 +0000)]
[CodeGenCXX] XFAIL test for ASAN on Darwin.

The test hits stack overflow trying to instantiate recursive templates.
It is observed with ASAN and not with a regular build because ASAN
increases stack frame size.

rdar://problem/45009892

Reviewers: george.karpenkov, lebedev.ri

Reviewed By: george.karpenkov

Subscribers: dexonsmith, rjmccall, cfe-commits

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

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

6 years agoRevert "[COFF, ARM64] Implement InterlockedXor*_* builtins"
Mandeep Singh Grang [Tue, 6 Nov 2018 01:14:24 +0000 (01:14 +0000)]
Revert "[COFF, ARM64] Implement InterlockedXor*_* builtins"

This reverts commit cc3d3cd0fbeb88412d332354c261ff139c4ede6b.

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

6 years ago[COFF, ARM64] Implement InterlockedXor*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 01:12:29 +0000 (01:12 +0000)]
[COFF, ARM64] Implement InterlockedXor*_* builtins

Summary: This is fifth in a series of patches to move intrinsic definitions out of intrin.h.

Reviewers: rnk, efriedma, mstorsjo, TomTan

Reviewed By: efriedma

Subscribers: javed.absar, kristof.beyls, chrib, jfb, kristina, cfe-commits

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

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

6 years ago[COFF, ARM64] Implement InterlockedOr*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 01:11:25 +0000 (01:11 +0000)]
[COFF, ARM64] Implement InterlockedOr*_* builtins

This is fourth in a series of patches to move intrinsic definitions out of intrin.h.

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

6 years ago[COFF, ARM64] Implement InterlockedCompareExchange*_* builtins
Mandeep Singh Grang [Tue, 6 Nov 2018 00:36:48 +0000 (00:36 +0000)]
[COFF, ARM64] Implement InterlockedCompareExchange*_* builtins

Summary: This is third in a series of patches to move intrinsic definitions out of intrin.h.

Reviewers: rnk, efriedma, mstorsjo, TomTan

Reviewed By: efriedma

Subscribers: javed.absar, kristof.beyls, chrib, jfb, kristina, cfe-commits

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

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

6 years agoAMDGPU: Add sram-ecc feature options
Konstantin Zhuravlyov [Mon, 5 Nov 2018 22:44:59 +0000 (22:44 +0000)]
AMDGPU: Add sram-ecc feature options

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

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

6 years ago[Driver] Reland again again: Default Android toolchains to libc++.
Dan Albert [Mon, 5 Nov 2018 20:57:46 +0000 (20:57 +0000)]
[Driver] Reland again again: Default Android toolchains to libc++.

Landed more fixes to the compiler-rt Android tests.

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

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

6 years ago[AST] Get aliased type info from an aliased TemplateSpecialization.
Matt Davis [Mon, 5 Nov 2018 17:25:26 +0000 (17:25 +0000)]
[AST] Get aliased type info from an aliased TemplateSpecialization.

Summary:
Previously the TemplateSpecialization instance for 'template_alias', in the example below, returned the type info of the  canonical type (int).  This ignored the type alias if the template type happen to be aliased.

Before this patch, the assert would trigger with an  alignment of 4:
```
typedef int __attribute__(( aligned( 16 ) )) aligned_int;
template < typename >
using template_alias = aligned_int;
static_assert( alignof( template_alias<void>) == 16, "" );
```

This patch checks if the TemplateSpecialization type has an alias, and if so will return the type information for the aliased type, else the canonical type's info is returned (original behavior).  I believe that this is the desired behavior.

Reviewers: aaron.ballman, rjmccall

Reviewed By: rjmccall

Subscribers: cfe-commits

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

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

6 years ago[Format] Add debugging to ObjC language guesser
Ben Hamilton [Mon, 5 Nov 2018 16:59:33 +0000 (16:59 +0000)]
[Format] Add debugging to ObjC language guesser

Summary:
To handle diagnosing bugs where ObjCHeaderStyleGuesser guesses
wrong, this diff adds a bit more debug logging to the Objective-C
language guesser.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

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

6 years ago[Tooling] Correct the total number of files being processed when `filter` is provided.
Haojian Wu [Mon, 5 Nov 2018 15:08:00 +0000 (15:08 +0000)]
[Tooling] Correct the total number of files being processed when `filter` is provided.

Reviewers: ioeric

Subscribers: cfe-commits

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

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

6 years ago[Tooling] Add "-filter" option to AllTUsExecution
Haojian Wu [Mon, 5 Nov 2018 13:42:05 +0000 (13:42 +0000)]
[Tooling] Add "-filter" option to AllTUsExecution

Summary: We can run the tools on a subset files of compilation database.

Reviewers: ioeric

Subscribers: cfe-commits

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

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