]> granicus.if.org Git - clang/log
clang
7 years agoDon't copy replacements in for-range loop. NFC.
Benjamin Kramer [Wed, 19 Oct 2016 13:50:17 +0000 (13:50 +0000)]
Don't copy replacements in for-range loop. NFC.

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

7 years ago[cmake] Use LLVM_CMAKE_PATH for GetSVN script
Michal Gorny [Wed, 19 Oct 2016 12:21:39 +0000 (12:21 +0000)]
[cmake] Use LLVM_CMAKE_PATH for GetSVN script

Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

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

7 years ago[Sema] Gcc compatibility of vector shift
Andrey Bokhanko [Wed, 19 Oct 2016 12:06:10 +0000 (12:06 +0000)]
[Sema] Gcc compatibility of vector shift

Gcc prints error if elements of left and right parts of a shift have different
sizes. This patch is provided the GCC compatibility.

Patch by Vladimir Yakovlev.

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

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

7 years ago[modules] Do not report missing definitions of demoted constexpr variable templates.
Vassil Vassilev [Wed, 19 Oct 2016 11:19:30 +0000 (11:19 +0000)]
[modules] Do not report missing definitions of demoted constexpr variable templates.

This is a followup to regression introduced in r284284.

This should fix our libstdc++ modules builds.

https://reviews.llvm.org/D25678

Reviewed by Richard Smith!

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

7 years ago[clang-format] Add comment manipulation header
Eric Liu [Wed, 19 Oct 2016 08:19:46 +0000 (08:19 +0000)]
[clang-format] Add comment manipulation header

Summary:
Introduces a separate target for comment manipulation.
Currently, comment manipulation is in BreakableComment.cpp.
Towards implementing comment reflowing, we want to factor out the
comment-related functionality, so it can be reused.
Start simple by just moving out getLineCommentIndentPrefix.

Patch by Krasimir Georgiev!

Reviewers: djasper

Subscribers: klimek, beanz, mgorny, modocache

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

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

7 years agoResolve exception specifications when selecting an overloaded operator.
Richard Smith [Wed, 19 Oct 2016 00:14:23 +0000 (00:14 +0000)]
Resolve exception specifications when selecting an overloaded operator.

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

7 years ago[CUDA] Rework tests now that we emit deferred diagnostics during sema. Test-only...
Justin Lebar [Wed, 19 Oct 2016 00:06:49 +0000 (00:06 +0000)]
[CUDA] Rework tests now that we emit deferred diagnostics during sema.  Test-only change.

Summary:
Previously we had to split out a lot of our tests into a test that
checked only immediate errors and a test that checked only deferred
errors.  This was because, if you emitted any immediate errors, we
wouldn't run codegen, where the deferred errors were emitted.

We've fixed this, and now emit deferred errors during sema.  This lets
us merge a bunch of tests, and lets us convert some other tests to
-fsyntax-only.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years agoDR1330: instantiate exception-specifications when "needed". We previously did
Richard Smith [Tue, 18 Oct 2016 23:39:12 +0000 (23:39 +0000)]
DR1330: instantiate exception-specifications when "needed". We previously did
not instantiate exception specifications of functions if they were only used in
unevaluated contexts (other than 'noexcept' expressions).

In C++17 onwards, this becomes essential since the exception specification is
now part of the function's type.

Note that this means that constructs like the following no longer work:

  struct A {
    static T f() noexcept(...);
    decltype(f()) *p;
  };

... because the decltype expression now needs the exception specification of
'f', which has not yet been parsed.

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

7 years agoAdd missing warning for use of C++1z init-statements in C++14 and before.
Richard Smith [Tue, 18 Oct 2016 20:27:16 +0000 (20:27 +0000)]
Add missing warning for use of C++1z init-statements in C++14 and before.

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

7 years ago[c++1z] Fix corner case where we could create a function type whose canonical type...
Richard Smith [Tue, 18 Oct 2016 20:13:25 +0000 (20:13 +0000)]
[c++1z] Fix corner case where we could create a function type whose canonical type is not actually canonical.

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

7 years agoWhen two function types have equivalent (but distinct) noexcept specifications, creat...
Richard Smith [Tue, 18 Oct 2016 19:29:18 +0000 (19:29 +0000)]
When two function types have equivalent (but distinct) noexcept specifications, create separate type sugar nodes. This is necessary so that substitution into the exception specification will substitute into the correct expression.

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

7 years agoFix clang tests
Mandeep Singh Grang [Tue, 18 Oct 2016 19:22:20 +0000 (19:22 +0000)]
Fix clang tests

Summary:
Add REQUIRES for target specific tests.

Patch by Azharuddin Mohammed.

Reviewers: apazos, weimingz, rsmith, ddunbar, spop, mgrang

Subscribers: sebpop, llvm-commits

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

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

7 years ago[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
Akira Hatanaka [Tue, 18 Oct 2016 19:05:41 +0000 (19:05 +0000)]
[CodeGen][ObjC] Do not call objc_storeStrong when initializing a
constexpr variable.

When compiling a constexpr NSString initialized with an objective-c
string literal, CodeGen emits objc_storeStrong on an uninitialized
alloca, which causes a crash.

This patch folds the code in EmitScalarInit into EmitStoreThroughLValue
and fixes the crash by calling objc_retain on the string instead of
using objc_storeStrong.

rdar://problem/28562009

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

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

7 years agoDrop a redundant ".get()" call (NFC)
Vedant Kumar [Tue, 18 Oct 2016 18:19:02 +0000 (18:19 +0000)]
Drop a redundant ".get()" call (NFC)

Pointed out by Malcolm Parsons.

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

7 years ago[cmake] Update lit search to match the one in LLVM
Michal Gorny [Tue, 18 Oct 2016 17:07:30 +0000 (17:07 +0000)]
[cmake] Update lit search to match the one in LLVM

Update the lit search logic to support all names supported in LLVM
(since r283029). The search order (i.e. PATHS vs HINTS) does no really
matter since the established path is not used, except for determining
whether lit is available.

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

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

7 years agoRevert r284265 "[Sema] Refactor context checking for availability diagnostics"
Erik Pilkington [Tue, 18 Oct 2016 15:26:43 +0000 (15:26 +0000)]
Revert r284265 "[Sema] Refactor context checking for availability diagnostics"

This has a bug in it, pointed out by Bob Wilson!

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

7 years agoalpha.core.UnreachableCode - don't warn about unreachable code inside macro
Daniel Marjamaki [Tue, 18 Oct 2016 13:16:53 +0000 (13:16 +0000)]
alpha.core.UnreachableCode - don't warn about unreachable code inside macro

In macros, 'do {...} while (0)' is often used. Don't warn about the condition 0 when it is unreachable.

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

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

7 years ago[analyzer] Add NumberObjectConversion checker.
Artem Dergachev [Tue, 18 Oct 2016 11:06:28 +0000 (11:06 +0000)]
[analyzer] Add NumberObjectConversion checker.

When dealing with objects that represent numbers, such as Objective-C NSNumber,
the language provides little protection from accidentally interpreting
the value of a pointer to such object as the value of the number represented
by the object. Results of such mis-interpretation may be unexpected.

The checker attempts to fill this gap in cases when the code is obviously
incorrect.

With "Pedantic" option enabled, this checker enforces a coding style to
completely prevent errors of this kind (off by default).

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

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

7 years ago[CodeCompletion] Add a block property setter completion result
Alex Lorenz [Tue, 18 Oct 2016 10:55:01 +0000 (10:55 +0000)]
[CodeCompletion] Add a block property setter completion result

This commit changes code completion results for Objective-C block properties:
clang now suggests an additional completion result that displays the block
property together with '=' and the block literal placeholder for the appropriate
readwrite block properties.

This commit uses a simple heuristic to determine when it's appropriate to
suggest a setter completion for block properties: the additional block setter
completion is provided iff the member access that's being completed is a
standalone statement.

rdar://28481726

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

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

7 years ago[CodeCompletion][NFC] Extract a function that formats block placeholders.
Alex Lorenz [Tue, 18 Oct 2016 10:38:58 +0000 (10:38 +0000)]
[CodeCompletion][NFC] Extract a function that formats block placeholders.

This commit extracts a new function named `formatBlockPlaceholder` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.

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

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

7 years ago[CodeCompletion][NFC] Extract a function that looks for block decl type locs.
Alex Lorenz [Tue, 18 Oct 2016 10:35:27 +0000 (10:35 +0000)]
[CodeCompletion][NFC] Extract a function that looks for block decl type locs.

This commit extracts a new function named `findTypeLocationForBlockDecl` from
the function `FormatFunctionParameter` so that it can be reused in follow-up
commits that improve code completion for block property setters.

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

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

7 years ago[libclang] Add missing cursor kinds to python bindings.
Igor Kudrin [Tue, 18 Oct 2016 09:42:03 +0000 (09:42 +0000)]
[libclang] Add missing cursor kinds to python bindings.

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

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

7 years ago[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.
Igor Kudrin [Tue, 18 Oct 2016 09:30:33 +0000 (09:30 +0000)]
[libclang] Fix a failure in a test for python bindings on CursorKind.OVERLOAD_CANDIDATE.

The test fails because the value does not lay in any existing group.

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

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

7 years ago[c++1z] Include "noexcept" in builtin function types where appropriate. Fixes
Richard Smith [Tue, 18 Oct 2016 07:13:55 +0000 (07:13 +0000)]
[c++1z] Include "noexcept" in builtin function types where appropriate. Fixes
an assertion failure looking up a matching ::operator delete for
__builtin_operator_delete.

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

7 years ago[c++1z] Use canonical expression equivalence to determine whether two different
Richard Smith [Tue, 18 Oct 2016 06:47:03 +0000 (06:47 +0000)]
[c++1z] Use canonical expression equivalence to determine whether two different
dependent noexcept specifications result in the same canonical function type.

We still use non-canonical hashing when deduplicating type sugar so that
diagnostics will point to the right place.

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

7 years ago[analyzer] Update alpha and potential checker documentation, esp. alpha.valist
Dominic Chen [Tue, 18 Oct 2016 01:15:19 +0000 (01:15 +0000)]
[analyzer] Update alpha and potential checker documentation, esp. alpha.valist

Summary:
Move alpha.valist from potential to alpha since it was implemented in D15227

Cleanup some HTML comments, add a missing link

Reviewers: jordan_rose, zaks.anna

Subscribers: cfe-commits, xazax.hun

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

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

7 years ago[CMake] Add a few default passthrough variables for bootstrap builds
Chris Bieneman [Tue, 18 Oct 2016 00:50:20 +0000 (00:50 +0000)]
[CMake] Add a few default passthrough variables for bootstrap builds

This just passes through a few missing CMake variables for multi-stage builds.

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

7 years ago[Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)
Vedant Kumar [Tue, 18 Oct 2016 00:23:27 +0000 (00:23 +0000)]
[Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)

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

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

7 years ago[Driver] Use stem rather than filename for executable name
Petr Hosek [Mon, 17 Oct 2016 22:02:53 +0000 (22:02 +0000)]
[Driver] Use stem rather than filename for executable name

When comparing the linker name in Fuchsia driver, use stem rather
than filename to get the name of the linker becase on Windows, the
filename will have an extension.

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

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

7 years agoExplicitly pass an isysroot to avoid the SDKROOT overriding the deployment target.
Adrian Prantl [Mon, 17 Oct 2016 20:37:56 +0000 (20:37 +0000)]
Explicitly pass an isysroot to avoid the SDKROOT overriding the deployment target.
This fixes the green dragon builders after r284416.

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

7 years agoImprove the CHECK lines in debug-options.c by separating out the check
Adrian Prantl [Mon, 17 Oct 2016 20:14:23 +0000 (20:14 +0000)]
Improve the CHECK lines in debug-options.c by separating out the check
for debug info kind and dwarf version.

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

7 years ago[Coverage] Update test after r284418.
Davide Italiano [Mon, 17 Oct 2016 20:06:32 +0000 (20:06 +0000)]
[Coverage] Update test after r284418.

We now strip coverage metadata if debug info are not present.

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

7 years agoUpdate testcase for r284416.
Adrian Prantl [Mon, 17 Oct 2016 19:46:26 +0000 (19:46 +0000)]
Update testcase for r284416.

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

7 years agoDriver/Darwin: Set the DWARF version based on the deployment target.
Adrian Prantl [Mon, 17 Oct 2016 19:36:18 +0000 (19:36 +0000)]
Driver/Darwin: Set the DWARF version based on the deployment target.

System utilities such as atos only support DWARF 4 on OS X 10.11+ and
iOS 9+. We thus want to enable DWARF 4 only if the deployment target
has a recent enough operating system version and use DWARF 2 for older
systems.

<rdar://problem/28766743>

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

7 years ago[Driver] Use VFS to perform all distribution checks
Michal Gorny [Mon, 17 Oct 2016 18:07:15 +0000 (18:07 +0000)]
[Driver] Use VFS to perform all distribution checks

Use the VFS provided by D.getVFS() for all distribution checks,
including those performing read of the release file. Requested
by @bruno on D24954.

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

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

7 years agoAdd a dummy file in each subdirectory in test/Driver/Inputs/hexagon_tree
Krzysztof Parzyszek [Mon, 17 Oct 2016 18:04:05 +0000 (18:04 +0000)]
Add a dummy file in each subdirectory in test/Driver/Inputs/hexagon_tree

Git does not store empty subdirectories (while SVN does). Git clone of
the clang repository did not create the fake Hexagon installation tree
used for testing the driver. This only became evident after a change
in the Hexagon toolchain that started checking for existence of certain
directories.

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

7 years agoHexagon: add dummy files to test dir so git keeps them.
Tim Northover [Mon, 17 Oct 2016 18:00:27 +0000 (18:00 +0000)]
Hexagon: add dummy files to test dir so git keeps them.

Should fix hexagon-elf-toolchain.c tests on Git.

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

7 years agoFix a typo.
Adrian Prantl [Mon, 17 Oct 2016 17:41:51 +0000 (17:41 +0000)]
Fix a typo.

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

7 years agoReapply r284383. The test failures were due to a missing dir in test/
Krzysztof Parzyszek [Mon, 17 Oct 2016 15:30:10 +0000 (15:30 +0000)]
Reapply r284383. The test failures were due to a missing dir in test/

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

7 years agoRevert r284383, while I figure out how to reproduce the failures locally
Krzysztof Parzyszek [Mon, 17 Oct 2016 14:47:29 +0000 (14:47 +0000)]
Revert r284383, while I figure out how to reproduce the failures locally

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

7 years agoReturn correct path from HexagonToolChain::getHexagonTargetDir
Krzysztof Parzyszek [Mon, 17 Oct 2016 13:23:41 +0000 (13:23 +0000)]
Return correct path from HexagonToolChain::getHexagonTargetDir

This problem was exposed by r284129, causing clang-hexagon-elf to fail
clang tests.

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

7 years agoRevert "Reinstate r281429, reverted in r281452, with a fix for its mishandling of"
Benjamin Kramer [Mon, 17 Oct 2016 13:00:44 +0000 (13:00 +0000)]
Revert "Reinstate r281429, reverted in r281452, with a fix for its mishandling of"

This reverts commit r284176. It still marks some modules as invisible
that should be visible. Will follow up with the author with a test case.

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

7 years agoDo not reset TUScope when we are in incremental processing mode.
Vassil Vassilev [Mon, 17 Oct 2016 10:15:25 +0000 (10:15 +0000)]
Do not reset TUScope when we are in incremental processing mode.

Patch by Axel Naumann!

Reviewed by Richard Smith and me.

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

7 years agoAST: Prefer LLVM_NODISCARD to LLVM_ATTRIBUTE_UNUSED_RESULT
Justin Bogner [Mon, 17 Oct 2016 06:46:35 +0000 (06:46 +0000)]
AST: Prefer LLVM_NODISCARD to LLVM_ATTRIBUTE_UNUSED_RESULT

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

7 years ago[CUDA] Fix false-positive in known-emitted handling.
Justin Lebar [Mon, 17 Oct 2016 02:25:55 +0000 (02:25 +0000)]
[CUDA] Fix false-positive in known-emitted handling.

Previously: When compiling for host, our constructed call graph went
*through* kernel calls.  This meant that if we had

  host calls kernel calls HD

we would incorrectly mark the HD function as known-emitted on the host
side, and thus perform host-side checks on it.

Fixing this exposed another issue, wherein when marking a function as
known-emitted, we also need to traverse the callgraph of its template,
because non-dependent calls are attached to a function's template, not
its instantiation.

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

7 years agoclang/test/CXX/conv/conv.fctptr/p1.cpp: Appease for targeting i686-win32.
NAKAMURA Takumi [Sun, 16 Oct 2016 23:00:18 +0000 (23:00 +0000)]
clang/test/CXX/conv/conv.fctptr/p1.cpp: Appease for targeting i686-win32.

  error: 'error' diagnostics seen but not expected:
    File clang\test\CXX\conv\conv.fctptr\p1.cpp Line 16: assigning to 'void (S::*)() __attribute__((thiscall)) noexcept' from incompatible type 'void (S::*)() __attribute__((thiscall))': different exception specifications

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

7 years agoRevert "Revert "[analyzer] Make MallocChecker more robust against custom redeclarations""
Devin Coughlin [Sun, 16 Oct 2016 22:19:03 +0000 (22:19 +0000)]
Revert "Revert "[analyzer] Make MallocChecker more robust against custom redeclarations""

This reverts commit r284340 to reapply r284335. The bot breakage was due to
an unrelated change in the polybench test suite.

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

7 years agoAST: Improve a couple of comments and cast unused values to void
Justin Bogner [Sun, 16 Oct 2016 20:12:42 +0000 (20:12 +0000)]
AST: Improve a couple of comments and cast unused values to void

Make these comments a bit more explicit that they're initializing the
RawText member, and explicitly cast the unused result of getRawText to
void for clarity.

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

7 years agoRevert "[analyzer] Make MallocChecker more robust against custom redeclarations"
Devin Coughlin [Sun, 16 Oct 2016 19:26:07 +0000 (19:26 +0000)]
Revert "[analyzer] Make MallocChecker more robust against custom redeclarations"

This reverts commit r284335.

It appears to be causing test-suite compile-time and execution-time
performance measurements to take longer than expected on several bots.
This is surprising, because r284335 is a static-analyzer-only change.

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

7 years agoP0012R1: Make exception specifications be part of the type system. This
Richard Smith [Sun, 16 Oct 2016 17:54:23 +0000 (17:54 +0000)]
P0012R1: Make exception specifications be part of the type system. This
implements the bulk of the change (modifying the type system to include
exception specifications), but not all the details just yet.

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

7 years ago[analyzer] Make MallocChecker more robust against custom redeclarations
Devin Coughlin [Sun, 16 Oct 2016 17:26:06 +0000 (17:26 +0000)]
[analyzer] Make MallocChecker more robust against custom redeclarations

Add additional checking to MallocChecker to avoid crashing when memory
routines have unexpected numbers of arguments. You wouldn't expect to see much
of this in normal code (-Wincompatible-library-redeclaration warns on this),
but, for example, CMake tests can generate these.

This is PR30616.

rdar://problem/28631974

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

7 years agoExtend this test and make it a bit clearer which cases Clang is getting wrong.
Richard Smith [Sun, 16 Oct 2016 06:23:29 +0000 (06:23 +0000)]
Extend this test and make it a bit clearer which cases Clang is getting wrong.

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

7 years agoRevert "[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker""
Devin Coughlin [Sun, 16 Oct 2016 00:30:08 +0000 (00:30 +0000)]
Revert "[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker""

Revert:
r283662: [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"
r283660: [analyzer] Fix build error after r283660 - remove constexpr strings.

It was causing an internal build bot to fail. It looks like in some cases
adding an extra note can cause scan-build plist output to drop a diagnostic
altogether.

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

7 years agoDisable a silly GCC diagnostic for combining a scanf length specifier with the
Richard Smith [Sat, 15 Oct 2016 01:59:52 +0000 (01:59 +0000)]
Disable a silly GCC diagnostic for combining a scanf length specifier with the
'*' specifier. Apparently the GNU folks want to discourage self-documenting
code.

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

7 years ago[Coverage] Support for C++17 if initializers
Vedant Kumar [Fri, 14 Oct 2016 23:38:16 +0000 (23:38 +0000)]
[Coverage] Support for C++17 if initializers

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

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

7 years ago[Coverage] Support for C++17 switch initializers
Vedant Kumar [Fri, 14 Oct 2016 23:38:13 +0000 (23:38 +0000)]
[Coverage] Support for C++17 switch initializers

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

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

7 years agoSema: honour dllexport in itanium more faithfully
Saleem Abdulrasool [Fri, 14 Oct 2016 22:25:46 +0000 (22:25 +0000)]
Sema: honour dllexport in itanium more faithfully

Although the itanium environment uses the itanium layout for C++, treat the
dllexport semantics more similarly to the MSVC specification.  This preserves
the existing behaviour for the use of the itanium ABI on non-windows-itanium
environments.  Export the inline definitions too.

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

7 years agoAdd more swift calling convention tests
Arnold Schwaighofer [Fri, 14 Oct 2016 21:55:56 +0000 (21:55 +0000)]
Add more swift calling convention tests

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

7 years agoReinstate r284008 reverted in r284081, with two fixes:
Richard Smith [Fri, 14 Oct 2016 21:41:24 +0000 (21:41 +0000)]
Reinstate r284008 reverted in r284081, with two fixes:

1) Merge and demote variable definitions when we find a redefinition in
MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach
the second case if it's the addition of the initializer itself that converts an
existing declaration into a definition).

2) When rebuilding a redeclaration chain for a variable, if we merge two
definitions together, mark the definitions as merged so the retained definition
is made visible whenever the demoted definition would have been.

Original commit message (from r283882):

[modules] PR28752: Do not instantiate variable declarations which are not visible.

Original patch by Vassil Vassilev! Changes listed above are mine.

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

7 years agoDefine Contiki OS toolchain
David L Kreitzer [Fri, 14 Oct 2016 20:44:33 +0000 (20:44 +0000)]
Define Contiki OS toolchain

Patch by Michael LeMay

Differential revision: http://reviews.llvm.org/D19854

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

7 years ago__builtin_fpclassify missing one int parameter
David Sheinkman [Fri, 14 Oct 2016 20:43:37 +0000 (20:43 +0000)]
__builtin_fpclassify missing one int parameter

Patch by Tania Albarghouthi.

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

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

7 years agoImplement no_sanitize_address for global vars
Douglas Katzman [Fri, 14 Oct 2016 19:55:09 +0000 (19:55 +0000)]
Implement no_sanitize_address for global vars

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

7 years ago[linux] When pre-reserving stack pages to work around broken address space
Richard Smith [Fri, 14 Oct 2016 19:51:36 +0000 (19:51 +0000)]
[linux] When pre-reserving stack pages to work around broken address space
layout for PIE binaries, ask the OS how much stack space is already in use to
avoid stack overflow if we are run with more than 512K of combined command line
arguments + environment variables.

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

7 years ago[Sema] Refactor context checking for availability diagnostics
Erik Pilkington [Fri, 14 Oct 2016 19:08:01 +0000 (19:08 +0000)]
[Sema] Refactor context checking for availability diagnostics

This commit combines a couple of redundant functions that do availability
attribute context checking into a more correct/simpler one.

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

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

7 years agoModule: emit initializers in submodules when importing the parent module.
Manman Ren [Fri, 14 Oct 2016 18:55:44 +0000 (18:55 +0000)]
Module: emit initializers in submodules when importing the parent module.

When importing the parent module, module initializers in submodules should
be emitted.

rdar://28740482

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

7 years agoRevert r284256 due to test failure
Ed Maste [Fri, 14 Oct 2016 18:20:12 +0000 (18:20 +0000)]
Revert r284256 due to test failure

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

7 years agoLink static PIE programs against rcrt0.o on OpenBSD
Ed Maste [Fri, 14 Oct 2016 17:59:53 +0000 (17:59 +0000)]
Link static PIE programs against rcrt0.o on OpenBSD

Patch by Stefan Kempf.

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

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

7 years agoImplement __stosb intrinsic as a volatile memset
Albert Gutowski [Fri, 14 Oct 2016 17:33:05 +0000 (17:33 +0000)]
Implement __stosb intrinsic as a volatile memset

Summary: We need `__stosb` to be an intrinsic, because SecureZeroMemory function uses it without including intrin.h. Implementing it as a volatile memset is not consistent with MSDN specification, but it gives us target-independent IR while keeping the most important properties of `__stosb`.

Reviewers: rnk, hans, thakis, majnemer

Subscribers: cfe-commits

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

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

7 years agoFix for PR30632: Name mangling issue.
Alexey Bataev [Fri, 14 Oct 2016 12:43:59 +0000 (12:43 +0000)]
Fix for PR30632: Name mangling issue.

There was a bug in the implementation of captured statements. If it has
a lambda expression in it and the same lambda expression is used outside
the captured region, clang produced an error:
```
error: definition with same mangled name as another definition
```
Here is an example:
```
struct A {
 template <typename L>
 void g(const L&) { }
};

template<typename T>
void f() {
  {
    A().g([](){});
  }
  A().g([](){});
}

int main() {
  f<void>();
}
```

Error report:
```
main.cpp:3:10: error: definition with same mangled name as another
definition
    void g(const L&) { }
             ^
main.cpp:3:10: note: previous definition is here
```
Patch fixes this bug.

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

7 years agoRemoved duplicate header include
Eric Liu [Fri, 14 Oct 2016 11:48:10 +0000 (11:48 +0000)]
Removed duplicate header include

Reviewers: ioeric

Subscribers: klimek

Patch by Krasimir Georgiev!

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

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

7 years agoTry to fix windows bot file path style failure caused by r284219.
Eric Liu [Fri, 14 Oct 2016 10:10:26 +0000 (10:10 +0000)]
Try to fix windows bot file path style failure caused by r284219.

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

7 years agoDeduplicate sets of replacements by file names.
Eric Liu [Fri, 14 Oct 2016 09:32:06 +0000 (09:32 +0000)]
Deduplicate sets of replacements by file names.

Summary:
If there are multiple <File, Replacements> pairs with the same file
path after removing dots, we only keep one pair (with path after dots being
removed) and discard the rest.

Reviewers: djasper

Subscribers: klimek, hokein, bkramer, cfe-commits

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

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

7 years ago[x86][ms-inline-asm] use of "jmp short" in asm is not supported
Michael Zuckerman [Fri, 14 Oct 2016 08:13:27 +0000 (08:13 +0000)]
[x86][ms-inline-asm] use of "jmp short" in asm is not supported

Test linked to: https://reviews.llvm.org/D24957

Committing in the name of Ziv Izhar: After check-all and LGTM .

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

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

7 years agoFix bogus assert breaking modules self-host.
Richard Smith [Fri, 14 Oct 2016 02:35:11 +0000 (02:35 +0000)]
Fix bogus assert breaking modules self-host.

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

7 years agoUse SubstInitializer instead of SubstExpr when instantiating a default
Richard Smith [Fri, 14 Oct 2016 01:12:20 +0000 (01:12 +0000)]
Use SubstInitializer instead of SubstExpr when instantiating a default
argument, in order to correctly instantiate the initializer.

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

7 years agoReinstate r281429, reverted in r281452, with a fix for its mishandling of
Richard Smith [Thu, 13 Oct 2016 23:04:14 +0000 (23:04 +0000)]
Reinstate r281429, reverted in r281452, with a fix for its mishandling of
compiles without -fmodules-local-submodule-visibility. Original commit message:

[modules] When merging one definition into another, propagate the list of
re-exporting modules from the discarded definition to the retained definition.

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

7 years agoDisable swiftcall test on windows: More brutal way to appease windows bots
Arnold Schwaighofer [Thu, 13 Oct 2016 22:47:03 +0000 (22:47 +0000)]
Disable swiftcall test on windows: More brutal way to appease windows bots

The backtrace on the bot does not give me any indication what is wrong.
The test case interestingly passes in stage2 of the build.
I don't have a way of debugging this.

Disable the test on windows and hope if there is truly a bug in the code that
was causing we will eventually run into this on other platforms.

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

7 years agoAdd 64-bit MS _Interlocked functions as builtins again
Albert Gutowski [Thu, 13 Oct 2016 22:35:07 +0000 (22:35 +0000)]
Add 64-bit MS _Interlocked functions as builtins again

Summary: Previously global 64-bit versions of _Interlocked functions broke buildbots on i386, so now I'm adding them as builtins for x86-64 and ARM only (should they be also on AArch64? I had problems with testing it for AArch64, so I left it)

Reviewers: hans, majnemer, mstorsjo, rnk

Subscribers: cfe-commits, aemerson

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

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

7 years agofix _BitScan intrinsics missing header warnings; fix some line endings
Albert Gutowski [Thu, 13 Oct 2016 21:55:16 +0000 (21:55 +0000)]
fix _BitScan intrinsics missing header warnings; fix some line endings

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

7 years ago[analyzer] Remove superquadratic behaviour from DataflowWorklist
Alexander Shaposhnikov [Thu, 13 Oct 2016 21:31:46 +0000 (21:31 +0000)]
[analyzer] Remove superquadratic behaviour from DataflowWorklist

The class DataflowWorklist internally maintains a sorted list of pointers to CFGBlock
and the method enqueuePredecessors has to call sortWorklist to maintain the invariant.
The implementation based on vector + sort works well for small sizes
but gets infeasible for relatively large sizes. In particular the issue takes place
for some cryptographic libraries which use code generation.
The diff replaces vector + sort with priority queue.
For one of the implementations of AES this patch reduces
the time for analysis from 204 seconds to 8 seconds.

Test plan: make -j8 check-clang

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

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

7 years agoAdd required targets to tests to (hopefully) appease bots
Arnold Schwaighofer [Thu, 13 Oct 2016 20:59:23 +0000 (20:59 +0000)]
Add required targets to tests to (hopefully) appease bots

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

7 years agoAdd and use isDiscardableGVALinkage function.
Justin Lebar [Thu, 13 Oct 2016 20:52:17 +0000 (20:52 +0000)]
Add and use isDiscardableGVALinkage function.

Reviewers: rnk

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Emit deferred diagnostics during Sema rather than during codegen.
Justin Lebar [Thu, 13 Oct 2016 20:52:12 +0000 (20:52 +0000)]
[CUDA] Emit deferred diagnostics during Sema rather than during codegen.

Summary:
Emitting deferred diagnostics during codegen was a hack.  It did work,
but usability was poor, both for us as compiler devs and for users.  We
don't codegen if there are any sema errors, so for users this meant that
they wouldn't see deferred errors if there were any non-deferred errors.
For devs, this meant that we had to carefully split up our tests so that
when we tested deferred errors, we didn't emit any non-deferred errors.

This change moves checking for deferred errors into Sema.  See the big
comment in SemaCUDA.cpp for an overview of the idea.

This checking adds overhead to compilation, because we have to maintain
a partial call graph.  As a result, this change makes deferred errors a
CUDA-only concept (whereas before they were a general concept).  If
anyone else wants to use this framework for something other than CUDA,
we can generalize at that time.

This patch makes the minimal set of test changes -- after this lands,
I'll go back through and do a cleanup of the tests that we no longer
have to split up.

Reviewers: rnk

Subscribers: cfe-commits, rsmith, tra

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

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

7 years agotest: attempt to repair SCEI buildbots
Saleem Abdulrasool [Thu, 13 Oct 2016 20:10:22 +0000 (20:10 +0000)]
test: attempt to repair SCEI buildbots

The tests target ARM, ensure that the ARM target is registered.

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

7 years agoCodeGen: ensure that the runtime calling convention matches
Saleem Abdulrasool [Thu, 13 Oct 2016 19:45:08 +0000 (19:45 +0000)]
CodeGen: ensure that the runtime calling convention matches

Incorrect specification of the calling convention results in UB which can cause
the code path to be eliminated.  Simplify the existing code by using the
RuntimeCall constructor in `CodeGenFunction`.

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

7 years agoSwift Calling Convention: Fix out of bounds access
Arnold Schwaighofer [Thu, 13 Oct 2016 19:19:37 +0000 (19:19 +0000)]
Swift Calling Convention: Fix out of bounds access

Use iterator instead of address of element in vector

It is not valid to access one after the last element.

rdar://28759508

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

7 years ago[CUDA] Allow static variables in __host__ __device__ functions, so long as they're...
Justin Lebar [Thu, 13 Oct 2016 18:45:17 +0000 (18:45 +0000)]
[CUDA] Allow static variables in __host__ __device__ functions, so long as they're never codegen'ed for device.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Disallow __shared__ variables in host functions.
Justin Lebar [Thu, 13 Oct 2016 18:45:13 +0000 (18:45 +0000)]
[CUDA] Disallow __shared__ variables in host functions.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIf{Device,Host}Code().
Justin Lebar [Thu, 13 Oct 2016 18:45:08 +0000 (18:45 +0000)]
[CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIf{Device,Host}Code().

Summary:
Together these let you easily create diagnostics that

 - are never emitted for host code
 - are always emitted for __device__ and __global__ functions, and
 - are emitted for __host__ __device__ functions iff these functions are
   codegen'ed.

At the moment there are only three diagnostics that need this treatment,
but I have more to add, and it's not sustainable to write code for emitting
every such diagnostic twice, and from a special wrapper in SemaCUDA.cpp.

While we're at it, don't emit the function name in
err_cuda_device_exceptions: It's not necessary to print it, and making
this work in the new framework in the face of a null value for
dyn_cast<FunctionDecl>(CurContext) isn't worth the effort.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years agoModule: emit initializers for C/ObjC after r276159.
Manman Ren [Thu, 13 Oct 2016 18:42:14 +0000 (18:42 +0000)]
Module: emit initializers for C/ObjC after r276159.

In r276159, we started to defer emitting initializers for VarDecls, but
forgot to add the initializers for non-C++ language.

rdar://28740482

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

7 years agoPass -ffunction-sections/-fdata-sections along to gold-plugin
Teresa Johnson [Thu, 13 Oct 2016 18:05:53 +0000 (18:05 +0000)]
Pass -ffunction-sections/-fdata-sections along to gold-plugin

Summary:
These options need to be passed to the plugin in order to have
an effect on LTO/ThinLTO compiles.

Reviewers: mehdi_amini, pcc

Subscribers: jfb, dschuff, mehdi_amini, cfe-commits

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

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

7 years ago[ThinLTO] Update doc to include lld (now supported).
Davide Italiano [Thu, 13 Oct 2016 17:42:38 +0000 (17:42 +0000)]
[ThinLTO] Update doc to include lld (now supported).

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

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

7 years agoAdd more 64bit swiftcall convention tests
Arnold Schwaighofer [Thu, 13 Oct 2016 17:17:36 +0000 (17:17 +0000)]
Add more 64bit swiftcall convention tests

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

7 years agoImplement MS _ReturnAddress and _AddressOfReturnAddress intrinsics
Albert Gutowski [Thu, 13 Oct 2016 16:03:42 +0000 (16:03 +0000)]
Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsics

Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

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

7 years agoGuard flag –fdenormal-fp-math with –fno-fast-math.
Sjoerd Meijer [Thu, 13 Oct 2016 13:22:01 +0000 (13:22 +0000)]
Guard flag –fdenormal-fp-math with –fno-fast-math.
This allows disabling the FP options with just one flag (-fno-fast-math).

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

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

7 years ago[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.
Artem Dergachev [Thu, 13 Oct 2016 11:41:12 +0000 (11:41 +0000)]
[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.

AST matchers are useful for the analyzer's checkers.
More patches on particular checkers shall follow.

This is the first time clang binary gets linked to ASTMatchers.
The binary size increase for the clang executable would be
+0.5% in release mode, +2% in debug mode.

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

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

7 years agoFix for PR30639: CGDebugInfo Null dereference with OpenMP array
Alexey Bataev [Thu, 13 Oct 2016 09:52:46 +0000 (09:52 +0000)]
Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
access, by Erich Keane

OpenMP creates a variable array type with a a null size-expr. The Debug
generation failed to due to this. This patch corrects the openmp
implementation, updates the tests, and adds a new one for this
condition.

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

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

7 years ago[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS
Devin Coughlin [Wed, 12 Oct 2016 23:57:05 +0000 (23:57 +0000)]
[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS

On macOS (but not iOS), if an ObjC property has no setter, the nib-loading code
for an IBOutlet is documented as directly setting the backing ivar without
retaining the value -- even if the property is 'retain'.

This resulted in false positives from the DeallocChecker for code that did not
release such ivars in -dealloc.

To avoid these false positives, treat IBOutlet ivars that back a property
without a setter as having an unknown release requirement in macOS.

rdar://problem/28507353

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

7 years agofix ms-intrinsics labels code to work with builds with assertions
Albert Gutowski [Wed, 12 Oct 2016 23:52:38 +0000 (23:52 +0000)]
fix ms-intrinsics labels code to work with builds with assertions

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

7 years agoRevert r284008. This is us to fail to instantiate static data members in some
Richard Smith [Wed, 12 Oct 2016 23:29:02 +0000 (23:29 +0000)]
Revert r284008. This is us to fail to instantiate static data members in some
cases. I'm working on reducing a testcase.

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