]> granicus.if.org Git - clang/log
clang
6 years ago[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.
Sam McCall [Thu, 9 Nov 2017 10:37:39 +0000 (10:37 +0000)]
[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.

Summary:
This is an alternative to JSONCompilationDatabase for simple projects that
don't use a build system such as CMake.
(You can also drop one in ~, to make your tools use e.g. C++11 by default)

There's no facility for varying flags per-source-file or per-machine.
Possibly this could be accommodated backwards-compatibly using cpp, but even if
not the simplicity seems worthwhile for the cases that are addressed.

Tested with clangd, works great! (requires clangd restart)

Reviewers: klimek

Subscribers: ilya-biryukov, cfe-commits

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

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

6 years agoFix a bug with the use of __builtin_bzero in a conditional expression.
John McCall [Thu, 9 Nov 2017 09:32:32 +0000 (09:32 +0000)]
Fix a bug with the use of __builtin_bzero in a conditional expression.

Patch by Bharathi Seshadri!

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

7 years ago[X86] Rename the VEX scalar fma builtins to end with a '3' to match gcc
Craig Topper [Thu, 9 Nov 2017 04:10:46 +0000 (04:10 +0000)]
[X86] Rename the VEX scalar fma builtins to end with a '3' to match gcc

I think we need to use different builtins for the FMA4 instructions since those instructions zero the upper bits and FMA3 instructions pass the bits through.

So this moves the existing builtins to be the FMA3 versions. New versions will be added for FMA4.

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

7 years ago[Coverage] Emit deferred regions in headers
Vedant Kumar [Thu, 9 Nov 2017 02:33:40 +0000 (02:33 +0000)]
[Coverage] Emit deferred regions in headers

There are some limitations with emitting regions in macro expansions
because we don't gather file IDs within the expansions. Fix the check
that prevents us from emitting deferred regions in expansions to make an
exception for headers, which is something we can handle.

rdar://35373009

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

7 years ago[Coverage] Complete top-level deferred regions before labels
Vedant Kumar [Thu, 9 Nov 2017 02:33:39 +0000 (02:33 +0000)]
[Coverage] Complete top-level deferred regions before labels

The area immediately after a terminated region in the function top-level
should have the same count as the label it precedes.

This solves another problem with wrapped segments. Consider:

  1| a:
  2|   return 0;
  3| b:
  4|   return 1;

Without a gap area starting after the first return, the wrapped segment
from line 2 would make it look like line 3 is executed, when it's not.

rdar://35373009

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

7 years ago[Coverage] Emit a gap area after if conditions
Vedant Kumar [Thu, 9 Nov 2017 02:33:38 +0000 (02:33 +0000)]
[Coverage] Emit a gap area after if conditions

The area immediately after the closing right-paren of an if condition
should have a count equal to the 'then' block's count. Use a gap region
to set this count, so that region highlighting for the 'then' block
remains precise.

This solves a problem we have with wrapped segments. Consider:

  1| if (false)
  2|   foo();

Without a gap area starting after the condition, the wrapped segment
from line 1 would make it look like line 2 is executed, when it's not.

rdar://35373009

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

7 years agoRemove redundant copy-pasted comment in test file from r317736
Alex Lorenz [Wed, 8 Nov 2017 22:47:15 +0000 (22:47 +0000)]
Remove redundant copy-pasted comment in test file from r317736

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

7 years ago[ObjC] Fix function signature handling for blocks literals with attributes
Alex Lorenz [Wed, 8 Nov 2017 22:44:34 +0000 (22:44 +0000)]
[ObjC] Fix function signature handling for blocks literals with attributes

Block literals can have a type with attributes in its signature, e.g.
ns_returns_retained. The code that inspected the type loc of the block when
declaring its parameters didn't account for this fact, and only looked through
paren type loc. This commit ensures that getAsAdjusted is used instead of
IgnoreParens to find the block's FunctionProtoTypeLoc. This ensures that
block parameters are declared correctly in the block and avoids the
'undeclared identifier' error.

rdar://35416160

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

7 years ago[ObjC] Boxed strings should use the nullability from stringWithUTF8String's return...
Alex Lorenz [Wed, 8 Nov 2017 21:33:15 +0000 (21:33 +0000)]
[ObjC] Boxed strings should use the nullability from stringWithUTF8String's return type

Objective-C NSString has a class method stringWithUTF8String that creates a new
NSString from a C string. Objective-C box expression @(...) can be used to
create an NSString instead of invoking the stringWithUTF8String method directly
(The compiler lowers it down to the invocation though). This commit ensures that
the type of @(string-value) gets the same nullability attributes as the return
type of stringWithUTF8String to ensure that the diagnostics are consistent
between the two.

rdar://33847186

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

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

7 years ago[OPENMP] Codegen for `#pragma omp target parallel for`.
Alexey Bataev [Wed, 8 Nov 2017 20:16:14 +0000 (20:16 +0000)]
[OPENMP] Codegen for `#pragma omp target parallel for`.

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

7 years agoAdd a missing "REQUIRES: system-windows" to a Windows-only test.
David L. Jones [Wed, 8 Nov 2017 20:03:11 +0000 (20:03 +0000)]
Add a missing "REQUIRES: system-windows" to a Windows-only test.

This un-breaks builds on other platforms. Otherwise, they fail due to warnings like:

warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]

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

7 years agoAdd CoreOption flag to "-coverage" option to make it available for clang-cl
Marco Castelluccio [Wed, 8 Nov 2017 19:21:54 +0000 (19:21 +0000)]
Add CoreOption flag to "-coverage" option to make it available for clang-cl

Summary:
The -coverage option is not a CoreOption, so it is not available to clang-cl.
This patch adds the CoreOption flag to "-coverage" to allow it to be used with clang-cl.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

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

7 years ago[bindings] fix TLS test failure
Masud Rahman [Wed, 8 Nov 2017 19:17:27 +0000 (19:17 +0000)]
[bindings] fix TLS test failure

Since cfe commit r237337, '__declspec(thread)' and 'thread_local' have
been the same since MSVC 2015.  i.e. they are both considered to supply
a dynamic TLS kind, not a static TLS kind.

This test originally did not specify which version of MS compatibility
to assume.  As a result, the test was brittle, since changing the
default compatibility version could break the test.

This commit adds a specific version when building up the flags used to
parse the translation unit, and tests both versions.

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

7 years ago[analyzer] Fix a crash on logical operators with vectors.
Artem Dergachev [Wed, 8 Nov 2017 17:27:58 +0000 (17:27 +0000)]
[analyzer] Fix a crash on logical operators with vectors.

Do not crash when trying to compute x && y or x || y where x and y are
of a vector type.

For now we do not seem to properly model operations with vectors. In particular,
operations && and || on a pair of vectors are not short-circuit, unlike regular
logical operators, so even our CFG is incorrect.

Avoid the crash, add respective FIXME tests for later.

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

rdar://problem/34317663

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

7 years ago[clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFC
Haojian Wu [Wed, 8 Nov 2017 14:53:08 +0000 (14:53 +0000)]
[clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFC

Summary:
The OccurrencesFinder is only used in RenameOccurrences to find symbol
occurrences, there is no need to inherit RefactoringRule.

Replace it with a single utility function to avoid code misleading.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

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

7 years agoWorkaround reverse-iteration buildbot breakages. Filed PR35244.
Ilya Biryukov [Wed, 8 Nov 2017 13:05:52 +0000 (13:05 +0000)]
Workaround reverse-iteration buildbot breakages. Filed PR35244.

Clang's completion output is non-deterministic, causing test failures
with turned on LLVM_REVERSE_ITERATION.
The workaround is to use CHECK-DAGs for now, will remove them when
PR35244 gets fixed.

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

7 years agoAvoid printing some redundant name qualifiers in completion
Ilya Biryukov [Wed, 8 Nov 2017 10:39:09 +0000 (10:39 +0000)]
Avoid printing some redundant name qualifiers in completion

Summary:
Adjusted PrintingPolicy inside code completion to avoid printing some
redundant name qualifiers.

Before this change, typedefs that were written unqualified in source
code were printed with qualifiers in completion. For example, in the
following code

    struct foo {
        typedef int type;
        type method();
    };

completion item for `method` had return type of `foo::type`, even
though the original code used `type` without qualifiers.
After this change, the completion item has return type `type`, as
originally written in the source code.

Note that this change does not suppress qualifiers written by the
user. For example, in the following code

    typedef int type;
    struct foo {
        typedef int type;
        ::type method(foo::type);
    };

completion item for `method` has return type of `::type` and
parameter type of `foo::type`, as originally written in the source
code.

Reviewers: arphaman, bkramer, klimek

Reviewed By: arphaman

Subscribers: mgorny, eraman, cfe-commits

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

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

7 years agoMoved QualTypeNames.h from Tooling to AST.
Ilya Biryukov [Wed, 8 Nov 2017 10:39:03 +0000 (10:39 +0000)]
Moved QualTypeNames.h from Tooling to AST.

Summary:
For code reuse in SemaCodeComplete.
Note that the tests for QualTypeNames are still in Tooling as they use
Tooling's common testing code.

Reviewers: rsmith, saugustine, rnk, klimek, bkramer

Reviewed By: rnk

Subscribers: cfe-commits, mgorny

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

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

7 years ago[clang-refactor] Introduce a new rename rule for qualified symbols
Haojian Wu [Wed, 8 Nov 2017 08:56:56 +0000 (08:56 +0000)]
[clang-refactor] Introduce a new rename rule for qualified symbols

Summary: Prototype of a new rename rule for renaming qualified symbol.

Reviewers: arphaman, ioeric, sammccall

Reviewed By: arphaman, sammccall

Subscribers: jklaehn, cfe-commits, klimek

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

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

7 years ago[X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.
Craig Topper [Wed, 8 Nov 2017 04:54:26 +0000 (04:54 +0000)]
[X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.

This ensures that only immediates that fit in 8-bits are used. This matches what we do for the unmasked versions.

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

7 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Wed, 8 Nov 2017 01:03:16 +0000 (01:03 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 8 Nov 2017 00:39:18 +0000 (00:39 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoChange noplt.c to work for non-x86 targets.
Sriraman Tallam [Tue, 7 Nov 2017 22:34:55 +0000 (22:34 +0000)]
Change noplt.c to work for non-x86 targets.

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

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

7 years ago[NVPTX] Implement __nvvm_atom_add_gen_d builtin.
Justin Lebar [Tue, 7 Nov 2017 22:10:54 +0000 (22:10 +0000)]
[NVPTX] Implement __nvvm_atom_add_gen_d builtin.

Summary:
This just seems to have been an oversight.  We already supported the f64
atomic add with an explicit scope (e.g. "cta"), but not the scopeless
version.

Reviewers: tra

Subscribers: jholewinski, sanjoy, cfe-commits, llvm-commits, hiraditya

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

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

7 years ago[ObjC++] Don't warn about pessimizing move for __block variables
Alex Lorenz [Tue, 7 Nov 2017 21:40:11 +0000 (21:40 +0000)]
[ObjC++] Don't warn about pessimizing move for __block variables

rdar://33316951

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

7 years agoUpdate SanitizerSpecialCaseList to use renamed functions in base class.
Mitch Phillips [Tue, 7 Nov 2017 21:16:37 +0000 (21:16 +0000)]
Update SanitizerSpecialCaseList to use renamed functions in base class.

Note: This change has a cyclical dependency on D39485. Both these changes must be submitted at the same time to avoid a build breakage.

Reviewers: vlad.tsyrklevich

Subscribers: llvm-commits

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

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

7 years agoNew clang option -fno-plt which avoids the PLT and lazy binding while making external...
Sriraman Tallam [Tue, 7 Nov 2017 19:37:51 +0000 (19:37 +0000)]
New clang option -fno-plt which avoids the PLT and lazy binding while making external calls.

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

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

7 years ago[refactor] rename field references in __builtin_offsetof
Alex Lorenz [Tue, 7 Nov 2017 18:30:23 +0000 (18:30 +0000)]
[refactor] rename field references in __builtin_offsetof

rdar://33875453

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

7 years agoClang/libomptarget map interface flag renaming - NFC patch
George Rokos [Tue, 7 Nov 2017 18:27:04 +0000 (18:27 +0000)]
Clang/libomptarget map interface flag renaming - NFC patch

This patch renames some of the flag names of the clang/libomptarget map interface. The old names are slightly misleading, whereas the new ones describe in a better way what each flag is about.

Only the macros within the enumeration are renamed, there is no change in functionality therefore there are no updated regression tests.

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

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

7 years ago[index] __builtin_offset's field reference is located at the end location
Alex Lorenz [Tue, 7 Nov 2017 18:25:36 +0000 (18:25 +0000)]
[index] __builtin_offset's field reference is located at the end location

The starting location is the location of the '.'

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

7 years ago[index] index field references in __builtin_offset
Alex Lorenz [Tue, 7 Nov 2017 17:29:11 +0000 (17:29 +0000)]
[index] index field references in __builtin_offset

rdar://35109556

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

7 years agoSystemZ Swift TargetInfo: swifterror support in the backend is broken
Arnold Schwaighofer [Tue, 7 Nov 2017 16:40:51 +0000 (16:40 +0000)]
SystemZ Swift TargetInfo: swifterror support in the backend is broken

Return false for swifterror support until the backend is fixed.

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

7 years ago[CodeGen] split math and complex tests into separate files; NFCI
Sanjay Patel [Tue, 7 Nov 2017 15:13:22 +0000 (15:13 +0000)]
[CodeGen] split math and complex tests into separate files; NFCI

The files are already large, and we may need to add even more RUNs to
distinguish differences based on OS, environment, or other platform things.

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

7 years ago[clang-refactor] Use ClangTool more explicitly by making refaroing actions AST fronte...
Eric Liu [Tue, 7 Nov 2017 14:35:03 +0000 (14:35 +0000)]
[clang-refactor] Use ClangTool more explicitly by making refaroing actions AST frontend actions.

Summary: This is a refactoring change. NFC

Reviewers: arphaman, hokein

Reviewed By: arphaman, hokein

Subscribers: cfe-commits

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

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

7 years ago[analyzer] pr34779: CStringChecker: Accept non-standard headers.
Artem Dergachev [Tue, 7 Nov 2017 10:51:15 +0000 (10:51 +0000)]
[analyzer] pr34779: CStringChecker: Accept non-standard headers.

Do not crash when trying to define and call a non-standard
strcpy(unsigned char *, unsigned char *) during analysis.

At the same time, do not try to actually evaluate the call.

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

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

7 years ago[docs] Add section 'Half-Precision Floating Point'
Sjoerd Meijer [Tue, 7 Nov 2017 10:09:45 +0000 (10:09 +0000)]
[docs] Add section 'Half-Precision Floating Point'

This documents the differences/interactions between _Float16 and __fp16
and is a companion change for the _Float16 type implementation (r312794).

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

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

7 years ago[analyzer] [NFC] Remove unused typedef from SVals.h
George Karpenkov [Tue, 7 Nov 2017 02:02:10 +0000 (02:02 +0000)]
[analyzer] [NFC] Remove unused typedef from SVals.h

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

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

7 years agoClarify the error message for unsupported aliases on Darwin
Alex Lorenz [Tue, 7 Nov 2017 00:31:19 +0000 (00:31 +0000)]
Clarify the error message for unsupported aliases on Darwin

rdar://35109556

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

7 years ago[analyzer] Model correct dispatch_once() 'done' value in BodyFarm
Devin Coughlin [Mon, 6 Nov 2017 22:12:19 +0000 (22:12 +0000)]
[analyzer] Model correct dispatch_once() 'done' value in BodyFarm

The analyzer's BodyFarm models dispatch_once() by comparing the passed-in
predicate against a known 'done' value. If the predicate does not have that
value, the model updates the predicate to have that value and executes the
passed in block.

Unfortunately, the current model uses the wrong 'done' value: 1 instead of ~0.
This interferes with libdispatch's static inline function _dispatch_once(),
which enables a fast path if the block has already been executed. That function
uses __builtin_assume() to tell the compiler that the done flag is set to ~0 on
exit. When r302880 added modeling of __builtin_assume(), this caused the
analyzer to assume 1 == ~0. This in turn caused the analyzer to never explore any code after a call to dispatch_once().

This patch regains the missing coverage by updating BodyFarm to use the correct
'done' value.

rdar://problem/34413048

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

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

7 years agoVary Windows toolchain selection by -fuse-ld
Dave Lee [Mon, 6 Nov 2017 21:18:05 +0000 (21:18 +0000)]
Vary Windows toolchain selection by -fuse-ld

Summary:
This change allows binutils to be used for linking with MSVC. Currently, when
using an MSVC target and `-fuse-ld=bfd`, the driver produces an invalid linker
invocation.

Reviewers: rnk, compnerd

Reviewed By: compnerd

Subscribers: smeenai, cfe-commits

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

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

7 years ago[X86] Replace the mask cmpeq/cmple/cmplt/cmpgt/cmpge/cmpneq intrinsics with macros...
Craig Topper [Mon, 6 Nov 2017 21:00:49 +0000 (21:00 +0000)]
[X86] Replace the mask cmpeq/cmple/cmplt/cmpgt/cmpge/cmpneq intrinsics with macros that just pass the right comparison predicate value to the regular cmp intrinsic. Remove mask cmpeq/cmpgt builtins that are now unused.

This shortens the intrinsic headers a little and allows us to get rid of the cmpeq and cmpgt handling from CGBuiltin.cpp.

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

7 years ago[X86] Add 3dnow and 3dnowa to the list of valid target features
Martin Storsjo [Mon, 6 Nov 2017 20:33:13 +0000 (20:33 +0000)]
[X86] Add 3dnow and 3dnowa to the list of valid target features

These were missed in SVN r316783, which broke compiling mingw-w64 CRT.

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

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

7 years ago[Parser] Fix TryParseLambdaIntroducer() error handling
Jan Korous [Mon, 6 Nov 2017 17:42:17 +0000 (17:42 +0000)]
[Parser] Fix TryParseLambdaIntroducer() error handling

rdar://35066196

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

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

7 years ago[CodeGen] match new fast-math-flag method: isFast()
Sanjay Patel [Mon, 6 Nov 2017 16:27:36 +0000 (16:27 +0000)]
[CodeGen] match new fast-math-flag method: isFast()

This corresponds to LLVM commiti r317488:

If that commit is reverted, this commit will also need to be reverted.

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

7 years ago[clang-format] Handle unary operator overload with arguments and specifiers
Daniel Jasper [Mon, 6 Nov 2017 12:11:51 +0000 (12:11 +0000)]
[clang-format] Handle unary operator overload with arguments and specifiers

Before:
  int operator++(int)noexcept;

After:
  int operator++(int) noexcept;

Patch by Igor Sugak. Thank you!

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

7 years ago[Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of the wrapper.
Eric Liu [Mon, 6 Nov 2017 09:29:09 +0000 (09:29 +0000)]
[Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of the wrapper.

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

7 years agolowering broadcastm
Jina Nahias [Mon, 6 Nov 2017 07:04:12 +0000 (07:04 +0000)]
lowering broadcastm

Change-Id: I0661abea3e3742860e0a03ff9e4fcdc367eff7db

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

7 years agoRemove \brief from doxygen comments in PrettyPrinter.h
Adrian Prantl [Sun, 5 Nov 2017 21:52:36 +0000 (21:52 +0000)]
Remove \brief from doxygen comments in PrettyPrinter.h

Patch by @xsga!

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

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

7 years ago[clang-diff] NFC: format
Johannes Altmanninger [Sun, 5 Nov 2017 11:53:18 +0000 (11:53 +0000)]
[clang-diff] NFC: format

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

7 years ago[Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]
Roman Lebedev [Sat, 4 Nov 2017 20:27:47 +0000 (20:27 +0000)]
[Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]

Basically a regression after r316268.
However the diagnostic is correct, but the test coverage is bad.

So just like rL316500, introduce yet more tests,
and adjust the release notes.

See https://bugs.llvm.org/show_bug.cgi?id=35200

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

7 years agoMove the clang-tblgen-targets project into the Misc folder on IDEs like Visual Studio...
Aaron Ballman [Sat, 4 Nov 2017 20:06:49 +0000 (20:06 +0000)]
Move the clang-tblgen-targets project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

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

7 years agoMove the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual...
Aaron Ballman [Sat, 4 Nov 2017 20:06:22 +0000 (20:06 +0000)]
Move the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

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

7 years agoMove the libclang-headers project into the Misc folder on IDEs like Visual Studio...
Aaron Ballman [Sat, 4 Nov 2017 20:00:21 +0000 (20:00 +0000)]
Move the libclang-headers project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

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

7 years ago[CodeGen] add remquo to list of recognized library calls
Sanjay Patel [Sat, 4 Nov 2017 15:03:11 +0000 (15:03 +0000)]
[CodeGen] add remquo to list of recognized library calls

This is just an oversight because we already do recognize __builtin_remquo()
with the same signature.

http://en.cppreference.com/w/c/numeric/math/remquo
http://pubs.opengroup.org/onlinepubs/9699919799/functions/remquo.html

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

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

7 years agoCodeGenCXX: no default dllimport storage for mingw
Martell Malone [Sat, 4 Nov 2017 02:15:49 +0000 (02:15 +0000)]
CodeGenCXX: no default dllimport storage for mingw

GNU frontends don't have options like /MT, /MD
This fixes a few link error regressions with libc++ and libc++abi

Reviewers: rnk, mstorsjo, compnerd

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

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

7 years ago[Driver] MinGW: Remove custom linker detection
Martell Malone [Sat, 4 Nov 2017 02:07:59 +0000 (02:07 +0000)]
[Driver] MinGW: Remove custom linker detection

This is a re-apply of rL313082 which was reverted in rL313088

In rL289668 the ability to specify the default linker at compile time
was added but because the MinGW driver used custom detection we could
not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER.

rL289668 added no test cases and the mingw driver was either overlooked
or purposefully skipped because it has some custom linker tests
Removing them here because they are covered by the generic case.

Reviewers: rnk

Differntial Revision: https://reviews.llvm.org/D37727

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

7 years agoUpdate ODR hashing tests
Richard Trieu [Sat, 4 Nov 2017 01:20:50 +0000 (01:20 +0000)]
Update ODR hashing tests

Add a mix of postive and negative tests to check that wrong Decls won't be
flagged in the diagnostic.  Split the check everything test and moved the
pieces closer to where the related tests are.

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

7 years ago[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 3 Nov 2017 22:35:27 +0000 (22:35 +0000)]
[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoAdd -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots
Alex Lorenz [Fri, 3 Nov 2017 21:31:10 +0000 (21:31 +0000)]
Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots

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

7 years agoReplace a use of std::for_each() with llvm::for_each(); NFC.
Aaron Ballman [Fri, 3 Nov 2017 20:09:17 +0000 (20:09 +0000)]
Replace a use of std::for_each() with llvm::for_each(); NFC.

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

7 years agoMove Extract.cpp that wasn't moved in r317343
Alex Lorenz [Fri, 3 Nov 2017 18:21:06 +0000 (18:21 +0000)]
Move Extract.cpp that wasn't moved in r317343

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

7 years ago[refactor][extract] insert semicolons into extracted/inserted code
Alex Lorenz [Fri, 3 Nov 2017 18:11:22 +0000 (18:11 +0000)]
[refactor][extract] insert semicolons into extracted/inserted code
when needed

This commit implements the semicolon insertion logic into the extract
refactoring. The following rules are used:

- extracting expression: add terminating ';' to the extracted function.
- extracting statements that don't require terminating ';' (e.g. switch): add
  terminating ';' to the callee.
- extracting statements with ';':  move (if possible) the original ';' from the
  callee and add terminating ';'.
- otherwise, add ';' to both places.

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

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

7 years ago[Driver] Add Scudo as a possible -fsanitize= option
Kostya Kortchinsky [Fri, 3 Nov 2017 17:04:13 +0000 (17:04 +0000)]
[Driver] Add Scudo as a possible -fsanitize= option

Summary:
This change adds Scudo as a possible Sanitizer option via -fsanitize=.
This allows for easier static & shared linking of the Scudo library, it allows
us to enforce PIE (otherwise the security of the allocator is moot), and check
for incompatible Sanitizers combo.

In its current form, Scudo is not compatible with any other Sanitizer, but the
plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined),
which will require additional work outside of the scope of this change.

Reviewers: eugenis, kcc, alekseyshl

Reviewed By: eugenis, alekseyshl

Subscribers: llvm-commits, srhines

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

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

7 years ago[CodeGen] add libcall attr tests to show errno-related diffs; NFC
Sanjay Patel [Fri, 3 Nov 2017 16:27:27 +0000 (16:27 +0000)]
[CodeGen] add libcall attr tests to show errno-related diffs; NFC

See rL317220 for the builtin siblings.

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

7 years ago[Tooling] Fix linking of StandaloneToolExecutorPlugin.
Eric Liu [Fri, 3 Nov 2017 15:57:27 +0000 (15:57 +0000)]
[Tooling] Fix linking of StandaloneToolExecutorPlugin.

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

7 years ago[Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
Eric Liu [Fri, 3 Nov 2017 15:20:57 +0000 (15:20 +0000)]
[Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC

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

7 years ago[clang-format] Sort using-declarations case sensitively with a special case for '_'
Krasimir Georgiev [Fri, 3 Nov 2017 14:38:07 +0000 (14:38 +0000)]
[clang-format] Sort using-declarations case sensitively with a special case for '_'

Summary:
This makes clang-format sort using declarations case-sensitive with the
exception that '_' comes just before 'A'. This is better than the current case
insensitive version, because it groups uppercase names in the same namespace
together.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

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

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

7 years ago[preamble] Also record the "skipping" state of the preprocessor
Erik Verbruggen [Fri, 3 Nov 2017 09:40:07 +0000 (09:40 +0000)]
[preamble] Also record the "skipping" state of the preprocessor

When a preamble ends in a conditional preprocessor block that is being
skipped, the preprocessor needs to continue skipping that block when
the preamble is used.

This fixes PR34570.

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

7 years ago[CUDA] Mark CUDA as a no-errno platform.
Justin Lebar [Fri, 3 Nov 2017 02:30:00 +0000 (02:30 +0000)]
[CUDA] Mark CUDA as a no-errno platform.

Summary:
CUDA doesn't support errno at all, so this is the right thing -- or at
least, in the right direction.

But also, this unbreaks the CUDA test-suite math tests [0] after D39481.
__cuda_cmath.h forwards nexttoward() to __builtin_nexttoward, which,
after that patch, was lowering to a libcall that doesn't exist in NVPTX.

[0] http://lab.llvm.org:8011/builders/clang-cuda-build/builds/14999

Reviewers: tra

Subscribers: sanjoy, cfe-commits

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

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

7 years ago[c++17] Visit class template explicit specializations just like all other class defin...
Richard Smith [Fri, 3 Nov 2017 01:26:01 +0000 (01:26 +0000)]
[c++17] Visit class template explicit specializations just like all other class definitions in codegen.

If an explicit specialization has a static data member, it may be a definition and we may need to register it for emission.

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

7 years ago[analyzer] [NFC] very minor ExprEngineC refactoring
George Karpenkov [Fri, 3 Nov 2017 00:41:29 +0000 (00:41 +0000)]
[analyzer] [NFC] very minor ExprEngineC refactoring

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

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

7 years ago[analyzer] do not crash on libcxx03 call_once implementation
George Karpenkov [Fri, 3 Nov 2017 00:36:03 +0000 (00:36 +0000)]
[analyzer] do not crash on libcxx03 call_once implementation

Addresses https://bugs.llvm.org/show_bug.cgi?id=35075, rdar://35230961

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

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

7 years agoModular Codegen: Don't home always_inline functions
David Blaikie [Thu, 2 Nov 2017 22:28:50 +0000 (22:28 +0000)]
Modular Codegen: Don't home always_inline functions

Since they'll likely (not always - if the address is taken, etc) be
inlined away, even at -O0, separately provided weak definitions are
likely to be unused so skip all of that.

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

7 years agoModular Codegen: Don't home/modularize static functions in headers
David Blaikie [Thu, 2 Nov 2017 21:55:40 +0000 (21:55 +0000)]
Modular Codegen: Don't home/modularize static functions in headers

Consistent with various workarounds in the backwards compatible modules
that allow static functions in headers to exist, be deduplicated to some
degree, and not generally fail right out of the gate... do the same with
modular codegen as there are enough cases (including in libstdc++ and in
LLVM itself - though I cleaned up the easy ones) that it's worth
supporting as a migration/backcompat step.

Simply create a separate, internal linkage function in each object that
needs it. If an available_externally/modularized function references a
static function, but the modularized function is eventually dropped and
not inlined, the static function will be dropped as unreferenced.

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

7 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Thu, 2 Nov 2017 21:45:30 +0000 (21:45 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoAdd default calling convention support for regcall.
Erich Keane [Thu, 2 Nov 2017 21:08:00 +0000 (21:08 +0000)]
Add default calling convention support for regcall.

Added support for regcall as default calling convention. Also added code to
exclude main when applying default calling conventions.

Patch-By: eandrews
Differential Revision: https://reviews.llvm.org/D39210

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

7 years ago[CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> functions...
Sanjay Patel [Thu, 2 Nov 2017 20:39:26 +0000 (20:39 +0000)]
[CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> functions that might set errno

This just makes const-ness of the builtins match const-ness of their lib function siblings.
We're deferring fixing some of these that are obviously wrong to follow-up patches.
Hopefully, the bugs are visible in the new test file (added at rL317220).

As the description in Builtins.def says: "e = const, but only when -fmath-errno=0".

This is step 2 of N to fix builtins and math calls as discussed in D39204.

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

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

7 years agorevert r317228: remove unused function from ObjCRuntime.h, NFC
Alex Lorenz [Thu, 2 Nov 2017 19:42:40 +0000 (19:42 +0000)]
revert r317228: remove unused function from ObjCRuntime.h, NFC

This function is actually used in LLDB

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

7 years agoremove unused function from ObjCRuntime.h, NFC
Alex Lorenz [Thu, 2 Nov 2017 19:01:34 +0000 (19:01 +0000)]
remove unused function from ObjCRuntime.h, NFC

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

7 years ago[OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.
Alexey Bataev [Thu, 2 Nov 2017 18:55:05 +0000 (18:55 +0000)]
[OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.

The compiler may crash under some conditions if the getInvokeDest() is
used, but later it is not used. Fixed this problem in OpenMP.

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

7 years ago[refactor][selection] canonicalize selected string literal to objc
Alex Lorenz [Thu, 2 Nov 2017 18:05:48 +0000 (18:05 +0000)]
[refactor][selection] canonicalize selected string literal to objc
string literal when possible

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

7 years ago[CodeGen] add builtin attr tests to show errno-related diffs; NFC
Sanjay Patel [Thu, 2 Nov 2017 17:06:05 +0000 (17:06 +0000)]
[CodeGen] add builtin attr tests to show errno-related diffs; NFC

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

7 years agoFix comment typo
Jan Korous [Thu, 2 Nov 2017 16:37:00 +0000 (16:37 +0000)]
Fix comment typo

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

7 years ago[OPENMP] Fix PR35156: Get correct thread id with windows exceptions.
Alexey Bataev [Thu, 2 Nov 2017 14:25:34 +0000 (14:25 +0000)]
[OPENMP] Fix PR35156: Get correct thread id with windows exceptions.

If the thread id is requested in windows mode within funclets, we may
generate incorrect function call that could lead to broken codegen.

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

7 years ago[OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base
Jonas Hahnfeld [Thu, 2 Nov 2017 13:30:42 +0000 (13:30 +0000)]
[OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base

We can generate constant sized arrays whenever the array section has constant
length, even if the base expression itself is a VLA.

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

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

7 years agoFix clang-format CLion integration bug.
Eric Liu [Thu, 2 Nov 2017 12:48:48 +0000 (12:48 +0000)]
Fix clang-format CLion integration bug.

CLion's Sax parser threw this error:

Failed to parse clang-format XML replacements. Input: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='true' line=89>
[...]
[org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 66; Open quote is expected for attribute "line" associated with an  element type  "replacements".]

Patch by Justine Tunney (jart@google.com)!

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

7 years agoFix typo in class annotation
Jan Korous [Thu, 2 Nov 2017 12:15:51 +0000 (12:15 +0000)]
Fix typo in class annotation

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

7 years ago[libclang] Add dummy libclang-headers target
Shoaib Meenai [Thu, 2 Nov 2017 05:04:00 +0000 (05:04 +0000)]
[libclang] Add dummy libclang-headers target

`LLVM_DISTRIBUTION_COMPONENTS` assumes that each component has both
`component` and `install-component` targets. Add a dummy no-op target
for `libclang-headers` to placate this check.

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

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

7 years ago[clang-rename] Use add_clang_tool
Shoaib Meenai [Thu, 2 Nov 2017 01:11:40 +0000 (01:11 +0000)]
[clang-rename] Use add_clang_tool

`add_clang_tool` includes a call to `add_clang_executable`, but it also
sets up the install rule, and adds an `install-*` target. The latter is
required for using `LLVM_DISTRIBUTION_COMPONENTS`.

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

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

7 years agoPR33746: Store the 'inline'ness of a static data member with the update record
Richard Smith [Thu, 2 Nov 2017 01:06:00 +0000 (01:06 +0000)]
PR33746: Store the 'inline'ness of a static data member with the update record
for instantiating its definition.

We model the 'inline'ness as being instantiated with the static data member in
order to track whether the declaration has become a definition yet.

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

7 years agoCodeGen: simplify EH personality selection (NFC)
Saleem Abdulrasool [Thu, 2 Nov 2017 00:25:40 +0000 (00:25 +0000)]
CodeGen: simplify EH personality selection (NFC)

Fix a typo in the comment, reorder to ensure that the ordering matches
across the ObjC/ObjC++ cases.  NFCI.

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

7 years agoFix missing -Wregister warning when 'register' is applied to a function parameter.
Richard Smith [Wed, 1 Nov 2017 23:38:37 +0000 (23:38 +0000)]
Fix missing -Wregister warning when 'register' is applied to a function parameter.

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

7 years ago[ASTMatchers] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Wed, 1 Nov 2017 23:09:49 +0000 (23:09 +0000)]
[ASTMatchers] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[clang-format] Make parseUnaryOperator non-recursive, NFCI
Krasimir Georgiev [Wed, 1 Nov 2017 18:20:41 +0000 (18:20 +0000)]
[clang-format] Make parseUnaryOperator non-recursive, NFCI

Summary:
This patch makes the implementation of parseUnaryOperator non-recursive. We had
a problem with a file starting with tens of thousands of +'es and -'es which
caused clang-format to stack overflow.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

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

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

7 years agoFix warnings discovered by rL317076. [-Wunused-private-field]
NAKAMURA Takumi [Wed, 1 Nov 2017 13:47:55 +0000 (13:47 +0000)]
Fix warnings discovered by rL317076. [-Wunused-private-field]

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

7 years agoReformat.
NAKAMURA Takumi [Wed, 1 Nov 2017 13:47:48 +0000 (13:47 +0000)]
Reformat.

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

7 years agoFix -Wunused-private-field to fire regardless of which implicit special members have...
Richard Smith [Wed, 1 Nov 2017 04:52:12 +0000 (04:52 +0000)]
Fix -Wunused-private-field to fire regardless of which implicit special members have been implicitly declared.

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

7 years agoclang/lib/Format/Format.cpp: Fix warnings introduced in rL316903. [-Wpedantic]
NAKAMURA Takumi [Wed, 1 Nov 2017 04:43:22 +0000 (04:43 +0000)]
clang/lib/Format/Format.cpp: Fix warnings introduced in rL316903. [-Wpedantic]

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

7 years agoChange assertion to quick exit from checking function.
Richard Trieu [Wed, 1 Nov 2017 03:57:27 +0000 (03:57 +0000)]
Change assertion to quick exit from checking function.

Remove the assertion that could be triggered by invalid code.  Replace it with
an early exit from the checking function.

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

7 years ago[analyzer] Removing unused stored field.
George Karpenkov [Wed, 1 Nov 2017 02:29:04 +0000 (02:29 +0000)]
[analyzer] Removing unused stored field.

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