]> granicus.if.org Git - clang/log
clang
5 years agoFix ASTMerge/namespace/test.cpp after r360701
Reid Kleckner [Tue, 14 May 2019 20:01:03 +0000 (20:01 +0000)]
Fix ASTMerge/namespace/test.cpp after r360701

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

5 years agoTemporarily revert "Change -gz and -Wa,--compress-debug-sections to use gABI compress...
Eric Christopher [Tue, 14 May 2019 19:40:42 +0000 (19:40 +0000)]
Temporarily revert "Change -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)"

This affects users of older (pre 2.26) binutils in such a way that they can't necessarily
work around it as it doesn't support the compress option on the command line. Reverting
to unblock them and we can revisit whether to make this change now or fix how we want
to express the option.

This reverts commit bdb21337e6e1732c9895966449c33c408336d295/r360403.

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

5 years agoUpdate ASTMerge FileCheck test expectations
Reid Kleckner [Tue, 14 May 2019 19:02:39 +0000 (19:02 +0000)]
Update ASTMerge FileCheck test expectations

I belive many of these diagnostics changed from errors to warnings in
r357394. I've simply mechanically updated the tests, but whoever owns
this code should probably audit for unintented behavior changes. I
wasn't able to find a flag to make these warnings errors again.

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

5 years agoRestore test files accidentally deleted in r354839
Reid Kleckner [Tue, 14 May 2019 18:51:07 +0000 (18:51 +0000)]
Restore test files accidentally deleted in r354839

I think there must be a bug in git-llvm causing parent directories to be
deleted when the diff deletes files in a subdirectory. Perhaps it is
Windows-only.

There has been a behavior change, so some of these tests now fail. I
have marked them XFAIL and will fix them in a follow-up to separate the
changes.

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

5 years ago[Sema] CodeSynthesisContext - add missing variable initialization to constructor...
Simon Pilgrim [Tue, 14 May 2019 14:58:47 +0000 (14:58 +0000)]
[Sema] CodeSynthesisContext - add missing variable initialization to constructor. NFCI.

SavedInNonInstantiationSFINAEContext isn't used outside of specific contexts but this fixes cppcheck and scan-build warnings.

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

5 years ago[Driver][Windows] Add dependent lib argument for profile instr generate
Russell Gallop [Tue, 14 May 2019 14:01:40 +0000 (14:01 +0000)]
[Driver][Windows] Add dependent lib argument for profile instr generate

This is needed so lld-link can find clang_rt.profile when self hosting
on Windows with PGO. Using clang-cl as a linker knows to add the library
but self hosting, using -DCMAKE_LINKER=<...>/lld-link.exe doesn't.

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

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

5 years agoMake getObjCEncodingForTypeImpl() take a bitmask instead of 8 bools
Nico Weber [Tue, 14 May 2019 12:32:37 +0000 (12:32 +0000)]
Make getObjCEncodingForTypeImpl() take a bitmask instead of 8 bools

Slightly easier to read, uses slightly less stack space, and makes it
impossible to mix up the order of all those bools.

No behavior change.

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

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

5 years agoAdd a new language mode for C2x; enable [[attribute]] support by default in C2x.
Aaron Ballman [Tue, 14 May 2019 12:09:55 +0000 (12:09 +0000)]
Add a new language mode for C2x; enable [[attribute]] support by default in C2x.

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

5 years agoRevert r360637 "PR41817: Fix regression in r359260 that caused the MS compatibility"
Hans Wennborg [Tue, 14 May 2019 10:11:33 +0000 (10:11 +0000)]
Revert r360637 "PR41817: Fix regression in r359260 that caused the MS compatibility"

> extension allowing a "static" declaration to follow an "extern"
> declaration to stop working.

It introduced asserts for some "static-following-extern" cases, breaking the
Chromium build. See the cfe-commits thread for reproducer.

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

5 years agoPR41817: Fix regression in r359260 that caused the MS compatibility
Richard Smith [Tue, 14 May 2019 00:27:16 +0000 (00:27 +0000)]
PR41817: Fix regression in r359260 that caused the MS compatibility
extension allowing a "static" declaration to follow an "extern"
declaration to stop working.

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

5 years ago[c++20] P1064R0: Allow virtual function calls in constant expression
Richard Smith [Mon, 13 May 2019 23:35:21 +0000 (23:35 +0000)]
[c++20] P1064R0: Allow virtual function calls in constant expression
evaluation.

This reinstates r360559, reverted in r360580, with a fix to avoid
crashing if evaluation-for-overflow mode encounters a virtual call on an
object of a class with a virtual base class, and to generally not try to
resolve virtual function calls to objects whose (notional) vptrs are not
readable. (The standard rules are unclear here, but this seems like a
reasonable approach.)

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

5 years ago[AMDGPU] gfx1010 clang target
Stanislav Mekhanoshin [Mon, 13 May 2019 23:15:59 +0000 (23:15 +0000)]
[AMDGPU] gfx1010 clang target

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

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

5 years ago[X86] Make `x86intrin.h`, `immintrin.h` includable with `-fno-gnu-inline-asm`.
Volodymyr Sapsai [Mon, 13 May 2019 22:40:11 +0000 (22:40 +0000)]
[X86] Make `x86intrin.h`, `immintrin.h` includable with `-fno-gnu-inline-asm`.

Currently `immintrin.h` includes `pconfigintrin.h` and `sgxintrin.h`
which contain inline assembly. It causes failures when building with the
flag `-fno-gnu-inline-asm`.

Fix by excluding functions with inline assembly when this extension is
disabled. So far there was no need to support `_pconfig_u32`,
`_enclu_u32`, `_encls_u32`, `_enclv_u32` on platforms that require
`-fno-gnu-inline-asm`. But if developers start using these functions,
they'll have compile-time undeclared identifier errors which is
preferrable to runtime errors.

rdar://problem/49540880

Reviewers: craig.topper, GBuella, rnk, echristo

Reviewed By: rnk

Subscribers: jkorous, dexonsmith, cfe-commits

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

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

5 years agoRemoving an unused member variable; NFC.
Aaron Ballman [Mon, 13 May 2019 22:29:16 +0000 (22:29 +0000)]
Removing an unused member variable; NFC.

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

5 years ago[OpenMP][Clang][BugFix] Split declares and math functions inclusion.
Gheorghe-Teodor Bercea [Mon, 13 May 2019 22:11:44 +0000 (22:11 +0000)]
[OpenMP][Clang][BugFix] Split declares and math functions inclusion.

Summary: This patches fixes an issue in which the __clang_cuda_cmath.h header is being included even when cmath or math.h headers are not included.

Reviewers: jdoerfert, ABataev, hfinkel, caomhin, tra

Reviewed By: tra

Subscribers: tra, mgorny, guansong, cfe-commits

Tags: #clang

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

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

5 years agoMake language option `GNUAsm` discoverable with `__has_extension` macro.
Volodymyr Sapsai [Mon, 13 May 2019 22:11:10 +0000 (22:11 +0000)]
Make language option `GNUAsm` discoverable with `__has_extension` macro.

This can be used for better support of `-fno-gnu-inline-asm` builds.

rdar://problem/49540880

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Subscribers: eraman, jkorous, dexonsmith, craig.topper, cfe-commits

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

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

5 years agoIntroduce the ability to dump the AST to JSON.
Aaron Ballman [Mon, 13 May 2019 21:39:55 +0000 (21:39 +0000)]
Introduce the ability to dump the AST to JSON.

This adds the -ast-dump=json cc1 flag (in addition to -ast-dump=default, which is the default if no dump format is specified), as well as some initial AST dumping functionality and tests.

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

5 years agoMake more friendly with unions. Reviewed as https://reviews.llvm.org/D61858
Marshall Clow [Mon, 13 May 2019 19:29:23 +0000 (19:29 +0000)]
Make  more friendly with unions. Reviewed as https://reviews.llvm.org/D61858

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

5 years ago[clang][ASTContext] Call setAttached for comments attached to a declaration
Jan Korous [Mon, 13 May 2019 17:52:09 +0000 (17:52 +0000)]
[clang][ASTContext] Call setAttached for comments attached to a declaration

This is a bug affecting performance when compiling with -Wdocumentation.

In Sema::ActOnDocumentable we're checking whether there are any comments unattached to declaration at the end of comment list whenever we encounter new documentable declaration.
Since this property of RawComment was never set we were trying to find comments every time and that involves at least a couple expensive SourceLocation decompositions.

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

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

5 years agoRevert r360559 "[c++20] P1064R0: Allow virtual function calls in constant expression...
Hans Wennborg [Mon, 13 May 2019 13:19:09 +0000 (13:19 +0000)]
Revert r360559 "[c++20] P1064R0: Allow virtual function calls in constant expression evaluation."

This caused Chromium builds to hit the new "can't handle virtual calls with
virtual bases" assert. Reduced repro coming up.

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

5 years ago[ASTImporter] Separate unittest files
Gabor Marton [Mon, 13 May 2019 10:06:25 +0000 (10:06 +0000)]
[ASTImporter] Separate unittest files

Summary:
Move generic redecl chain tests and visibility tests into their own
separate test files.

Reviewers: a_sidorin, a.sidorin, shafik

Subscribers: mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

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

5 years agoPR41845: Detect and reject mismatched inner/outer pack expansion sizes
Richard Smith [Mon, 13 May 2019 08:31:14 +0000 (08:31 +0000)]
PR41845: Detect and reject mismatched inner/outer pack expansion sizes
in fold expressions rather than crashing.

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

5 years agoPR41854: Don't assert when constant-evaluating a member function call on an invalid...
Richard Smith [Mon, 13 May 2019 07:51:29 +0000 (07:51 +0000)]
PR41854: Don't assert when constant-evaluating a member function call on an invalid designator.

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

5 years ago[c++20] P1064R0: Allow virtual function calls in constant expression
Richard Smith [Mon, 13 May 2019 07:42:10 +0000 (07:42 +0000)]
[c++20] P1064R0: Allow virtual function calls in constant expression
evaluation.

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

5 years agoFix test to use -cc1.
Leonard Chan [Sun, 12 May 2019 22:44:46 +0000 (22:44 +0000)]
Fix test to use -cc1.

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

5 years ago[clang] Regenerate AST matcher docs 📖
Stephane Moore [Sun, 12 May 2019 21:52:19 +0000 (21:52 +0000)]
[clang] Regenerate AST matcher docs ðŸ“–

Summary:
The documentation seems to have been manually edited in https://reviews.llvm.org/rGa282bde69e375985edd4c371b79864f617380ad5.

This commit regenerates the documentation and commits the resulting diff.

Reviewers: benhamilton, mwyman

Reviewed By: mwyman

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoFix for P41852 where builtin attributes were being caught by FindLocsWithCommonFileID().
Leonard Chan [Sun, 12 May 2019 21:50:01 +0000 (21:50 +0000)]
Fix for P41852 where builtin attributes were being caught by FindLocsWithCommonFileID().

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

5 years agomake -ftime-trace also print template arguments
Lubos Lunak [Sun, 12 May 2019 10:39:21 +0000 (10:39 +0000)]
make -ftime-trace also print template arguments

Without this, I get e.g. 'PerformPendingInstantiations' -> 'std::fill',
now I get 'std::fill<unsigned long *, int>'.

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

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

5 years agoReject attempts to call non-static member functions on objects outside
Richard Smith [Sun, 12 May 2019 09:39:08 +0000 (09:39 +0000)]
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.

This reinstates r360499, reverted in r360531.

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

5 years agoFix handling of objects under construction during constant expression
Richard Smith [Sun, 12 May 2019 08:57:59 +0000 (08:57 +0000)]
Fix handling of objects under construction during constant expression
evaluation.

It's not enough to just track the LValueBase that we're evaluating, we
need to also track the path to the objects whose constructors are
running.

This reinstates r360464 (reverted in r360531) with a workaround for an
MSVC bug that previously caused the Windows bots to fail.

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

5 years agoRevert rL360499 and rL360464 from cfe/trunk:
Simon Pilgrim [Sat, 11 May 2019 20:21:59 +0000 (20:21 +0000)]
Revert rL360499 and rL360464 from cfe/trunk:
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.
........
Fix handling of objects under construction during constant expression
evaluation.

It's not enough to just track the LValueBase that we're evaluating, we
need to also track the path to the objects whose constructors are
running.
........
Fixes windows buildbots

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

5 years agoConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:01:46 +0000 (11:01 +0000)]
ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.

Duplicate getOffset() call.

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

5 years agoReject attempts to call non-static member functions on objects outside
Richard Smith [Sat, 11 May 2019 02:00:06 +0000 (02:00 +0000)]
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.

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

5 years ago[cc1as] Change -compress-debug-sections= to use --
Fangrui Song [Sat, 11 May 2019 01:14:50 +0000 (01:14 +0000)]
[cc1as] Change -compress-debug-sections= to use --

The double dash form is documented by GNU as, used by gcc, and accepted by llvm-mc.

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

5 years ago[Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the builtins...
Amara Emerson [Fri, 10 May 2019 23:24:20 +0000 (23:24 +0000)]
[Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the builtins library.

This driver flag is useful when users want to link against the compiler's
builtins, but nothing else, and so use flags like -nostdlib.

Darwin can't use -nolibc & nostdlib++ like other platforms on because we
disable all runtime lib linking with -static, which we still want to have
an option to link with the builtins.

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

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

5 years ago[CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when
Akira Hatanaka [Fri, 10 May 2019 21:54:16 +0000 (21:54 +0000)]
[CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when
necessary.

Prior to r349952, clang used to call objc_msgSend when sending a release
messages, emitting an invoke instruction instead of a call instruction
when it was necessary to catch an exception. That changed in r349952
because runtime function objc_release is called as a nounwind function,
which broke programs that were overriding the dealloc method and
throwing an exception from it. This patch restores the behavior prior to
r349952.

rdar://problem/50253394

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

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

5 years ago[ThinLTO] Clang test changes for new CanAutoHide flag
Teresa Johnson [Fri, 10 May 2019 20:38:31 +0000 (20:38 +0000)]
[ThinLTO] Clang test changes for new CanAutoHide flag

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

5 years agoFixed tests where grep was not matching the linefeed
Alexandre Ganea [Fri, 10 May 2019 20:11:36 +0000 (20:11 +0000)]
Fixed tests where grep was not matching the linefeed

When files are synchronized locally as CRLF on Windows, grep didn't match the newline. Switched to FileCheck instead.

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

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

5 years agoAdd target triple to test.
Leonard Chan [Fri, 10 May 2019 20:07:47 +0000 (20:07 +0000)]
Add target triple to test.

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

5 years agoFix handling of objects under construction during constant expression
Richard Smith [Fri, 10 May 2019 20:05:32 +0000 (20:05 +0000)]
Fix handling of objects under construction during constant expression
evaluation.

It's not enough to just track the LValueBase that we're evaluating, we
need to also track the path to the objects whose constructors are
running.

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

5 years agoImprove interface of APValuePathEntry.
Richard Smith [Fri, 10 May 2019 20:05:31 +0000 (20:05 +0000)]
Improve interface of APValuePathEntry.

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

5 years agoReplace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
Paul Robinson [Fri, 10 May 2019 18:32:53 +0000 (18:32 +0000)]
Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
to say the same thing.

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

5 years agoFix and test for assertion error in P41835.
Leonard Chan [Fri, 10 May 2019 18:05:15 +0000 (18:05 +0000)]
Fix and test for assertion error in P41835.

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

5 years agoReplace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
Paul Robinson [Fri, 10 May 2019 17:57:22 +0000 (17:57 +0000)]
Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
expresses the intent of the exclusion.

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

5 years ago[Sema] Mark array element destructors referenced during initialization
Erik Pilkington [Fri, 10 May 2019 17:52:26 +0000 (17:52 +0000)]
[Sema] Mark array element destructors referenced during initialization

This fixes a crash where we would neglect to mark a destructor referenced for an
__attribute__((no_destory)) array. The destructor is needed though, since if an
exception is thrown we need to cleanup the elements.

rdar://48462498

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

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

5 years ago[libclang] Forward isInline for NamespaceDecl to libclang
Nikolai Kosjar [Fri, 10 May 2019 13:58:34 +0000 (13:58 +0000)]
[libclang] Forward isInline for NamespaceDecl to libclang

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

5 years agoAdd name comments for bools passed to getObjCEncodingForTypeImpl()
Nico Weber [Fri, 10 May 2019 13:56:56 +0000 (13:56 +0000)]
Add name comments for bools passed to getObjCEncodingForTypeImpl()

No behavior change. Medium term, probably want to use a bitmask instead
of 8 distinct bool parameters, but let's make the call sites easier to
read first.

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

5 years agoReplace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminate
Paul Robinson [Fri, 10 May 2019 13:40:17 +0000 (13:40 +0000)]
Replace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminate
'non-ps4-sdk' and use just 'ps4'.

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

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Fri, 10 May 2019 10:36:37 +0000 (10:36 +0000)]
Fix Wdocumentation warning. NFCI.

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

5 years ago[Preamble] Stop circular inclusion of main file when building preamble
Nikolai Kosjar [Fri, 10 May 2019 10:25:35 +0000 (10:25 +0000)]
[Preamble] Stop circular inclusion of main file when building preamble

If a header file was processed for the second time, we could end up with a
wrong conditional stack and skipped ranges:

In the particular example, if the header guard is evaluated the second time and
it is decided to skip the conditional block, the corresponding "#endif" is
never seen since the preamble does not include it and we end up in the
Tok.is(tok::eof) case with a wrong conditional stack.

Detect the circular inclusion, emit a diagnostic and stop processing the
inclusion.

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

5 years agoRevert "Revert "[clang-format] Keep protobuf "package" statement on one line""
Krasimir Georgiev [Fri, 10 May 2019 09:15:11 +0000 (09:15 +0000)]
Revert "Revert "[clang-format] Keep protobuf "package" statement on one line""

Summary:
Top-level "package" and "import" statements should generally be kept on
one line, for all languages.

----

This reverts commit rL356912.
The regression from rL356835 was fixed via rC358275.

Reviewers: krasimir, sammccall, MyDeveloperDay, xinz, dchai, klimek

Reviewed By: krasimir, xinz, dchai

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoDelete write-only HasQualifiers after rC360370
Fangrui Song [Fri, 10 May 2019 06:59:50 +0000 (06:59 +0000)]
Delete write-only HasQualifiers after rC360370

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

5 years agoAdded an assert in `isConstantInitializer`: initializer lists must be in semantic...
Dmitri Gribenko [Fri, 10 May 2019 06:39:20 +0000 (06:39 +0000)]
Added an assert in `isConstantInitializer`: initializer lists must be in semantic form

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoAssume `__cxa_allocate_exception` returns an under-aligned memory on
Akira Hatanaka [Fri, 10 May 2019 02:16:37 +0000 (02:16 +0000)]
Assume `__cxa_allocate_exception` returns an under-aligned memory on
Darwin if the version of libc++abi isn't new enough to include the fix
in r319123

This patch resurrects r264998, which was committed to work around a bug
in libc++abi that was causing _cxa_allocate_exception to return a memory
that wasn't double-word aligned.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160328/154332.html

In addition, this patch makes clang issue a warning if the type of the
thrown object requires an alignment that is larger than the minimum
guaranteed by the target C++ runtime.

rdar://problem/49864414

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

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

5 years agoChange -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)
Fangrui Song [Fri, 10 May 2019 02:08:21 +0000 (02:08 +0000)]
Change -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)

Since July 15, 2015 (binutils-gdb commit
19a7fe52ae3d0971e67a134bcb1648899e21ae1c, included in 2.26), gas
--compress-debug-sections=zlib (gcc -gz) means zlib-gabi:
SHF_COMPRESSED. Before that it meant zlib-gnu (.zdebug).

clang's -gz was introduced in rC306115 (Jun 2017) to indicate zlib-gnu. It
is 2019 now and it is not unreasonable to assume users of the new
feature to have new linkers (ld.bfd/gold >= 2.26, lld >= rLLD273661).

Change clang's default accordingly to improve standard conformance.
zlib-gnu becomes out of fashion and gets poorer toolchain support.
Its mangled names confuse tools and are more likely to cause problems.

Reviewed By: compnerd

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

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

5 years agoRemember to decay arrays to pointers before checking whether the
Richard Smith [Thu, 9 May 2019 22:22:48 +0000 (22:22 +0000)]
Remember to decay arrays to pointers before checking whether the
left-hand side of an -> operator is a pointer to class type.

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

5 years agoNFC, make XFAIL work on macOS correctly for test/Driver/XRay/xray-instrument-os.c
Alex Lorenz [Thu, 9 May 2019 20:35:41 +0000 (20:35 +0000)]
NFC, make XFAIL work on macOS correctly for test/Driver/XRay/xray-instrument-os.c

The test 'test/Driver/XRay/xray-instrument-os.c' is supposed to XFAIL on -darwin triples.
However, LLVM can be configured to be built with a -macos triple instead, which is equivalent
to -darwin. This commit updates the XFAIL condition to also XFAIL with a -macos host triple.

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

5 years agoDR1872: don't allow any calls to virtual functions in constant
Richard Smith [Thu, 9 May 2019 19:45:49 +0000 (19:45 +0000)]
DR1872: don't allow any calls to virtual functions in constant
evaluation.

Not even in cases where we would not actually perform virtual dispatch.

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

5 years agoSimplify tracking of end of consumed decl-specifier sequence.
Richard Smith [Thu, 9 May 2019 19:45:46 +0000 (19:45 +0000)]
Simplify tracking of end of consumed decl-specifier sequence.

Patch by Tyker!

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

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

5 years ago[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none).
Alexey Bataev [Thu, 9 May 2019 18:44:53 +0000 (18:44 +0000)]
[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none).

If the combined directive has default(none) clause and has clauses for
inner directive that reference some variables, for which data-sharing
attributes are not specified, the error messages should be emitted for
such variables.

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

5 years agoSpecify target triple to fix the tests I committed in r360359 that are
Akira Hatanaka [Thu, 9 May 2019 18:32:16 +0000 (18:32 +0000)]
Specify target triple to fix the tests I committed in r360359 that are
still failing.

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

5 years ago[OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.
Alexey Bataev [Thu, 9 May 2019 18:14:57 +0000 (18:14 +0000)]
[OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.

If the default(none) was specified for the construct, we might miss
diagnostic for the globals without explicitly specified data-sharing
attributes. Patch fixes this problem.

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

5 years agoSpecify ObjC runtime to fix the tests I committed in r360359 that are
Akira Hatanaka [Thu, 9 May 2019 18:05:17 +0000 (18:05 +0000)]
Specify ObjC runtime to fix the tests I committed in r360359 that are
failing.

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

5 years ago[CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make
Akira Hatanaka [Thu, 9 May 2019 17:43:52 +0000 (17:43 +0000)]
[CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make
private symbols in the __DATA segment internal.

This prevents the linker from removing the symbol names. Keeping the
symbols visible enables tools to collect various information about the
symbols, for example, tools that discover whether or not a symbol gets
dirtied.

rdar://problem/48887111

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

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

5 years ago[OpenCL] Make global ctor init function a kernel
Anastasia Stulova [Thu, 9 May 2019 13:55:44 +0000 (13:55 +0000)]
[OpenCL] Make global ctor init function a kernel

We need to be able to enqueue internal function that initializes
global constructors on the host side. Therefore it has to be
converted to a kernel.

This change factors out common logic for adding kernel metadata
and moves it from CodeGenFunction to CodeGenModule in order to
make it accessible for the extra use case.

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

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

5 years agoFix gcc compilation warning in an assert [NFC]
Mikael Holmen [Thu, 9 May 2019 12:11:57 +0000 (12:11 +0000)]
Fix gcc compilation warning in an assert [NFC]

Without this, gcc (7.4) complains with

../tools/clang/lib/Parse/ParseDecl.cpp:3937:63: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
     assert(!isAlreadyConsumed || RangeEnd != SourceLocation() &&
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                      "both or neither of isAlreadyConsumed and "
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                      "RangeEnd needs to be set");
                                      ~

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

5 years ago[OpenCL] Switched CXX mode to be derived from C++17
Anastasia Stulova [Thu, 9 May 2019 11:55:24 +0000 (11:55 +0000)]
[OpenCL] Switched CXX mode to be derived from C++17

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

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

5 years ago[FIX] Change test to read file instead
Diogo N. Sampaio [Thu, 9 May 2019 11:23:00 +0000 (11:23 +0000)]
[FIX] Change test to read file instead

This should fix the test file failing in
windows by reading the file it self instead
of stdin, from 543913c3b41f

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

5 years agoRevert "[OPENMP]Fix PR41768: check DSA for globals with `default(none)` clauses."
Roman Lebedev [Thu, 9 May 2019 10:48:13 +0000 (10:48 +0000)]
Revert "[OPENMP]Fix PR41768: check DSA for globals with `default(none)` clauses."

This has introduced (exposed?) a crash in clang sema,
that does not happen without this patch.
I'll followup in the original bugreport and commit with reproducer.

This reverts commit r360061.

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

5 years agoRevert "[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none)."
Roman Lebedev [Thu, 9 May 2019 10:47:45 +0000 (10:47 +0000)]
Revert "[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none)."

This implementation isn't sound as per the standard.
It erroneously diagnoses e.g. the following case:
```
$ cat test.cpp
void f(int n) {
 #pragma omp parallel default(none) if(n)
    ;
}
```
```
$ ./bin/clang -fopenmp test.cpp
test.cpp:2:40: error: variable 'n' must have explicitly specified data sharing attributes
 #pragma omp parallel default(none) if(n)
                                       ^
test.cpp:2:31: note: explicit data sharing attribute requested here
 #pragma omp parallel default(none) if(n)
                              ^
1 error generated.
```

As per OpenMP Application Programming Interface Version 5.0 November 2018:
* 2.19.4.1default Clause
  The default clause explicitly determines the data-sharing attributes of
  variables that are referenced *in a parallel, teams, or task generating
  construct and would otherwise be implicitly determined
  (see Section 2.19.1.1 on page 270).
* 2.6.1 Determining the Number of Threads for a parallel Region
  Using a variable in an if or num_threads clause expression of a parallel
  construct causes an implicit reference to the variable in all enclosing
  constructs. The if clause expression and the num_threads clause expression
  are evaluated in the context outside of the parallel construct,

This reverts commit r360073.

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

5 years ago[SPIR] Simplified target checking.
Anastasia Stulova [Thu, 9 May 2019 10:25:45 +0000 (10:25 +0000)]
[SPIR] Simplified target checking.

Switched to Triple::isSPIR() helper to simplify code.

Patch by kpet (Kevin Petit)!

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

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

5 years ago[ARM] Fix the extensions implied by a cpu name
Diogo N. Sampaio [Thu, 9 May 2019 10:24:36 +0000 (10:24 +0000)]
[ARM] Fix the extensions implied by a cpu name

Summary:
When using `clang -mcpu=CPUNAME+FEATURELIST`,
the implied features defined by CPUNAME are
not obtained, as the entire string is passed.
This fixes that by spiting the cpuname
string in the first `+`, if any.

For example, when using
```clang -### --target=arm-arm-none-eabi -march=armv7-a -mcpu=cortex-a8+nocrc```
the intrinsic
```"target-feature" "+dsp"```
implied by `cortex-a8` is missing.

Reviewers: keith.walker.arm, DavidSpickett, carwil

Reviewed By: DavidSpickett

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

Tags: #clang

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

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

5 years ago[NewPM] Setup Passes for KASan and KMSan
Petr Hosek [Thu, 9 May 2019 06:09:35 +0000 (06:09 +0000)]
[NewPM] Setup Passes for KASan and KMSan

While ASan and MSan passes were already ported to new PM, the kernel
variants weren't setup in the pipeline which makes the KASan and KMSan
tests in Clang fail.

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

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

5 years ago[c++20] Add support for explicit(bool), as described in P0892R2.
Richard Smith [Thu, 9 May 2019 03:59:21 +0000 (03:59 +0000)]
[c++20] Add support for explicit(bool), as described in P0892R2.

Patch by Tyker!

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

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

5 years ago[cxx_status] Mark support for std::is_constant_evaluated as done.
Richard Smith [Thu, 9 May 2019 03:49:47 +0000 (03:49 +0000)]
[cxx_status] Mark support for std::is_constant_evaluated as done.

Eric implemented this in r359067.

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

5 years ago[cxx_dr_status] Update links to use wg21.link, and list "extension"
Richard Smith [Thu, 9 May 2019 03:45:57 +0000 (03:45 +0000)]
[cxx_dr_status] Update links to use wg21.link, and list "extension"
issues as "extension" rather than "not resolved".

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

5 years ago[c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whose
Richard Smith [Thu, 9 May 2019 03:31:27 +0000 (03:31 +0000)]
[c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whose
template name is not visible to unqualified lookup.

In order to support this without a severe degradation in our ability to
diagnose typos in template names, this change significantly restructures
the way we handle template-id-shaped syntax for which lookup of the
template name finds nothing.

Instead of eagerly diagnosing an undeclared template name, we now form a
placeholder template-name representing a name that is known to not find
any templates. When the parser sees such a name, it attempts to
disambiguate whether we have a less-than comparison or a template-id.
Any diagnostics or typo-correction for the name are delayed until its
point of use.

The upshot should be a small improvement of our diagostic quality
overall: we now take more syntactic context into account when trying to
resolve an undeclared identifier on the left hand side of a '<'. In
fact, this works well enough that the backwards-compatible portion (for
an undeclared identifier rather than a lookup that finds functions but
no function templates) is enabled in all language modes.

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

5 years agoWhen typo-correcting a function name, consider correcting to a type name
Richard Smith [Thu, 9 May 2019 00:57:24 +0000 (00:57 +0000)]
When typo-correcting a function name, consider correcting to a type name
for a function-style cast.

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

5 years agoTry to restore some clang test headers lost in r360291
Reid Kleckner [Wed, 8 May 2019 22:30:46 +0000 (22:30 +0000)]
Try to restore some clang test headers lost in r360291

I'm not sure why 'git llvm revert' removed them.

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

5 years agoRevert Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS compat...
Reid Kleckner [Wed, 8 May 2019 22:01:20 +0000 (22:01 +0000)]
Revert Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS compatibility.

This reverts r360271 (git commit a0933bd8ec1515167ea653f7ee788b8bbde27d51)

There are concerns on the review that this breaks EFI builds and that
the transitive includes (sal.h) are actually heavy enough that we might
care.

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

5 years agoInclude corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS
Mike Rice [Wed, 8 May 2019 17:15:21 +0000 (17:15 +0000)]
Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS
compatibility.  This allows some applications developed with MSVC to
compile with clang without any extra changes.

Fixes: llvm.org/PR40789
Differential Revision: https://reviews.llvm.org/D61646

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

5 years ago[OpenMP][Clang] Support for target math functions
Gheorghe-Teodor Bercea [Wed, 8 May 2019 15:52:33 +0000 (15:52 +0000)]
[OpenMP][Clang] Support for target math functions

Summary:
In this patch we propose a temporary solution to resolving math functions for the NVPTX toolchain, temporary until OpenMP variant is supported by Clang.

We intercept the inclusion of math.h and cmath headers and if we are in the OpenMP-NVPTX case, we re-use CUDA's math function resolution mechanism.

Authors:
@gtbercea
@jdoerfert

Reviewers: hfinkel, caomhin, ABataev, tra

Reviewed By: hfinkel, ABataev, tra

Subscribers: JDevlieghere, mgorny, guansong, cfe-commits, jdoerfert

Tags: #clang

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

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

5 years ago[ASTImporter] Fix inequivalence of unresolved exception spec
Gabor Marton [Wed, 8 May 2019 15:23:48 +0000 (15:23 +0000)]
[ASTImporter] Fix inequivalence of unresolved exception spec

Summary:
Structural equivalence of methods can falsely report false when the
exception specifier is unresolved (i.e unevaluated or not instantiated).

(This caused one assertion during bitcoin ctu-analysis.)

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

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

5 years ago[Sema][OpenCL] Make address space conversions a bit stricter.
Anastasia Stulova [Wed, 8 May 2019 14:23:49 +0000 (14:23 +0000)]
[Sema][OpenCL] Make address space conversions a bit stricter.

The semantics for converting nested pointers between address
spaces are not very well defined. Some conversions which do not
really carry any meaning only produce warnings, and in some cases
warnings hide invalid conversions, such as 'global int*' to
'local float*'!

This patch changes the logic in checkPointerTypesForAssignment
and checkAddressSpaceCast to fail properly on implicit conversions
that should definitely not be permitted. We also dig deeper into the
pointer types and warn on explicit conversions where the address
space in a nested pointer changes, regardless of whether the address
space is compatible with the corresponding pointer nesting level
on the destination type.

Fixes PR39674!

Patch by ebevhan (Bevin Hansson)!

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

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

5 years ago[clang-format] Fix the crash when formatting unsupported encodings
Owen Pan [Wed, 8 May 2019 14:11:12 +0000 (14:11 +0000)]
[clang-format] Fix the crash when formatting unsupported encodings

Fixes PR33946

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

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

5 years ago[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones
Owen Pan [Wed, 8 May 2019 13:49:17 +0000 (13:49 +0000)]
[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones

Also fix a typo for the SCSU byte order mark.

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

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

5 years agoAllow test to pass after 2030.
Aaron Ballman [Wed, 8 May 2019 13:42:44 +0000 (13:42 +0000)]
Allow test to pass after 2030.

Patch by Bernhard M. Wiedemann.

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

5 years agoAllow 'static' storage specifier on an out-of-line class member template declaration...
Aaron Ballman [Wed, 8 May 2019 13:24:36 +0000 (13:24 +0000)]
Allow 'static' storage specifier on an out-of-line class member template declaration in MSVCCompat mode.

Patch by Soumi Manna.

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

5 years ago[libclang] PR41649: Remove pointless duplicate flag. NFC.
Nikolai Kosjar [Wed, 8 May 2019 13:19:29 +0000 (13:19 +0000)]
[libclang] PR41649: Remove pointless duplicate flag. NFC.

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

5 years agoFix for the greendragon bots.
Leonard Chan [Wed, 8 May 2019 05:59:25 +0000 (05:59 +0000)]
Fix for the greendragon bots.

Adds extra checks for ObjC GC and Ownership.

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

5 years ago[Sema] Correct typos in return statements so the return types of 'auto' functions...
Sam McCall [Wed, 8 May 2019 05:49:42 +0000 (05:49 +0000)]
[Sema] Correct typos in return statements so the return types of 'auto' functions are always deduced.

Summary:
e.g.
  auto foo() {
    return no_such_thing; // Return value is a TypoExpr
  }
  using T = decltype(foo()); // Uh-oh, undeduced auto.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoFix buildbot break after r360195
Nemanja Ivanovic [Wed, 8 May 2019 02:03:32 +0000 (02:03 +0000)]
Fix buildbot break after r360195

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

5 years agoSplit ActOnCallExpr into an ActOnCallExpr to be called by the parser,
Richard Smith [Wed, 8 May 2019 01:36:36 +0000 (01:36 +0000)]
Split ActOnCallExpr into an ActOnCallExpr to be called by the parser,
and a BuildCallExpr to be called internally within Sema to build /
rebuild calls.

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

5 years ago[hip] Fix ambiguity from `>>>` of CUDA.
Michael Liao [Wed, 8 May 2019 00:52:33 +0000 (00:52 +0000)]
[hip] Fix ambiguity from `>>>` of CUDA.

Summary:
- For template arguments ending with `>>>`, we should cease lookahead
  and treat it as type-id firstly, so that deduction could work
  properly.

Reviewers: tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[COFF] Use COFF stubs for extern_weak functions
Reid Kleckner [Tue, 7 May 2019 23:06:21 +0000 (23:06 +0000)]
[COFF] Use COFF stubs for extern_weak functions

Summary:
A COFF stub indirects the reference to a symbol through memory. A
.refptr.$sym global variable pointer is created to refer to $sym.
Typically mingw uses these for external global variable declarations,
but we can use them for weak function declarations as well.

Updates the dso_local classification to add a special case for
extern_weak symbols on COFF in both clang and LLVM.

Fixes PR37598

Reviewers: smeenai, mstorsjo

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[analyzer] Fix a crash when doing RVO from within blocks.
Artem Dergachev [Tue, 7 May 2019 22:33:13 +0000 (22:33 +0000)]
[analyzer] Fix a crash when doing RVO from within blocks.

When looking for the location context of the call site, unwrap block invocation
contexts because they are attached to the current AnalysisDeclContext
while what we need is the previous AnalysisDeclContext.

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

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

5 years ago-frewrite-imports: Add support for wildcard rules in umbrella modules with
David Blaikie [Tue, 7 May 2019 21:38:51 +0000 (21:38 +0000)]
-frewrite-imports: Add support for wildcard rules in umbrella modules with

This trips over a few other limitations, but in the interests of incremental development I'm starting here & I'll look at the issues with -verify and filesystem checks (the fact that the behavior depends on the existence of a 'foo' directory even though it shouldn't need it), etc.

Reviewers: rsmith

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

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

5 years agoRevert "[OpenMP][Clang] Support for target math functions"
Jonas Devlieghere [Tue, 7 May 2019 21:08:15 +0000 (21:08 +0000)]
Revert "[OpenMP][Clang] Support for target math functions"

This commit appears to be breaking stage-2 builds on GreenDragon. The
OpenMP wrappers for cmath and math.h are copied into the root of the
resource directory and cause a cyclic dependency in module 'Darwin':
Darwin -> std -> Darwin. This blows up when CMake is testing for modules
support and breaks all stage 2 module builds, including the ThinLTO bot
and all LLDB bots.

CMake Error at cmake/modules/HandleLLVMOptions.cmake:497 (message):
  LLVM_ENABLE_MODULES is not supported by this compiler

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

5 years ago[ASTImporter] Corrected type of integer constant in a test.
Balazs Keri [Tue, 7 May 2019 14:53:04 +0000 (14:53 +0000)]
[ASTImporter] Corrected type of integer constant in a test.

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

5 years agoAdd an explicit triple to this test to hopefully appease the build bots.
Aaron Ballman [Tue, 7 May 2019 14:40:37 +0000 (14:40 +0000)]
Add an explicit triple to this test to hopefully appease the build bots.

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