]> granicus.if.org Git - clang/log
clang
7 years ago[CFG] Fix crash finding destructor of lifetime-extended temporary.
Devin Coughlin [Tue, 2 Aug 2016 21:07:23 +0000 (21:07 +0000)]
[CFG] Fix crash finding destructor of lifetime-extended temporary.

Fix a crash under -Wthread-safety when finding the destructor for a
lifetime-extending reference.

A patch by Nandor Licker!

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

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

7 years agoRevert "[Order Files] Remove dtrace predicate"
Chris Bieneman [Tue, 2 Aug 2016 18:23:56 +0000 (18:23 +0000)]
Revert "[Order Files] Remove dtrace predicate"

This reverts commit r277487.

Removing the probe predicate was a red herring. It results in more symbols being placed in the final order file, but they are symbols from outside the clang image.

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

7 years agoUpdate Clang Parser test error message to match new parser errors
Nirav Dave [Tue, 2 Aug 2016 17:58:14 +0000 (17:58 +0000)]
Update Clang Parser test error message to match new parser errors

Update clang tests in light of r277489.

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

7 years agoUpdated documentation
Vitaly Buka [Tue, 2 Aug 2016 17:51:48 +0000 (17:51 +0000)]
Updated documentation

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

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

7 years ago[Order Files] Remove dtrace predicate
Chris Bieneman [Tue, 2 Aug 2016 17:50:53 +0000 (17:50 +0000)]
[Order Files] Remove dtrace predicate

Having the dtrace predicate setup to only show probes in clang filters out static initializers executed by dyld, which we do want included in the order files.

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

7 years ago[analyzer] Hotfix for buildbot failure due to unspecified triple in r277449
Artem Dergachev [Tue, 2 Aug 2016 15:16:06 +0000 (15:16 +0000)]
[analyzer] Hotfix for buildbot failure due to unspecified triple in r277449

If a target triple is not specified, the default host triple is used,
which is not good for compiling inline assembler code.

Patch by Raphael Isemann!

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

7 years ago[clang-cl] Fix PCH tests to use x86_64 as target
Diana Picus [Tue, 2 Aug 2016 13:53:00 +0000 (13:53 +0000)]
[clang-cl] Fix PCH tests to use x86_64 as target

These tests require x86-registered-target, but they don't force the target as
x86 on the command line, which means they will be run and they might fail when
building the x86 backend on another platform (such as AArch64).

Fixes https://llvm.org/bugs/show_bug.cgi?id=28797

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

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

7 years ago[analyzer] Respect statement-specific data in CloneDetection.
Artem Dergachev [Tue, 2 Aug 2016 12:21:09 +0000 (12:21 +0000)]
[analyzer] Respect statement-specific data in CloneDetection.

So far the CloneDetector only respected the kind of each statement when
searching for clones. This patch refines the way the CloneDetector collects data
from each statement by providing methods for each statement kind,
that will read the kind-specific attributes.

For example, statements 'a < b' and 'a > b' are no longer considered to be
clones, because they are different in operation code, which is an attribute
specific to the BinaryOperator statement kind.

Patch by Raphael Isemann!

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

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

7 years agoRevert r276896 "Update Clang Parser test error message to match new parser errors"
Hans Wennborg [Mon, 1 Aug 2016 23:34:42 +0000 (23:34 +0000)]
Revert r276896 "Update Clang Parser test error message to match new parser errors"

This depended on r276895, which was reverted in r277402.

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

7 years ago[Order Files] Fixing an error in the perf-helper script
Chris Bieneman [Mon, 1 Aug 2016 22:54:00 +0000 (22:54 +0000)]
[Order Files] Fixing an error in the perf-helper script

Dtrace probemod needs to be based on the first argument of the command, not the first argument of the args. This error was introduced a while back when I added support for skipping the driver and invoking cc1 directly.

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

7 years agoAdd FIXMEs for MSVC 2013 hacks in r277211. NFC.
Paul Robinson [Mon, 1 Aug 2016 22:12:46 +0000 (22:12 +0000)]
Add FIXMEs for MSVC 2013 hacks in r277211. NFC.

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

7 years agoCodeGen: simplify the CC handling for TLS wrappers
Saleem Abdulrasool [Mon, 1 Aug 2016 21:31:24 +0000 (21:31 +0000)]
CodeGen: simplify the CC handling for TLS wrappers

Use the calling convention of the wrapper directly to set the calling convention
to ensure that the calling convention matches.  Incorrectly setting the calling
convention results in the code path being entirely nullified as InstCombine +
SimplifyCFG will prune the mismatched CC calls.

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

7 years ago[ObjC Availability] Fix partial-availability false positive introduced in r277058
Erik Pilkington [Mon, 1 Aug 2016 20:19:49 +0000 (20:19 +0000)]
[ObjC Availability] Fix partial-availability false positive introduced in r277058

Thanks to Nico Weber for pointing this out!

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

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

7 years ago[codeview] Skip injected class names in nested record emission
Reid Kleckner [Mon, 1 Aug 2016 18:56:13 +0000 (18:56 +0000)]
[codeview] Skip injected class names in nested record emission

We were already trying to do this, but our check wasn't quite right.

Fixes PR28790

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

7 years ago[AArch64] Add support for Samsung Exynos M2 (NFC).
Evandro Menezes [Mon, 1 Aug 2016 18:39:55 +0000 (18:39 +0000)]
[AArch64] Add support for Samsung Exynos M2 (NFC).

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

7 years ago[Parse] Let declarations follow labels in -fms-extensions mode
David Majnemer [Mon, 1 Aug 2016 16:39:29 +0000 (16:39 +0000)]
[Parse] Let declarations follow labels in -fms-extensions mode

MSVC permits declarations in these places as conforming extension (it is
a constraint violation otherwise).

This fixes PR28782.

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

7 years agoMake RecursiveASTVisitor visit lambda capture initialization expressions
Martin Bohme [Mon, 1 Aug 2016 12:15:46 +0000 (12:15 +0000)]
Make RecursiveASTVisitor visit lambda capture initialization expressions

Summary:
Lambda capture initializations are part of the explicit source code and
therefore should be visited by default but, so far, RecursiveASTVisitor does not
visit them.

This appears to be an oversight. Because the lambda body needs custom handling
(calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets
ShouldVisitChildren to false but then neglects to visit the lambda capture
initializations. This patch adds code to visit the expressions associated with
lambda capture initializations.

Reviewers: klimek

Subscribers: cfe-commits

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

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

7 years ago[analyzer] Fix execution permissions for the scan-build-py scripts.
Artem Dergachev [Mon, 1 Aug 2016 10:55:59 +0000 (10:55 +0000)]
[analyzer] Fix execution permissions for the scan-build-py scripts.

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

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

7 years agoImplement tooling::Replacements as a class.
Eric Liu [Mon, 1 Aug 2016 10:16:37 +0000 (10:16 +0000)]
Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
  control how replacements for a single file are combined and provide guarantee
  on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
  Use std::map<std::string, tooling::Replacements> to represent multi-file
  replacements.
- Error handling for the interface change will be improved in followup patches.

Reviewers: djasper, klimek

Subscribers: cfe-commits

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

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

7 years agoAllow .exe extension to ld to fix test with mingw.
Yaron Keren [Mon, 1 Aug 2016 10:14:54 +0000 (10:14 +0000)]
Allow .exe extension to ld to fix test with mingw.

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

7 years agoscan-build: Add an option to show the description in the list of defect
Sylvestre Ledru [Mon, 1 Aug 2016 08:04:45 +0000 (08:04 +0000)]
scan-build: Add an option to show the description in the list of defect

Summary:
This patch adds an option //--show-description// to add the defect description to the list of defect. This helps to get a better understanding of the defect without opening the page.

For example, this is used for Firefox:
https://people.mozilla.org/~sledru/reports/fx-scan-build/

Reviewers: rizsotto.mailinglist, zaks.anna

Subscribers: cfe-commits

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

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

7 years agoAdd more gcc compatibility names to clang's cpuid.h
Dimitry Andric [Sun, 31 Jul 2016 20:23:23 +0000 (20:23 +0000)]
Add more gcc compatibility names to clang's cpuid.h

Summary:
Some cpuid bit defines are named slightly different from how gcc's
cpuid.h calls them.

Define a few more compatibility names to appease software built for gcc:

* `bit_PCLMUL`      alias of `bit_PCLMULQDQ`
* `bit_SSE4_1`      alias of `bit_SSE41`
* `bit_SSE4_2`      alias of `bit_SSE42`
* `bit_AES`         alias of `bit_AESNI`
* `bit_CMPXCHG8B`   alias of `bit_CX8`

While here, add the misssing 29th bit, `bit_F16C` (which is how gcc
calls this bit).

Reviewers: joerg, rsmith

Subscribers: bruno, cfe-commits

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

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

7 years ago[NFC] Rearrange an example-file so the c++14 specific example is on top.
Faisal Vali [Sun, 31 Jul 2016 01:19:17 +0000 (01:19 +0000)]
[NFC] Rearrange an example-file so the c++14 specific example is on top.

This makes it easier to add C++1z examples to the bottom, just before the #endif.

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

7 years agoReapply r276069 with workaround for MSVC 2013
Hubert Tong [Sat, 30 Jul 2016 22:33:34 +0000 (22:33 +0000)]
Reapply r276069 with workaround for MSVC 2013

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

7 years agoCorrecting some sphinx formatting issues so that the attribute documentation builds...
Aaron Ballman [Sat, 30 Jul 2016 20:20:03 +0000 (20:20 +0000)]
Correcting some sphinx formatting issues so that the attribute documentation builds again.

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

7 years ago[analyzer] Update APIs taking user-facing strings.
Devin Coughlin [Sat, 30 Jul 2016 16:16:51 +0000 (16:16 +0000)]
[analyzer] Update APIs taking user-facing strings.

Add new APIs that require localized strings and remove two APIs that were
incorrectly marked as requiring a user-facing string.

A patch by Kulpreet Chilana!

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

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

7 years ago[c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments did not...
Argyrios Kyrtzidis [Sat, 30 Jul 2016 02:20:21 +0000 (02:20 +0000)]
[c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments did not return -1.

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

7 years agoFix VS2013 build of CGOpenMPRuntime.cpp
Hans Wennborg [Sat, 30 Jul 2016 00:41:37 +0000 (00:41 +0000)]
Fix VS2013 build of CGOpenMPRuntime.cpp

It seems the compiler was getting confused by the in-class initializers
in local struct MapInfo, so moving those to a default constructor
instead.

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

7 years ago[Perf-Helper] Add logging for dtrace commands
Chris Bieneman [Fri, 29 Jul 2016 22:48:17 +0000 (22:48 +0000)]
[Perf-Helper] Add logging for dtrace commands

Logging the dtrace command into the top of the dtrace log is useful when debugging why the order file generation is flaky.

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

7 years agoRemove unused variable.
Eric Christopher [Fri, 29 Jul 2016 22:11:11 +0000 (22:11 +0000)]
Remove unused variable.

Fixes PR28761.

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

7 years agoFix CGOpenMPRuntime.cpp for VS2013. NFC.
Paul Robinson [Fri, 29 Jul 2016 20:46:16 +0000 (20:46 +0000)]
Fix CGOpenMPRuntime.cpp for VS2013.  NFC.
I don't know why these changes work but they do.

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

7 years agoEnsure Ident_GNU_final is properly initialized in the Parser Initialize function
David Majnemer [Fri, 29 Jul 2016 20:01:12 +0000 (20:01 +0000)]
Ensure Ident_GNU_final is properly initialized in the Parser Initialize function

The recent change implementing __final forgot to initialize a variable.
This was caught by the Memory Sanitizer.

Properly initialize the value to nullptr to ensure proper memory reads.

Patch by Erich Keane!

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

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

7 years agoFix naked.cpp test on 32-bit Windows
Reid Kleckner [Fri, 29 Jul 2016 19:43:28 +0000 (19:43 +0000)]
Fix naked.cpp test on 32-bit Windows

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

7 years agoCodeGen: try harder to make the CFString structure RW
Saleem Abdulrasool [Fri, 29 Jul 2016 19:15:51 +0000 (19:15 +0000)]
CodeGen: try harder to make the CFString structure RW

The previous change was insufficient to mark the content as read-write as the
structure itself was marked constant.  Adjust this and add tests to ensure that
the section is marked appropriately as being read-write.

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

7 years agoImprove documentation of the type safety attributes.
Yunzhong Gao [Fri, 29 Jul 2016 18:34:21 +0000 (18:34 +0000)]
Improve documentation of the type safety attributes.
1. Add description of the arguments to these attributes.
2. Add missing declarations to some of the MPI code examples.
3. Made clarifications where possible.

Based on the write-up by: Craig Flores.

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

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

7 years ago[OpenCL] Add extension cl_khr_mipmap_image to clang
Yaxun Liu [Fri, 29 Jul 2016 17:52:34 +0000 (17:52 +0000)]
[OpenCL] Add extension cl_khr_mipmap_image to clang

Adding extension cl_khr_mipmap_image to clang's OpenCL Extensions and initiated inside AMDGPU Target.

Patch by Aaron En Ye Shi.

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

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

7 years ago[OpenCL] Added CLK_ABGR definition for get_image_channel_order return value
Yaxun Liu [Fri, 29 Jul 2016 17:50:10 +0000 (17:50 +0000)]
[OpenCL] Added CLK_ABGR definition for get_image_channel_order return value

Added CLK_ABGR definition for get_image_channel_order return value inside opencl-c.h file.

Patch by Aaron En Ye Shi.

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

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

7 years agoReapply r277058: "[ObjC] Consider availability of context when emitting availability...
Erik Pilkington [Fri, 29 Jul 2016 17:37:38 +0000 (17:37 +0000)]
Reapply r277058: "[ObjC] Consider availability of context when emitting availability warnings"

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

7 years agoFix a typo in document.
Haojian Wu [Fri, 29 Jul 2016 17:30:13 +0000 (17:30 +0000)]
Fix a typo in document.

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

7 years agoInitial vectorization support for svml calls (short vector math library).
Matt Masten [Fri, 29 Jul 2016 16:44:24 +0000 (16:44 +0000)]
Initial vectorization support for svml calls (short vector math library).

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

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

7 years ago[ASTMatcher] Add templateName matcher.
Haojian Wu [Fri, 29 Jul 2016 15:45:11 +0000 (15:45 +0000)]
[ASTMatcher] Add templateName matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

7 years ago[ASTMatcher] Add hasTemplateArgument/hasAnyTemplateArgument support in functionDecl.
Haojian Wu [Fri, 29 Jul 2016 13:57:27 +0000 (13:57 +0000)]
[ASTMatcher] Add hasTemplateArgument/hasAnyTemplateArgument support in functionDecl.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

7 years agoAdd missing '-no-canonical-prefixes' in test.
Daniel Jasper [Fri, 29 Jul 2016 13:45:03 +0000 (13:45 +0000)]
Add missing '-no-canonical-prefixes' in test.

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

7 years agoMake test not fail on hosts where the default omp library is gomp.
Benjamin Kramer [Fri, 29 Jul 2016 13:07:09 +0000 (13:07 +0000)]
Make test not fail on hosts where the default omp library is gomp.

This is the case on some linuxes, just force libomp so we get the
desired results.

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

7 years ago[GCC] Support for __final specifier
Andrey Bokhanko [Fri, 29 Jul 2016 10:42:48 +0000 (10:42 +0000)]
[GCC] Support for __final specifier

As reported in bug 28473, GCC supports "final" functionality in pre-C++11 code using the __final keyword. Clang currently supports the "final" keyword in accordance with the C++11 specification, however it ALSO supports it in pre-C++11 mode, with a warning.

This patch adds the "__final" keyword for compatibility with GCC in GCC Keywords mode (so it is enabled with existing flags), and issues a warning on its usage (suggesting switching to the C++11 keyword). This patch also adds a regression test for the functionality described. I believe this patch has minimal impact, as it simply adds a new keyword for existing behavior.

This has been validated with check-clang to avoid regressions. Patch is created in reference to revisions 276665.

Patch by Erich Keane.

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

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

7 years ago[Typo police] s/proccess/process/, s/auxiliary/auxilliary/.
Justin Lebar [Fri, 29 Jul 2016 05:26:58 +0000 (05:26 +0000)]
[Typo police] s/proccess/process/, s/auxiliary/auxilliary/.

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

7 years ago[Parser] Fix bug where delayed typo in conditional expression was corrected twice
Erik Pilkington [Fri, 29 Jul 2016 00:55:40 +0000 (00:55 +0000)]
[Parser] Fix bug where delayed typo in conditional expression was corrected twice

Patch by David Tarditi!

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

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

7 years agoChange a test to be less prone to random failures due to
Wolfgang Pieb [Fri, 29 Jul 2016 00:54:13 +0000 (00:54 +0000)]
Change a test to be less prone to random failures due to
unintended matches of label numbers to debug metadata
handles in release builds.

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

7 years ago[docs] Coverage: Reference the new -output-dir option
Vedant Kumar [Thu, 28 Jul 2016 23:22:42 +0000 (23:22 +0000)]
[docs] Coverage: Reference the new -output-dir option

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

7 years ago[docs] Mention some new options in llvm-cov
Vedant Kumar [Thu, 28 Jul 2016 23:18:48 +0000 (23:18 +0000)]
[docs] Mention some new options in llvm-cov

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

7 years agoRevert "[ObjC] Consider availability of context when emitting availability warnings"
Erik Pilkington [Thu, 28 Jul 2016 22:51:11 +0000 (22:51 +0000)]
Revert "[ObjC] Consider availability of context when emitting availability warnings"

Reverting r277058, while I fugure out why it broke internal bots.

This reverts commit e514ffa8b657416c6784bbe6da9f5de19365103d.

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

7 years ago[CUDA] Unswitch enumerators in the selection of the offloading tool chain.
Samuel Antao [Thu, 28 Jul 2016 22:42:42 +0000 (22:42 +0000)]
[CUDA] Unswitch enumerators in the selection of the offloading tool chain.

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

7 years ago[ObjC] Consider availability of context when emitting availability warnings
Erik Pilkington [Thu, 28 Jul 2016 22:09:53 +0000 (22:09 +0000)]
[ObjC] Consider availability of context when emitting availability warnings

This means that a function marked with an availability attribute can safely
refer to a declaration that is greater than the deployment target, but less then
or equal to the context availability without -Wpartial-availability firing.

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

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

7 years ago[analyzer] Update the web manual for checker developers.
Artem Dergachev [Thu, 28 Jul 2016 20:13:14 +0000 (20:13 +0000)]
[analyzer] Update the web manual for checker developers.

Fix the explanation of how to run tests after migration
from autotools to cmake.

Significantly expand the "debugging" section
with more interesting stuff.

Update the table of contents accordingly.

Fix paragraphs in the overview section.

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

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

7 years ago[OpenCL] Generate opaque type for sampler_t and function call for the initializer
Yaxun Liu [Thu, 28 Jul 2016 19:26:30 +0000 (19:26 +0000)]
[OpenCL] Generate opaque type for sampler_t and function call for the initializer

Currently Clang use int32 to represent sampler_t, which have been a source of issue for some backends, because in some backends sampler_t cannot be represented by int32. They have to depend on kernel argument metadata and use IPA to find the sampler arguments and global variables and transform them to target specific sampler type.

This patch uses opaque pointer type opencl.sampler_t* for sampler_t. For each use of file-scope sampler variable, it generates a function call of __translate_sampler_initializer. For each initialization of function-scope sampler variable, it generates a function call of __translate_sampler_initializer.

Each builtin library can implement its own __translate_sampler_initializer(). Since the real sampler type tends to be architecture dependent, allowing it to be initialized by a library function simplifies backend design. A typical implementation of __translate_sampler_initializer could be a table lookup of real sampler literal values. Since its argument is always a literal, the returned pointer is known at compile time and easily optimized to finally become some literal values directly put into image read instructions.

This patch is partially based on Alexey Sotkin's work in Khronos Clang (https://github.com/KhronosGroup/SPIR/commit/3d4eec61623502fc306e8c67c9868be2b136e42b).

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

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

7 years ago[analyzer] Fix misleading indentation in ObjCDeallocChecker. NFC.
Devin Coughlin [Thu, 28 Jul 2016 17:18:33 +0000 (17:18 +0000)]
[analyzer] Fix misleading indentation in ObjCDeallocChecker. NFC.

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

7 years agoRevert r276973 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Thu, 28 Jul 2016 17:17:22 +0000 (17:17 +0000)]
Revert r276973 "Adjust Registry interface to not require plugins to export a registry"

Buildbot failures when building with clang -Werror. Reverting while I try to
figure this out.

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

7 years ago[Driver] Fix Windows SDK Detection
Zachary Turner [Thu, 28 Jul 2016 17:13:32 +0000 (17:13 +0000)]
[Driver] Fix Windows SDK Detection

This fixes a couple of bugs in Windows SDK Detection.

1. `readFullStringValue` returns a bool, but was being compared
   with ERROR_SUCCESS.
2. `RegQueryValueExW` might return the null terminator in the
   queried value which will result in incorrect values being
   returned from `getSystemRegistryString`.

Patch By: comicfans44@gmail.com
Reviewed By: zturner
Differential Revision: http://reviews.llvm.org/D21946

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

7 years ago[CUDA] Remove duplicated test that should have been removed in r276995.
Samuel Antao [Thu, 28 Jul 2016 16:18:31 +0000 (16:18 +0000)]
[CUDA] Remove duplicated test that should have been removed in r276995.

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

7 years ago[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other...
Samuel Antao [Thu, 28 Jul 2016 16:12:30 +0000 (16:12 +0000)]
[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other tests.

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

7 years ago[OpenMP] Change name of variable in mappble expression.
Samuel Antao [Thu, 28 Jul 2016 15:31:29 +0000 (15:31 +0000)]
[OpenMP] Change name of variable in mappble expression.

This attempts to fix a failure in Windows bots pottentially related with a reserved keyword.

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

7 years ago[OpenMP] Fix link command pattern in offloading interoperability test.
Samuel Antao [Thu, 28 Jul 2016 14:56:19 +0000 (14:56 +0000)]
[OpenMP] Fix link command pattern in offloading interoperability test.

It was causing a few bots to fail.

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

7 years ago[OpenMP] Do not use default argument in lambda from mappable expressions handlers.
Samuel Antao [Thu, 28 Jul 2016 14:47:35 +0000 (14:47 +0000)]
[OpenMP] Do not use default argument in lambda from mappable expressions handlers.

Windows bots were complaining about that.

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

7 years ago[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.
Samuel Antao [Thu, 28 Jul 2016 14:29:18 +0000 (14:29 +0000)]
[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.

Summary:
This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported.

This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, tra, ABataev

Subscribers: caomhin, cfe-commits

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

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

7 years ago[OpenMP] Code generation for the is_device_ptr clause
Samuel Antao [Thu, 28 Jul 2016 14:25:09 +0000 (14:25 +0000)]
[OpenMP] Code generation for the is_device_ptr clause

Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

7 years ago[OpenMP] Codegen for use_device_ptr clause.
Samuel Antao [Thu, 28 Jul 2016 14:23:26 +0000 (14:23 +0000)]
[OpenMP] Codegen for use_device_ptr clause.

Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

7 years agoReapply r276856 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Thu, 28 Jul 2016 12:48:17 +0000 (12:48 +0000)]
Reapply r276856 "Adjust Registry interface to not require plugins to export a registry"

This version has two fixes compared to the original:
 * In Registry.h the template static members are instantiated before they are
   used, as clang gives an error if you do it the other way around.
 * The use of the Registry template in clang-tidy is updated in the same way as
   has been done everywhere else.

Original commit message:

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

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

7 years ago[AArch64] Using AArch64TargetParser in Clang.
Zijiao Ma [Thu, 28 Jul 2016 06:24:48 +0000 (06:24 +0000)]
[AArch64] Using AArch64TargetParser in Clang.

This resubmit r270688 which broke some specific buildbots.That's because
there is incorrect indexing problem in the targetparser,and the problem is
fixed in r276957.

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

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

7 years ago[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.
Devin Coughlin [Thu, 28 Jul 2016 00:52:10 +0000 (00:52 +0000)]
[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.

This was an oversight from when I added BeginFunction support in r261293.

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

7 years agoReplace preserve-as-comments CodeGen test with driver test
Nirav Dave [Thu, 28 Jul 2016 00:36:34 +0000 (00:36 +0000)]
Replace preserve-as-comments CodeGen test with driver test

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

7 years agoRetry: [Driver] Compute effective target triples once per job (NFCI)
Vedant Kumar [Wed, 27 Jul 2016 23:02:20 +0000 (23:02 +0000)]
Retry: [Driver] Compute effective target triples once per job (NFCI)

Compute an effective triple once per job. Cache the triple in the
prevailing ToolChain for the duration of the job.

Clients which need effective triples now look them up in the ToolChain.
This eliminates wasteful re-computation of effective triples (e.g in
getARMFloatABI()).

While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a
no-op override.

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

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

7 years agoRevert "[Driver] Compute effective target triples once per job (NFCI)"
Vedant Kumar [Wed, 27 Jul 2016 23:01:55 +0000 (23:01 +0000)]
Revert "[Driver] Compute effective target triples once per job (NFCI)"

This reverts commit r275895 in order to address some post-commit review
feedback from Eric Christopher (see: the list thread for r275895).

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

7 years ago[OpenMP] Add support to map member expressions with references to pointers.
Samuel Antao [Wed, 27 Jul 2016 22:52:16 +0000 (22:52 +0000)]
[OpenMP] Add support to map member expressions with references to pointers.

Summary: This patch add support to map pointers through references in class members. Although a reference does not have storage that a user can access, it still has to be mapped in order to get the deep copy right and the dereferencing code work properly.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

7 years ago[OpenMP] Add support for mapping array sections through pointer references.
Samuel Antao [Wed, 27 Jul 2016 22:49:49 +0000 (22:49 +0000)]
[OpenMP] Add support for mapping array sections through pointer references.

Summary:
This patch fixes a bug in the map of array sections whose base is a reference to a pointer. The existing mapping support was not prepared to deal with it, causing the compiler to crash.

Mapping a reference to a pointer enjoys the same characteristics of a regular pointer, i.e., it is passed by value. Therefore, the reference has to be materialized in the target region.

Reviewers: hfinkel, carlo.bertolli, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

7 years agoBasic/Targets.cpp: Reformat aarch64 CPU list.
Matthias Braun [Wed, 27 Jul 2016 22:47:09 +0000 (22:47 +0000)]
Basic/Targets.cpp: Reformat aarch64 CPU list.

Having 1 entry per line and an alphabetical order is clearer and reduces
the risk of invalid merges.

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

7 years agotest/Frontend: Add a test for aarch64 target CPU names.
Matthias Braun [Wed, 27 Jul 2016 22:47:07 +0000 (22:47 +0000)]
test/Frontend: Add a test for aarch64 target CPU names.

Nothing else checked the target cpu names for aarch64 yet.
Add a test in the spirit of x86-target-cpu.c.

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

7 years agoRefactor how include paths are appended to the command arguments.
Samuel Antao [Wed, 27 Jul 2016 22:46:31 +0000 (22:46 +0000)]
Refactor how include paths are appended to the command arguments.

Summary:
This patch aims at removing redundancy in the way include paths for the regular and offloading toolchains are appended to the arguments list in the clang tool.

This was suggested by @rsmith in response to r275931.

Reviewers: rsmith, tra

Subscribers: rsmith, cfe-commits

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

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

7 years ago[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different...
Justin Lebar [Wed, 27 Jul 2016 22:36:21 +0000 (22:36 +0000)]
[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

Summary:
Before this patch, we computed the offsets in memory of args passed to
GPU kernel functions by throwing all of the args into an LLVM struct.

clang emits packed llvm structs basically whenever it feels like it, and
packed structs have alignment 1.  So we cannot rely on the llvm type's
alignment matching the C++ type's alignment.

This patch fixes our codegen so we always respect the clang types'
alignments.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years agoDon't crash when generating code for __attribute__((naked)) member functions.
Justin Lebar [Wed, 27 Jul 2016 22:04:24 +0000 (22:04 +0000)]
Don't crash when generating code for __attribute__((naked)) member functions.

Summary:
Previously this crashed inside EmitThisParam().  There should be no
prelude for naked functions, so just skip the whole thing.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

7 years agoAdd target triple in test
Nirav Dave [Wed, 27 Jul 2016 20:48:39 +0000 (20:48 +0000)]
Add target triple in test

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

7 years agotest commit
Matt Masten [Wed, 27 Jul 2016 20:23:32 +0000 (20:23 +0000)]
test commit

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

7 years agoAdd flags to toggle preservation of assembly comments
Nirav Dave [Wed, 27 Jul 2016 19:57:40 +0000 (19:57 +0000)]
Add flags to toggle preservation of assembly comments

Summary: Add -fpreserve-as-comments and -fno-preserve-as-comments.

Reviewers: echristo, rnk

Subscribers: mehdi_amini, llvm-commits

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

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

7 years agoAdjust coercion of aggregates on RenderScript
Pirama Arumuga Nainar [Wed, 27 Jul 2016 19:01:51 +0000 (19:01 +0000)]
Adjust coercion of aggregates on RenderScript

Summary:
In RenderScript, the size of the argument or return value emitted in the
IR is expected to be the same as the size of corresponding qualified
type.  For ARM and AArch64, the coercion performed by Clang can
change the parameter or return value to a type whose size is different
(usually larger) than the original aggregate type.  Specifically, this
can happen in the following cases:
    - Aggregate parameters of size <= 64 bytes and return values smaller
      than 4 bytes on ARM
    - Aggregate parameters and return values smaller than bytes on
      AArch64

This patch coerces the cases above to an integer array that is the same
size and alignment as the original aggregate.  A new field is added to
TargetInfo to detect a RenderScript target and limit this coercion just
to that case.

Tests added to test/CodeGen/renderscript.c

Reviewers: rsmith

Subscribers: aemerson, srhines, llvm-commits

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

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

7 years ago[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer
Erik Pilkington [Wed, 27 Jul 2016 18:25:10 +0000 (18:25 +0000)]
[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer

Fixes PR27994, a crash on valid.

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

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

7 years agoUpdate Clang Parser test error message to match new parser errors
Nirav Dave [Wed, 27 Jul 2016 17:39:47 +0000 (17:39 +0000)]
Update Clang Parser test error message to match new parser errors

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

7 years agoUsersManual.rst: update clang-cl option list
Hans Wennborg [Wed, 27 Jul 2016 16:56:03 +0000 (16:56 +0000)]
UsersManual.rst: update clang-cl option list

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

7 years agoFix unnecessary default switch warning
Simon Pilgrim [Wed, 27 Jul 2016 16:41:56 +0000 (16:41 +0000)]
Fix unnecessary default switch warning

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

7 years agoUpdate cxx_dr_Status after 3.9 branch
Hans Wennborg [Wed, 27 Jul 2016 16:39:45 +0000 (16:39 +0000)]
Update cxx_dr_Status after 3.9 branch

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

7 years agoImplement filtering for code completion of identifiers.
Vassil Vassilev [Wed, 27 Jul 2016 14:56:59 +0000 (14:56 +0000)]
Implement filtering for code completion of identifiers.

Patch by Cristina Cristescu and Axel Naumann!

Agreed on post commit review (D17820).

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

7 years ago[ARM] Pass thumb as architecture to the underlying tools, when targeting windows
Renato Golin [Wed, 27 Jul 2016 14:12:20 +0000 (14:12 +0000)]
[ARM] Pass thumb as architecture to the underlying tools, when targeting windows

This makes sure that the thumb section flag gets set by the assembler.

Patch by Martin Storsjö.

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

7 years agoRevert r276856 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Wed, 27 Jul 2016 11:41:18 +0000 (11:41 +0000)]
Revert r276856 "Adjust Registry interface to not require plugins to export a registry"

This is causing a huge pile of buildbot failures.

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

7 years agoAdjust Registry interface to not require plugins to export a registry
John Brawn [Wed, 27 Jul 2016 11:18:38 +0000 (11:18 +0000)]
Adjust Registry interface to not require plugins to export a registry

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

Differential Revision: http://reviews.llvm.org/D21385

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

7 years agoclang-format: Fix incorrect detection of QT-signals access specifier.
Daniel Jasper [Wed, 27 Jul 2016 10:13:24 +0000 (10:13 +0000)]
clang-format: Fix incorrect detection of QT-signals access specifier.

Before:
  void f() {
  label:
    signals
    .baz();
  }

After:
  void f() {
  label:
    signals.baz();
  }

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

7 years ago[ARM] Pass -mimplcit-it= to integrated assembler
Oliver Stannard [Wed, 27 Jul 2016 08:54:13 +0000 (08:54 +0000)]
[ARM] Pass -mimplcit-it= to integrated assembler

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

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

7 years agoSupport setting default value for -rtlib at build time
Jonas Hahnfeld [Wed, 27 Jul 2016 08:15:54 +0000 (08:15 +0000)]
Support setting default value for -rtlib at build time

This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru
which we can specify a default value for -rtlib (libgcc or
compiler-rt) at build time, just like how we set the default C++
stdlib thru CLANG_DEFAULT_CXX_STDLIB.

With these two options, we can configure clang to build binaries on
Linux that have no runtime dependence on any gcc libs (libstdc++ or
libgcc_s).

Patch by Lei Zhang!

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

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

7 years agoFix for compiling with clang <= 3.7 and g++6 headers
Vedant Kumar [Wed, 27 Jul 2016 03:43:34 +0000 (03:43 +0000)]
Fix for compiling with clang <= 3.7 and g++6 headers

Make integers explicitly unsigned, so the tuple constructor will resolve
properly when but with clang 3.6, 3.7 and gcc 6.1.1 libstdc++ headers.

Patch by Frederich Munch!

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

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

7 years agoModules: follow up to r276769.
Manman Ren [Tue, 26 Jul 2016 19:56:12 +0000 (19:56 +0000)]
Modules: follow up to r276769.

In r276769, I forgot to forward the driver option, add that here.

rdar://26675801

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

7 years ago[analyzer] Hotfix for build failure due to declaration shadowing in r276782.
Artem Dergachev [Tue, 26 Jul 2016 19:05:22 +0000 (19:05 +0000)]
[analyzer] Hotfix for build failure due to declaration shadowing in r276782.

CloneDetector member variable is shadowing the class with the same name,
which causes build failures on some platforms.

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

7 years ago[analyzer] Add basic capabilities to detect source code clones.
Artem Dergachev [Tue, 26 Jul 2016 18:13:12 +0000 (18:13 +0000)]
[analyzer] Add basic capabilities to detect source code clones.

This patch adds the CloneDetector class which allows searching source code
for clones.

For every statement or group of statements within a compound statement,
CloneDetector computes a hash value, and finds clones by detecting
identical hash values.

This initial patch only provides a simple hashing mechanism
that hashes the kind of each sub-statement.

This patch also adds CloneChecker - a simple static analyzer checker
that uses CloneDetector to report copy-pasted code.

Patch by Raphael Isemann!

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

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

7 years agoModules: add command line option fmodules-disable-diagnostic-validation
Manman Ren [Tue, 26 Jul 2016 17:12:17 +0000 (17:12 +0000)]
Modules: add command line option fmodules-disable-diagnostic-validation

With PCH+Module, sometimes compiler gives a hard error:
Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt

This happens when we have a pch importing a module and the module gets
overwritten by another compiler instance after we build the pch (one example is
that both compiler instances hash to the same pcm file but use different
diagnostic options). When we try to load the pch later on, the compiler notices
that the imported module is out of date (modification date, size do not match)
but it can't handle this out of date pcm (i.e it does not know how to rebuild
the pch).

This commit introduces a new command line option so for PCH + module, we can
turn on this option and if two compiler instances only differ in diagnostic
options, the latter instance will not invalidate the original pcm.

rdar://26675801
Differential Revision: http://reviews.llvm.org/D22773

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