]> granicus.if.org Git - clang/log
clang
5 years ago[OPENMP][NVPTX]Reduce memory usage in target region.
Alexey Bataev [Fri, 12 Oct 2018 20:19:59 +0000 (20:19 +0000)]
[OPENMP][NVPTX]Reduce memory usage in target region.

Additional reduction of the global memory usage in the target regions
without parallel regions.

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

5 years ago[MinGW] Allow using LTO when lld is used as linker
Martin Storsjo [Fri, 12 Oct 2018 20:15:51 +0000 (20:15 +0000)]
[MinGW] Allow using LTO when lld is used as linker

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

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

5 years ago[python] [tests] Re-add once again, this time without Windows
Michal Gorny [Fri, 12 Oct 2018 20:03:54 +0000 (20:03 +0000)]
[python] [tests] Re-add once again, this time without Windows

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

5 years agoRevert rL344365: [tests] Readd Python binding tests to check-all
Simon Pilgrim [Fri, 12 Oct 2018 19:46:40 +0000 (19:46 +0000)]
Revert rL344365: [tests] Readd Python binding tests to check-all

Windows buildbots are still not happy

Now that both issues found out during the last iteration have been
fixed, reenable the Python binding tests on buildbots.
........

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

5 years ago[clang-format] Fix BraceWrapping AfterFunction for ObjC methods
Ben Hamilton [Fri, 12 Oct 2018 19:43:01 +0000 (19:43 +0000)]
[clang-format] Fix BraceWrapping AfterFunction for ObjC methods

Summary:
> clang-format --version
> clang-format version 7.0.0 (tags/RELEASE_700/final)
> echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'
```
@implementation Foo
- (void)foo:(id)bar {
}
@end
```

with patch:

> bin/clang-format --version
> clang-format version 8.0.0 (trunk 344285)
> echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |bin/clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}'
```
@implementation Foo
- (void)foo:(id)bar
{
}
@end
```

Contributed by hultman@.

Reviewers: benhamilton, jolesiak, klimek, Wizard

Reviewed By: benhamilton

Subscribers: cfe-commits

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

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

5 years agoFix a clang::driver::ArgStringList usage I missed in rL344398. NFCI.
Simon Pilgrim [Fri, 12 Oct 2018 19:14:43 +0000 (19:14 +0000)]
Fix a clang::driver::ArgStringList usage I missed in rL344398. NFCI.

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

5 years agoConsistently make llvm::opt::ArgStringList usage explicit to try and appease MSVC...
Simon Pilgrim [Fri, 12 Oct 2018 18:55:36 +0000 (18:55 +0000)]
Consistently make llvm::opt::ArgStringList usage explicit to try and appease MSVC 2015 buildbots. NFCI.

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

5 years agoRevert r344375 "[Driver] check for exit code from SIGPIPE"
Reid Kleckner [Fri, 12 Oct 2018 18:08:11 +0000 (18:08 +0000)]
Revert r344375 "[Driver] check for exit code from SIGPIPE"

This doesn't build on Windows.

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

5 years ago[Doc] fix second error in UsersManual
Jonas Toth [Fri, 12 Oct 2018 17:57:18 +0000 (17:57 +0000)]
[Doc] fix second error in UsersManual

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

5 years ago[Doc] fix BB, add code-block type
Jonas Toth [Fri, 12 Oct 2018 17:44:01 +0000 (17:44 +0000)]
[Doc] fix BB, add code-block type

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

5 years ago[Driver] check for exit code from SIGPIPE
Nick Desaulniers [Fri, 12 Oct 2018 17:22:46 +0000 (17:22 +0000)]
[Driver] check for exit code from SIGPIPE

Summary:
D53000 adds a special exit code for SIGPIPE (writing to a closed
reader), and rather than print a fatal warning, skips printing the
error.  This can be seen commonly from piping into head, tee, or
split.

Fixes PR25349, rdar://problem/14285346, b/77310947.

Reviewers: jfb

Reviewed By: jfb

Subscribers: cfe-commits, thakis, srhines

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

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

5 years ago[CodeGen] Handle extern references to OBJC_CLASS_$_*
Erik Pilkington [Fri, 12 Oct 2018 17:22:10 +0000 (17:22 +0000)]
[CodeGen] Handle extern references to OBJC_CLASS_$_*

Some ObjC users declare a extern variable named OBJC_CLASS_$_Foo, then use it's
address as a Class. I.e., one could define isInstanceOfF:

BOOL isInstanceOfF(id c) {
  extern void OBJC_CLASS_$_F;
  return [c class] == (Class)&OBJC_CLASS_$_F;
}

This leads to asserts in clang CodeGen if there is an @implementation of F in
the same TU as an instance of this pattern, because CodeGen assumes that a
variable named OBJC_CLASS_$_* has the right type. This commit fixes the problem
by RAUWing the old (incorrectly typed) global with a new global, then removing
the old global.

rdar://45077269

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

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

5 years ago[Driver] Add defaults for Android ARM FPUs.
Dan Albert [Fri, 12 Oct 2018 17:06:31 +0000 (17:06 +0000)]
[Driver] Add defaults for Android ARM FPUs.

Summary:
Android mandates that devices have at least vfpv3-d16 until
Marshmallow and NEON after that. Still honor the user's decision, but
raise the defaults for Android targets.

Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith

Reviewed By: peter.smith

Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits

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

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

5 years ago[tests] Readd Python binding tests to check-all
Michal Gorny [Fri, 12 Oct 2018 16:55:44 +0000 (16:55 +0000)]
[tests] Readd Python binding tests to check-all

Now that both issues found out during the last iteration have been
fixed, reenable the Python binding tests on buildbots.

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

5 years ago[python] [tests] Remove cdb lookup failure test
Michal Gorny [Fri, 12 Oct 2018 16:55:39 +0000 (16:55 +0000)]
[python] [tests] Remove cdb lookup failure test

Remove the test checking for compilation db lookup failure.
Since r342228, JSONCompilationDatabasePlugin infers compile commands for
missing files, therefore making the lookup always succeed.

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

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

5 years agoMake YAML quote forward slashes.
Zachary Turner [Fri, 12 Oct 2018 16:31:20 +0000 (16:31 +0000)]
Make YAML quote forward slashes.

If you have the string /usr/bin, prior to this patch it would not
be quoted by our YAML serializer.  But a string like C:\src would
be, due to the presence of a backslash.  This makes the quoting
rules of basically every single file path different depending on
the path syntax (posix vs. Windows).

While technically not required by the YAML specification to quote
forward slashes, when the behavior of paths is inconsistent it
makes it difficult to portably write FileCheck lines that will
work with either kind of path.

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

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

5 years agoRevert "Make YAML quote forward slashes."
Zachary Turner [Fri, 12 Oct 2018 16:31:08 +0000 (16:31 +0000)]
Revert "Make YAML quote forward slashes."

This reverts commit b86c16ad8c97dadc1f529da72a5bb74e9eaed344.

This is being reverted because I forgot to write a useful
commit message, so I'm going to resubmit it with an actual
commit message.

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

5 years agoMake YAML quote forward slashes.
Zachary Turner [Fri, 12 Oct 2018 16:24:09 +0000 (16:24 +0000)]
Make YAML quote forward slashes.

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

5 years ago[OPENMP][NVPTX]Reduce memory usage in orphaned functions.
Alexey Bataev [Fri, 12 Oct 2018 16:04:20 +0000 (16:04 +0000)]
[OPENMP][NVPTX]Reduce memory usage in orphaned functions.

if the function has globalized variables and called in context of
target/teams/distribute regions, it does not need to globalize 32
copies of the same variables for memory coalescing, it is enough to
have just one copy, because there is parallel region.
Patch does this by adding call for `__kmpc_parallel_level` function and
checking its return value. If the code sees that the parallel level is
0, then only one variable is allocated, not 32.

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

5 years agoFix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.
Simon Pilgrim [Fri, 12 Oct 2018 15:16:25 +0000 (15:16 +0000)]
Fix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.

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

5 years agoRemove top-level using declaration from header files, as these aliases leak.
Sam McCall [Fri, 12 Oct 2018 12:21:29 +0000 (12:21 +0000)]
Remove top-level using declaration from header files, as these aliases leak.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

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

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

5 years ago[Tooling] Expose ExecutorName option.
Eric Liu [Fri, 12 Oct 2018 11:47:36 +0000 (11:47 +0000)]
[Tooling] Expose ExecutorName option.

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

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Fri, 12 Oct 2018 10:34:03 +0000 (10:34 +0000)]
Fix Wdocumentation warning. NFCI.

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

5 years ago[analyzer] Fix a bug in unexplored_first_location_queue iteration order.
George Karpenkov [Fri, 12 Oct 2018 00:52:13 +0000 (00:52 +0000)]
[analyzer] Fix a bug in unexplored_first_location_queue iteration order.

Pointed out by Artem in post-commit review for https://reviews.llvm.org/D53058

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

5 years agoUpdate user's manual documentation of profile remapping file to match
Richard Smith [Thu, 11 Oct 2018 23:48:11 +0000 (23:48 +0000)]
Update user's manual documentation of profile remapping file to match
llvm-cxxmap documentation.

Add a hint as to how to perform off-line profile data remapping.

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

5 years ago[analyzer] Experiment with an iteration order only based on location, and not using...
George Karpenkov [Thu, 11 Oct 2018 22:59:59 +0000 (22:59 +0000)]
[analyzer] Experiment with an iteration order only based on location, and not using the stack frame

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

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

5 years ago[analyzer] Avoid unneeded invalidation in RetainCountChecker
George Karpenkov [Thu, 11 Oct 2018 22:59:38 +0000 (22:59 +0000)]
[analyzer] Avoid unneeded invalidation in RetainCountChecker

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

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

5 years ago[analyzer] Retain count checker for OSObject: recognize OSDynamicCast
George Karpenkov [Thu, 11 Oct 2018 22:59:16 +0000 (22:59 +0000)]
[analyzer] Retain count checker for OSObject: recognize OSDynamicCast

For now, tresting the cast as a no-op, and disregarding the case where
the output becomes null due to the type mismatch.

rdar://45174557

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

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

5 years agoRevert "[Driver] Default Android toolchains to libc++."
Dan Albert [Thu, 11 Oct 2018 21:28:42 +0000 (21:28 +0000)]
Revert "[Driver] Default Android toolchains to libc++."

Breaks some of the Android bots because they aren't expecting to need
to explicitly set -stdlib.

This reverts commit 031072f5048654b01a40f639633de1ff4e2f3dc8.

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

5 years ago[Driver] Default Android toolchains to libc++.
Dan Albert [Thu, 11 Oct 2018 20:58:43 +0000 (20:58 +0000)]
[Driver] Default Android toolchains to libc++.

Reviewers: srhines, pirama, EricWF

Reviewed By: srhines

Subscribers: cfe-commits

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

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

5 years ago[Driver] Default to `-z now` and `-z relro` on Android.
Dan Albert [Thu, 11 Oct 2018 20:57:54 +0000 (20:57 +0000)]
[Driver] Default to `-z now` and `-z relro` on Android.

Summary:
RTLD_LAZY is not supported on Android (though failing to use `-z now`
will work since it is assumed by the loader).

RelRO is required.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

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

5 years ago[Driver] Fix --hash-style choice for Android.
Dan Albert [Thu, 11 Oct 2018 20:39:32 +0000 (20:39 +0000)]
[Driver] Fix --hash-style choice for Android.

Summary:
Android supports GNU style hashes as of Marshmallow, so we should be
generating both styles for pre-M targets and GNU hashes for newer
targets.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

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

5 years ago[python] [tests] Fix calling tests on Windows
Michal Gorny [Thu, 11 Oct 2018 20:26:55 +0000 (20:26 +0000)]
[python] [tests] Fix calling tests on Windows

Fix passing arguments to the Python test command to use 'env' builtin
CMake command, in order to fix compatibility with Windows.

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

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

5 years ago[HIP] Remove unused irif bitcode from test
Aaron Enye Shi [Thu, 11 Oct 2018 19:52:32 +0000 (19:52 +0000)]
[HIP] Remove unused irif bitcode from test

This is part of previous commit [HIP] Replace irif library with hip.amdgcn.bc

Reviewers: yaxunl

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

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

5 years ago[HIP] Replace irif library with hip.amdgcn.bc
Aaron Enye Shi [Thu, 11 Oct 2018 19:41:54 +0000 (19:41 +0000)]
[HIP] Replace irif library with hip.amdgcn.bc

No longer use irif amdgcn library, instead we will use the previous fence functions from new hip.amdgcn.bc bitcode library. Update hip-device-libs.hip test as well.

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

5 years agoRevert "clang-cl: Add /showFilenames option (PR31957)"
Sean Fertile [Thu, 11 Oct 2018 18:40:35 +0000 (18:40 +0000)]
Revert "clang-cl: Add /showFilenames option (PR31957)"

This reverts https://reviews.llvm.org/rL344234 which is causing failures on
several bots due to invalid llvm.linker.options.

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

5 years ago[OPENMP][NVPTX]Reduce memory use for globalized vars in
Alexey Bataev [Thu, 11 Oct 2018 18:30:31 +0000 (18:30 +0000)]
[OPENMP][NVPTX]Reduce memory use for globalized vars in
target/teams/distribute regions.

Previously introduced globalization scheme that uses memory coalescing
scheme may increase memory usage fr the variables that are devlared in
target/teams/distribute contexts. We don't need 32 copies of such
variables, just 1. Patch reduces memory use in this case.

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

5 years agoRevert "[Lex] TokenConcatenation now takes const Preprocessor"
Eric Liu [Thu, 11 Oct 2018 17:50:04 +0000 (17:50 +0000)]
Revert "[Lex] TokenConcatenation now takes const Preprocessor"

This reverts commit r344262. This was an unintentional commit.

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

5 years agoclang-cl: set output of lit-test to a tmp file after r344234
Eric Liu [Thu, 11 Oct 2018 17:49:20 +0000 (17:49 +0000)]
clang-cl: set output of lit-test to a tmp file after r344234

Some test frameworks do not allow output file in CWD.

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

5 years ago[python] [tests] Retab CMakeLists.txt for consistency (NFC)
Michal Gorny [Thu, 11 Oct 2018 17:45:35 +0000 (17:45 +0000)]
[python] [tests] Retab CMakeLists.txt for consistency (NFC)

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

5 years ago[Lex] TokenConcatenation now takes const Preprocessor
Eric Liu [Thu, 11 Oct 2018 17:35:29 +0000 (17:35 +0000)]
[Lex] TokenConcatenation now takes const Preprocessor

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

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

5 years ago[tests] Remove Python tests from check-all due to breakage
Michal Gorny [Thu, 11 Oct 2018 17:25:05 +0000 (17:25 +0000)]
[tests] Remove Python tests from check-all due to breakage

Remove the Python tests from default target in order to fix two
kinds of breakage uncovered by enabling them: one failing test on Linux,
and problem with the test command on Windows.  Both to be addressed
in followup revisions.

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

5 years agoImprove -Wshadow warnings with enumerators.
Aaron Ballman [Thu, 11 Oct 2018 16:40:18 +0000 (16:40 +0000)]
Improve -Wshadow warnings with enumerators.

Addresses PR24718 by checking for enumerators that shadow other enumerators. Catches issues like:

enum E1{e1};
void f(void) {
  enum E2{e1};
}

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

5 years ago[tests] Include Python binding tests in CMake rules
Michal Gorny [Thu, 11 Oct 2018 16:32:54 +0000 (16:32 +0000)]
[tests] Include Python binding tests in CMake rules

Add a new CMake rule check-clang-python to run the Python bindings'
test suite, and include it in check-all.

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

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

5 years agoSome improvements to the OpenBSD driver.
Brad Smith [Thu, 11 Oct 2018 16:13:44 +0000 (16:13 +0000)]
Some improvements to the OpenBSD driver.

- OpenBSD has switched to compiler_rt / libcxx
- Fix sysroot and lib path handling
- Some cleaning up

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

5 years agoAdd support for 'dynamic_allocators' clause on 'requires' directive. Differential...
Patrick Lyster [Thu, 11 Oct 2018 14:41:10 +0000 (14:41 +0000)]
Add support for 'dynamic_allocators' clause on 'requires' directive. Differential Revision: https://reviews.llvm.org/D53079

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

5 years ago[Tooling] Move CompilationDatabasePlugin to the Registry header, where it's useful...
Sam McCall [Thu, 11 Oct 2018 13:42:53 +0000 (13:42 +0000)]
[Tooling] Move CompilationDatabasePlugin to the Registry header, where it's useful. NFC

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

5 years ago[Sema][OpenCL] Improve diagnostics for not viable overloadable function candidates
Andrew Savonichev [Thu, 11 Oct 2018 13:35:34 +0000 (13:35 +0000)]
[Sema][OpenCL] Improve diagnostics for not viable overloadable function candidates

Summary:
Allowed extension name (that ought to be disabled) printing in the note message.

This diagnostic was proposed here: https://reviews.llvm.org/D51341

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: cfe-commits, asavonic, bader

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

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

5 years agoRevert r344241 as it broke multiple bots.
Aaron Ballman [Thu, 11 Oct 2018 12:57:29 +0000 (12:57 +0000)]
Revert r344241 as it broke multiple bots.

http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/10814
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20613

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

5 years ago[analyzer][UninitializedObjectChecker] Reports Loc fields pointing to themselves
Kristof Umann [Thu, 11 Oct 2018 11:58:53 +0000 (11:58 +0000)]
[analyzer][UninitializedObjectChecker] Reports Loc fields pointing to themselves

I've added a new functionality, the checker is now able to
detect and report fields pointing to themselves. I figured
this would fit well into the checker as there's no reason
for a pointer to point to itself instead of being nullptr.

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

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

5 years ago[tests] Include Python binding tests in CMake rules
Michal Gorny [Thu, 11 Oct 2018 11:58:14 +0000 (11:58 +0000)]
[tests] Include Python binding tests in CMake rules

Add a new CMake rule check-clang-python to run the Python bindings'
test suite, and include it in check-all.

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

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

5 years ago[python] [tests] Support overriding library path via environment
Michal Gorny [Thu, 11 Oct 2018 11:58:07 +0000 (11:58 +0000)]
[python] [tests] Support overriding library path via environment

Support a new CLANG_LIBRARY_PATH environment variable for the Python
binding tests.  This variable can be used to force the bindings to load
libclang.* from a specific directory.

I plan to use this when integrating Python binding tests with the CMake
build system.  Currently, those tests load libclang.so from default
search paths, so I would have to rely on platform-specific mechanics
such as LD_LIBRARY_PATH.  Instead of copying the whole logic necessary
to handle platform differences into yet another place, it's easier to
just add a dedicated variable for this purpose.

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

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

5 years agoclang-cl: Add /showFilenames option (PR31957)
Hans Wennborg [Thu, 11 Oct 2018 10:04:15 +0000 (10:04 +0000)]
clang-cl: Add /showFilenames option (PR31957)

Add a /showFilenames option for users who want clang to echo the
currently compiled filename. MSVC does this echoing by default, and it's
useful for showing progress in build systems that doesn't otherwise
provide any progress report, such as MSBuild.

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

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

5 years ago[clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed...
Roman Lebedev [Thu, 11 Oct 2018 09:09:50 +0000 (09:09 +0000)]
[clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks

Summary:
As per IRC disscussion, it seems we really want to have more fine-grained `-fsanitize=implicit-integer-truncation`:
* A check when both of the types are unsigned.
* Another check for the other cases (either one of the types is signed, or both of the types is signed).

This is clang part.
Compiler-rt part is D50902.

Reviewers: rsmith, vsk, Sanitizers

Reviewed by: rsmith

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

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

5 years ago[WebAssembly] Saturating float-to-int builtins
Thomas Lively [Thu, 11 Oct 2018 00:07:55 +0000 (00:07 +0000)]
[WebAssembly] Saturating float-to-int builtins

Summary: Depends on D53007 and D53004.

Reviewers: aheejin, dschuff

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

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

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

5 years agoUpdate documentation to indicate that profile remapping support is only
Richard Smith [Wed, 10 Oct 2018 23:33:18 +0000 (23:33 +0000)]
Update documentation to indicate that profile remapping support is only
implemented for the new pass manager so far.

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

5 years agoAdd a flag to remap manglings when reading profile data information.
Richard Smith [Wed, 10 Oct 2018 23:13:35 +0000 (23:13 +0000)]
Add a flag to remap manglings when reading profile data information.

This can be used to preserve profiling information across codebase
changes that have widespread impact on mangled names, but across which
most profiling data should still be usable. For example, when switching
from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
or even from a 32-bit to a 64-bit build.

The user can provide a remapping file specifying parts of mangled names
that should be treated as equivalent (eg, std::__1 should be treated as
equivalent to std::__cxx11), and profile data will be treated as
applying to a particular function if its name is equivalent to the name
of a function in the profile data under the provided equivalences. See
the documentation change for a description of how this is configured.

Remapping is supported for both sample-based profiling and instruction
profiling. We do not support remapping indirect branch target
information, but all other profile data should be remapped
appropriately.

Support is only added for the new pass manager. If someone wants to also
add support for this for the old pass manager, doing so should be
straightforward.

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

5 years ago[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals
Reid Kleckner [Wed, 10 Oct 2018 21:59:56 +0000 (21:59 +0000)]
[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals

Summary:
In r340386 we added code to give static locals in inline functions
default visibility. Instead, we should use the "default" visibility
passed on the command line, which could be hidden or protected, as GCC
does.

Some code bases use both -fvisibility=hidden and
-fvisibility-inlines-hidden to hide inline functions of classes that are
explicitly marked with default visibility.

Fixes PR39236

Reviewers: hans, thakis

Subscribers: eraman, llvm-commits

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

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

5 years ago[clang] Fix failing attribute test on Windows
Louis Dionne [Wed, 10 Oct 2018 17:37:37 +0000 (17:37 +0000)]
[clang] Fix failing attribute test on Windows

The test added in r344146 was failing because the ABI on Windows is
different, and that test includes ABI-specific details. The test now
harcodes which ABI to use so we can rely on those details.

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

5 years ago[Sema] Fix a multiple definition bug with friends and templates
Erik Pilkington [Wed, 10 Oct 2018 17:17:51 +0000 (17:17 +0000)]
[Sema] Fix a multiple definition bug with friends and templates

The problem was that MergeFunctionDecl sometimes needs the injected template
arguments of a FunctionTemplateDecl, but is called before adding the new
template to the redecl chain. This leads to multiple common pointers in the same
redecl chain, each with their own identical instantiation. Fix this by merging
the the common state before inserting the new template into the redecl chain.

rdar://44810129

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

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

5 years ago[CodeGenCXX] Treat 'this' as noalias in constructors
Anton Bikineev [Wed, 10 Oct 2018 16:14:51 +0000 (16:14 +0000)]
[CodeGenCXX] Treat 'this' as noalias in constructors

This is currently a clang extension and a resolution
of the defect report in the C++ Standard.

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

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

5 years ago[OpenCL] Fixed address space cast in C style cast of C++ parsing
Anastasia Stulova [Wed, 10 Oct 2018 16:05:22 +0000 (16:05 +0000)]
[OpenCL] Fixed address space cast in C style cast of C++ parsing

C style cast in OpenCL C++ was ignoring the address space
conversions from OpenCL C and as a result accepting incorrect
code to compile. This commit adds special function for checking
correctness of address spaces that is shared between C and C++
casts.

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

5 years ago[Hexagon] Use GetLinkerPath instead of hard-coded string.
Sid Manning [Wed, 10 Oct 2018 15:37:03 +0000 (15:37 +0000)]
[Hexagon] Use GetLinkerPath instead of hard-coded string.

Add GetLinkerPath and set the default to "hexagon-link".
Use GetLinkerPath instead of the hard-coded string.

This change will allow -fuse-ld to function correctly.

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

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

5 years ago[clang] Properly apply attributes on explicit instantiations of static data members
Louis Dionne [Wed, 10 Oct 2018 15:32:29 +0000 (15:32 +0000)]
[clang] Properly apply attributes on explicit instantiations of static data members

Summary: https://llvm.org/PR39118

Reviewers: aaron.ballman, rnk

Subscribers: dexonsmith, cfe-commits

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

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

5 years agoLift VFS from clang to llvm (NFC)
Jonas Devlieghere [Wed, 10 Oct 2018 13:27:25 +0000 (13:27 +0000)]
Lift VFS from clang to llvm (NFC)

This patch moves the virtual file system form clang to llvm so it can be
used by more projects.

Concretely the patch:
 - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support.
 - Moves the corresponding unit test from clang to llvm.
 - Moves the vfs namespace from clang::vfs to llvm::vfs.
 - Formats the lines affected by this change, mostly this is the result of
   the added llvm namespace.

RFC on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html

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

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

5 years ago[CodeComplete] Fix crash when completing params function declarations.
Sam McCall [Wed, 10 Oct 2018 10:51:48 +0000 (10:51 +0000)]
[CodeComplete] Fix crash when completing params function declarations.

Summary:
In a decl like `int AA(BB cc)` where BB isn't defined, we end up trying to
parse `BB cc` as an expression (vexing parse) and end up triggering the
parser's "recovery-in-function" completion with no actual function
scope.

This patch avoids the assumption that such a scope exists in this context.

Reviewers: kadircet

Subscribers: cfe-commits

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

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

5 years ago[MinGW] Fix passing a sanitizer lib name as dependent lib
Martin Storsjo [Wed, 10 Oct 2018 09:01:00 +0000 (09:01 +0000)]
[MinGW] Fix passing a sanitizer lib name as dependent lib

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

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

5 years ago[X86] Remove FeatureRTM from Skylake processor list
Craig Topper [Wed, 10 Oct 2018 07:43:45 +0000 (07:43 +0000)]
[X86] Remove FeatureRTM from Skylake processor list

Summary:
There are a LOT of Skylakes and later without TSX-NI. Examples:
- SKL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3-20-GHz-
- KBL: https://ark.intel.com/products/97540/Intel-Core-i7-7560U-Processor-4M-Cache-up-to-3-80-GHz-
- KBL-R: https://ark.intel.com/products/149091/Intel-Core-i7-8565U-Processor-8M-Cache-up-to-4-60-GHz-
- CNL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3_20-GHz

This feature seems to be present only on high-end desktop and server
chips (I can't find any SKX without). This commit leaves it disabled
for all processors, but can be re-enabled for specific builds with
-mrtm.

Matches https://reviews.llvm.org/D53041

Patch by Thiago Macieira

Reviewers: erichkeane, craig.topper

Reviewed By: craig.topper

Subscribers: lebedev.ri, cfe-commits

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

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

5 years agoExprConstant: Make __builtin_object_size use EM_IgnoreSideEffects.
James Y Knight [Wed, 10 Oct 2018 02:53:43 +0000 (02:53 +0000)]
ExprConstant: Make __builtin_object_size use EM_IgnoreSideEffects.

And, since EM_OffsetFold is now unused, remove it.

While builtin_object_size intends to ignore the presence of
side-effects in its argument, the EM_OffsetFold mode was NOT
configured to ignore side-effects. Rather it was effectively identical
to EM_ConstantFold -- its explanatory comment
notwithstanding.

However, currently, keepEvaluatingAfterSideEffect() is not always
honored -- sometimes evaluation continues despite it returning
false. Therefore, since the b_o_s code was only checking the return
value from evaluation, and not additionally checking the
HasSideEffects flag, side-effects _were_ in many cases actually being
ignored.

This change is a prerequisite cleanup towards fixing that issue.

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

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

5 years ago[Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from...
Erik Pilkington [Wed, 10 Oct 2018 00:40:50 +0000 (00:40 +0000)]
[Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

These two diagnostics are noisy, so its reasonable for users to opt-out of them
when -Wconversion is enabled.

rdar://45058981

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

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

5 years agoclang: Allow ifunc resolvers to accept arguments
Ed Maste [Wed, 10 Oct 2018 00:34:17 +0000 (00:34 +0000)]
clang: Allow ifunc resolvers to accept arguments

When ifunc support was added to Clang (r265917) it did not allow
resolvers to take function arguments.  This was based on GCC's
documentation, which states resolvers return a pointer and take no
arguments.

However, GCC actually allows resolvers to take arguments, and glibc (on
non-x86 platforms) and FreeBSD (on x86 and arm64) pass some CPU
identification information as arguments to ifunc resolvers.  I believe
GCC's documentation is simply incorrect / out-of-date.

FreeBSD already removed the prohibition in their in-tree Clang copy.

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

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

5 years ago[Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."
Fangrui Song [Wed, 10 Oct 2018 00:15:33 +0000 (00:15 +0000)]
[Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."

Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009

Reviewers: rupprecht, alexshap, jhenderson

Reviewed By: rupprecht

Subscribers: cfe-commits

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

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

5 years agoPR39231: fix null dereference when diagnosing deduction failure due to
Richard Smith [Tue, 9 Oct 2018 18:49:22 +0000 (18:49 +0000)]
PR39231: fix null dereference when diagnosing deduction failure due to
conflicting values for a non-type pack.

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

5 years ago[CUDA][HIP] Fix ShouldDeleteSpecialMember for inherited constructors
Yaxun Liu [Tue, 9 Oct 2018 15:53:14 +0000 (15:53 +0000)]
[CUDA][HIP] Fix ShouldDeleteSpecialMember for inherited constructors

ShouldDeleteSpecialMember is called upon inherited constructors.
It calls inferCUDATargetForImplicitSpecialMember.

Normally the special member enum passed to ShouldDeleteSpecialMember
matches the constructor. However this is not true when inherited
constructor is passed, where DefaultConstructor is passed to treat
the inherited constructor as DefaultConstructor. However
inferCUDATargetForImplicitSpecialMember expects the special
member enum argument to match the constructor, which results
in assertion when this expection is not satisfied.

This patch checks whether the constructor is inherited. If true it will
get the real special member enum for the constructor and pass it
to inferCUDATargetForImplicitSpecialMember.

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

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

5 years ago[OPENMP][NVPTX] Support memory coalescing for globalized variables.
Alexey Bataev [Tue, 9 Oct 2018 14:49:00 +0000 (14:49 +0000)]
[OPENMP][NVPTX] Support memory coalescing for globalized variables.

Added support for memory coalescing for better performance for
globalized variables. From now on all the globalized variables are
represented as arrays of 32 elements and each thread accesses these
elements using `tid & 31` as index.

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

5 years ago[analyzer][www] Add more useful links
Kristof Umann [Tue, 9 Oct 2018 10:05:08 +0000 (10:05 +0000)]
[analyzer][www] Add more useful links

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

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

5 years ago[ASTMatcher] Add missing imaginaryLiteral
Stephen Kelly [Tue, 9 Oct 2018 08:44:28 +0000 (08:44 +0000)]
[ASTMatcher] Add missing imaginaryLiteral

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

5 years agoRemove non-existant typeloc matchers from documentation
Stephen Kelly [Tue, 9 Oct 2018 08:24:18 +0000 (08:24 +0000)]
Remove non-existant typeloc matchers from documentation

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

5 years agoRegenerate AST Matcher docs
Stephen Kelly [Tue, 9 Oct 2018 08:24:11 +0000 (08:24 +0000)]
Regenerate AST Matcher docs

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

5 years agoFix indentation
Stephen Kelly [Tue, 9 Oct 2018 08:24:06 +0000 (08:24 +0000)]
Fix indentation

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

5 years ago[analyzer] Support Reinitializes attribute in MisusedMovedObject check
Gabor Horvath [Tue, 9 Oct 2018 07:28:57 +0000 (07:28 +0000)]
[analyzer] Support Reinitializes attribute in MisusedMovedObject check

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

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

5 years ago[Index] Use locations to uniquify function-scope BindingDecl USR
Fangrui Song [Tue, 9 Oct 2018 01:02:56 +0000 (01:02 +0000)]
[Index] Use locations to uniquify function-scope BindingDecl USR

Summary:
This makes BindingDecl's of the same name have different USRs, so that references can be correctly attributed.

    int a[1] = {};
    { auto [x] = a; x; }
    { auto [x] = a; x; }

Reviewers: akyrtzi, arphaman, rsmith, hokein

Reviewed By: hokein

Subscribers: cfe-commits

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

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

5 years ago[WebAssembly][NFC] Rename test functions for builtins
Thomas Lively [Tue, 9 Oct 2018 00:42:13 +0000 (00:42 +0000)]
[WebAssembly][NFC] Rename test functions for builtins

Reviewers: aheejin, dschuff

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

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

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

5 years agoIntroduce code_model macros
Ali Tamur [Mon, 8 Oct 2018 22:25:20 +0000 (22:25 +0000)]
Introduce code_model macros

Summary:
gcc defines macros such as __code_model_small_ based on the user passed command line flag -mcmodel. clang accepts a flag with the same name and similar effects, but does not generate any macro that the user can use. This cl narrows the gap between gcc and clang behaviour.

However, achieving full compatibility with gcc is not trivial: The set of valid values for mcmodel in gcc and clang are not equal. Also, gcc defines different macros for different architectures. In this cl, we only tackle an easy part of the problem and define the macro only for x64 architecture. When the user does not specify a mcmodel, the macro for small code model is produced, as is the case with gcc.

Reviewers: compnerd, MaskRay

Reviewed By: MaskRay

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[coro]Pass rvalue reference for named local variable to return_value
Brian Gesiak [Mon, 8 Oct 2018 03:08:39 +0000 (03:08 +0000)]
[coro]Pass rvalue reference for named local variable to return_value

Summary:
Addressing https://bugs.llvm.org/show_bug.cgi?id=37265.

Implements [class.copy]/33 of coroutines TS.

When the criteria for elision of a copy/move operation are met, but not
for an exception-declaration, and the object to be copied is designated by an
lvalue, or when the expression in a return or co_return statement is a
(possibly parenthesized) id-expression that names an object with automatic
storage duration declared in the body or parameter-declaration-clause of the
innermost enclosing function or lambda-expression, overload resolution to select
the constructor for the copy or the return_value overload to call is first
performed as if the object were designated by an rvalue.

Patch by Tanoy Sinha!

Reviewers: modocache, GorNishanov

Reviewed By: modocache, GorNishanov

Subscribers: cfe-commits

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

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

5 years agoWdocumentation fix
Simon Pilgrim [Sat, 6 Oct 2018 11:12:59 +0000 (11:12 +0000)]
Wdocumentation fix

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

5 years agoThread safety analysis: Handle conditional expression in getTrylockCallExpr
Aaron Puchert [Sat, 6 Oct 2018 01:09:28 +0000 (01:09 +0000)]
Thread safety analysis: Handle conditional expression in getTrylockCallExpr

Summary:
We unwrap conditional expressions containing try-lock functions.

Additionally we don't acquire on conditional expression branches, since
that is usually not helpful. When joining the branches we would almost
certainly get a warning then.

Hopefully fixes an issue that was raised in D52398.

Reviewers: aaron.ballman, delesley, hokein

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[COFF, ARM64] Add _InterlockedAdd intrinsic
Mandeep Singh Grang [Fri, 5 Oct 2018 21:57:41 +0000 (21:57 +0000)]
[COFF, ARM64] Add _InterlockedAdd intrinsic

Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma

Reviewed By: efriedma

Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits

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

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

5 years agoEmit CK_NoOp casts in C mode, not just C++.
James Y Knight [Fri, 5 Oct 2018 21:53:51 +0000 (21:53 +0000)]
Emit CK_NoOp casts in C mode, not just C++.

Previously, it had been using CK_BitCast even for casts that only
change const/restrict/volatile. Now it will use CK_Noop where
appropriate.

This is an alternate solution to r336746.

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

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

5 years ago[llvm-nm] Write "no symbol" output to stderr
Petr Hosek [Fri, 5 Oct 2018 21:10:03 +0000 (21:10 +0000)]
[llvm-nm] Write "no symbol" output to stderr

This matches the output of binutils' nm and ensures that any scripts
or tools that use nm and expect empty output in case there no symbols
don't break.

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

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

5 years ago[DebugInfo] Add support for DWARF5 call site-related attributes
Vedant Kumar [Fri, 5 Oct 2018 20:37:17 +0000 (20:37 +0000)]
[DebugInfo] Add support for DWARF5 call site-related attributes

DWARF v5 introduces DW_AT_call_all_calls, a subprogram attribute which
indicates that all calls (both regular and tail) within the subprogram
have call site entries. The information within these call site entries
can be used by a debugger to populate backtraces with synthetic tail
call frames.

Tail calling frames go missing in backtraces because the frame of the
caller is reused by the callee. Call site entries allow a debugger to
reconstruct a sequence of (tail) calls which led from one function to
another. This improves backtrace quality. There are limitations: tail
recursion isn't handled, variables within synthetic frames may not
survive to be inspected, etc. This approach is not novel, see:

  https://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf

This patch adds an IR-level flag (DIFlagAllCallsDescribed) which lowers
to DW_AT_call_all_calls. It adds the minimal amount of DWARF generation
support needed to emit standards-compliant call site entries. For easier
deployment, when the debugger tuning is LLDB, the DWARF requirement is
adjusted to v4.

Testing: Apart from check-{llvm, clang}, I built a stage2 RelWithDebInfo
clang binary. Its dSYM passed verification and grew by 1.4% compared to
the baseline. 151,879 call site entries were added.

rdar://42001377

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

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

5 years ago[COFF, ARM64] Add _InterlockedCompareExchangePointer_nf intrinsic
Mandeep Singh Grang [Fri, 5 Oct 2018 19:49:36 +0000 (19:49 +0000)]
[COFF, ARM64] Add _InterlockedCompareExchangePointer_nf intrinsic

Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, efriedma

Reviewed By: efriedma

Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits

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

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

5 years ago[CUDA] Use all 64 bits of GUID in __nv_module_id
Artem Belevich [Fri, 5 Oct 2018 18:39:58 +0000 (18:39 +0000)]
[CUDA] Use all 64 bits of GUID in __nv_module_id

getGUID() returns an uint64_t and "%x" only prints 32 bits of it.
Use PRIx64 format string to print all 64 bits.

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

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

5 years agoclang-format: Don't insert spaces in front of :: for Java 8 Method References.
Nico Weber [Fri, 5 Oct 2018 18:22:21 +0000 (18:22 +0000)]
clang-format: Don't insert spaces in front of :: for Java 8 Method References.

The existing code kept the space if it was there for identifiers, and it didn't
handle `this`. After this patch, for Java `this` is handled in addition to
identifiers, and existing space is always stripped between identifier and `::`.

Also accept `::` in addition to `.` in front of `<` in `foo::<T>bar` generic
calls.

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

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

5 years agoEmit diagnostic note when calling an invalid function declaration.
James Y Knight [Fri, 5 Oct 2018 17:49:48 +0000 (17:49 +0000)]
Emit diagnostic note when calling an invalid function declaration.

The comment said it was intentionally not emitting any diagnostic
because the declaration itself was already diagnosed. However,
everywhere else that wants to not emit a diagnostic without an extra
note emits note_invalid_subexpr_in_const_expr instead, which gets
suppressed later.

This was the only place which did not emit a diagnostic note.

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

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

5 years ago[clang-format] Java import sorting in clang-format
Krasimir Georgiev [Fri, 5 Oct 2018 17:19:26 +0000 (17:19 +0000)]
[clang-format] Java import sorting in clang-format

Contributed by SamMaier!

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

5 years ago[OPENMP][NVPTX] Fix emission of __kmpc_global_thread_num() for non-SPMD
Alexey Bataev [Fri, 5 Oct 2018 15:27:47 +0000 (15:27 +0000)]
[OPENMP][NVPTX] Fix emission of __kmpc_global_thread_num() for non-SPMD
mode.

__kmpc_global_thread_num() should be called before initialization of the
runtime.

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

5 years ago[OPENMP] Fix emission of the __kmpc_global_thread_num.
Alexey Bataev [Fri, 5 Oct 2018 15:08:53 +0000 (15:08 +0000)]
[OPENMP] Fix emission of the __kmpc_global_thread_num.

Fixed emission of the __kmpc_global_thread_num() so that it is not
messed up with alloca instructions anymore. Plus, fixes emission of the
__kmpc_global_thread_num() functions in the target outlined regions so
that they are not called before runtime is initialized.

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

5 years agoFix llvm-clang-x86_64-expensive-checks-win build by setting bigobj flag.
Simon Pilgrim [Fri, 5 Oct 2018 12:33:57 +0000 (12:33 +0000)]
Fix llvm-clang-x86_64-expensive-checks-win build by setting bigobj flag.

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

5 years ago[AArch64] Use filecheck captures for metadata node numbers in test. NFC
David Green [Fri, 5 Oct 2018 10:21:25 +0000 (10:21 +0000)]
[AArch64] Use filecheck captures for metadata node numbers in test. NFC

Just a quick fix for cases where extra metadata members are present.

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