]> granicus.if.org Git - clang/log
clang
7 years agoThread Safety Analysis: fix assert_capability.
Josh Gao [Tue, 1 Aug 2017 19:18:05 +0000 (19:18 +0000)]
Thread Safety Analysis: fix assert_capability.

Summary:
Previously, the assert_capability attribute was completely ignored by
thread safety analysis.

Reviewers: delesley, rnk

Reviewed By: delesley

Subscribers: cfe-commits

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

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

7 years ago[CMake] Include sancov tool in Fuchsia toolchain
Petr Hosek [Tue, 1 Aug 2017 19:15:32 +0000 (19:15 +0000)]
[CMake] Include sancov tool in Fuchsia toolchain

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

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

7 years ago[Sema] Fix lax conversion between non ext vectors
Bruno Cardoso Lopes [Tue, 1 Aug 2017 19:05:25 +0000 (19:05 +0000)]
[Sema] Fix lax conversion between non ext vectors

r282968 introduced a regression due to the lack of proper testing.
Re-add lax conversion support between non ext vectors for compound
assignments and add a test for that.

rdar://problem/28639467

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

7 years agoclang-format: [JS] no whitespace between typeof operator and l_paren.
Martin Probst [Tue, 1 Aug 2017 17:42:16 +0000 (17:42 +0000)]
clang-format: [JS] no whitespace between typeof operator and l_paren.

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

7 years agoclang-format: [JS] prefer wrapping chains over empty literals.
Martin Probst [Tue, 1 Aug 2017 17:35:57 +0000 (17:35 +0000)]
clang-format: [JS] prefer wrapping chains over empty literals.

Summary:
E.g. don't wrap like this:

    (foo.bar.baz).and.bam(Blah.of({
    }))

But rather:

    (foo.bar.baz)
        .and.bam(Blah.of({}))

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: [JS] whitespace between keywords and parenthesized expressions.
Martin Probst [Tue, 1 Aug 2017 17:22:15 +0000 (17:22 +0000)]
clang-format: [JS] whitespace between keywords and parenthesized expressions.

Summary: `throw (...)` should have a whitespace following it, as do await and void.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: [JS] handle union types in arrow functions.
Martin Probst [Tue, 1 Aug 2017 17:19:32 +0000 (17:19 +0000)]
clang-format: [JS] handle union types in arrow functions.

Summary: clang-format would previously fail to detect that an arrow functions parameter block is not an expression, and thus insert whitespace around the `|` and `&` type operators in it.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: [JS] consistenly format enums.
Martin Probst [Tue, 1 Aug 2017 17:12:15 +0000 (17:12 +0000)]
clang-format: [JS] consistenly format enums.

Summary: Previously, const enums would get formatted differently because the modifier was not recognized.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: [JS] support default imports.
Martin Probst [Tue, 1 Aug 2017 15:54:43 +0000 (15:54 +0000)]
clang-format: [JS] support default imports.

Summary: Formerly, `import {default as X} from y;` would not be recognized as an import.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: [JS] handle object types in extends positions.
Martin Probst [Tue, 1 Aug 2017 15:46:10 +0000 (15:46 +0000)]
clang-format: [JS] handle object types in extends positions.

Summary:
clang-format would previously drop the whitespace after `extends` in code such as:

    class Foo extends {} {}

Where the first set of curly braces is an inline object literal type.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[Tooling] Add LLVM_NODISCARD to Replacements::merge
Krasimir Georgiev [Tue, 1 Aug 2017 14:58:14 +0000 (14:58 +0000)]
[Tooling] Add LLVM_NODISCARD to Replacements::merge

Summary:
This patch adds LLVM_NODISCARD to Replacements::merge. I've hit this
several times already.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: klimek, cfe-commits

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

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

7 years ago[OpenCL] Add missing subgroup builtins
Joey Gouly [Tue, 1 Aug 2017 13:27:09 +0000 (13:27 +0000)]
[OpenCL] Add missing subgroup builtins

This adds get_kernel_max_sub_group_size_for_ndrange and
get_kernel_sub_group_count_for_ndrange.

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

7 years ago[x86][inline-asm]Allow a pack of Control Debug to be properly picked
Coby Tayree [Tue, 1 Aug 2017 10:51:09 +0000 (10:51 +0000)]
[x86][inline-asm]Allow a pack of Control Debug to be properly picked

Allows the incorporation of legit (x86) Debug Regs within inline asm stataements

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

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

7 years ago[ASTMatchers] Allow forField to match indirect fields.
Malcolm Parsons [Tue, 1 Aug 2017 09:53:55 +0000 (09:53 +0000)]
[ASTMatchers] Allow forField to match indirect fields.

This is needed for PR32966.

Reviewed by alexfh.

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

7 years agoUse -target instead of -arch in test case.
Akira Hatanaka [Mon, 31 Jul 2017 23:08:52 +0000 (23:08 +0000)]
Use -target instead of -arch in test case.

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

7 years agoSilence warning -Wmissing-sysroot.
Akira Hatanaka [Mon, 31 Jul 2017 22:46:00 +0000 (22:46 +0000)]
Silence warning -Wmissing-sysroot.

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

7 years agoRe-apply r309622 with a fix for MSVC.
Peter Collingbourne [Mon, 31 Jul 2017 22:35:33 +0000 (22:35 +0000)]
Re-apply r309622 with a fix for MSVC.

Patch by Vlad Tsyrklevich!

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

7 years ago[Driver] Make sure the deployment target is earlier than iOS 11 when
Akira Hatanaka [Mon, 31 Jul 2017 22:19:34 +0000 (22:19 +0000)]
[Driver] Make sure the deployment target is earlier than iOS 11 when
it is inferred from -isysroot.

This fixes a change that was inadvertently introduced in r309607.

rdar://problem/32230613

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

7 years agoMove RTEMS to OSTargets.h
Walter Lee [Mon, 31 Jul 2017 21:00:16 +0000 (21:00 +0000)]
Move RTEMS to OSTargets.h

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

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

7 years agoRevert r309622, "Fix logic for generating llvm.type.test()s"
Peter Collingbourne [Mon, 31 Jul 2017 20:53:16 +0000 (20:53 +0000)]
Revert r309622, "Fix logic for generating llvm.type.test()s"

Caused a bot test failure:
http://bb.pgr.jp/builders/test-clang-msc-x64-on-i686-linux-RA/builds/5325

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

7 years agoFix logic for generating llvm.type.test()s
Peter Collingbourne [Mon, 31 Jul 2017 20:45:14 +0000 (20:45 +0000)]
Fix logic for generating llvm.type.test()s

CodeGenFunction::EmitTypeMetadataCodeForVCall() could output an
llvm.assume(llvm.type.test())when CFI was enabled, optimizing out the
vcall check. This case was only reached when: 1) CFI-vcall was enabled,
2) -fwhole-program-tables was specified, and 3)
-fno-sanitize-trap=cfi-vcall was specified.

Patch by Vlad Tsyrklevich!

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

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

7 years ago[Attr] Make TargetWindows and TargetMicrosoftCXXABI match on aarch64 as well
Martin Storsjo [Mon, 31 Jul 2017 20:40:59 +0000 (20:40 +0000)]
[Attr] Make TargetWindows and TargetMicrosoftCXXABI match on aarch64 as well

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

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

7 years ago[AArch64] Don't define __LP64__ when targeting Windows
Martin Storsjo [Mon, 31 Jul 2017 20:40:53 +0000 (20:40 +0000)]
[AArch64] Don't define __LP64__ when targeting Windows

Windows/ARM64 is a LLP64 environment, so don't set this default
define.

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

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

7 years ago[test] Fix mistagged CHECK-NOT-lines for AARCH64-DARWIN in Preprocessor/init.c
Martin Storsjo [Mon, 31 Jul 2017 20:40:48 +0000 (20:40 +0000)]
[test] Fix mistagged CHECK-NOT-lines for AARCH64-DARWIN in Preprocessor/init.c

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

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

7 years ago[X86] Remove -O3 from tbm-builtins.c test file.
Craig Topper [Mon, 31 Jul 2017 20:21:53 +0000 (20:21 +0000)]
[X86] Remove -O3 from tbm-builtins.c test file.

A change to InstCombine broke this test, but we generally frown on running optimizations clang tests anyway. So I've updated the checks to not depend on optimizations anymore.

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

7 years ago[Driver] Allow users to silence the warning that is issued when the
Akira Hatanaka [Mon, 31 Jul 2017 19:16:40 +0000 (19:16 +0000)]
[Driver] Allow users to silence the warning that is issued when the
deployment target is earlier than iOS 11 and the target is 32-bit.

This is a follow-up to r306922.

rdar://problem/32230613

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

7 years ago[Targets] Move addCygMingDefines into the arch-independent Targets.cpp (NFC)
Martin Storsjo [Mon, 31 Jul 2017 18:17:38 +0000 (18:17 +0000)]
[Targets] Move addCygMingDefines into the arch-independent Targets.cpp (NFC)

This fixes a dependency inconsistency, where addMinGWDefines in Targets.cpp
(used from other architectures than X86) called the addCygMingDefines function
in X86.h.

This was inconsistently split in SVN r308791 (D35701).

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

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

7 years ago[OPENMP] Change the name of outer non-debug function in debug mode, NFC.
Alexey Bataev [Mon, 31 Jul 2017 16:43:06 +0000 (16:43 +0000)]
[OPENMP] Change the name of outer non-debug function in debug mode, NFC.

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

7 years ago[OpenCL] Enable subgroup extension in tests
Joey Gouly [Mon, 31 Jul 2017 15:50:27 +0000 (15:50 +0000)]
[OpenCL] Enable subgroup extension in tests

This fixes the test, so that it can be run on different hosts that may have
different OpenCL extensions enabled.

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

7 years agoFix -Wshadow false positives with function-local classes.
Alexander Kornienko [Mon, 31 Jul 2017 15:21:26 +0000 (15:21 +0000)]
Fix -Wshadow false positives with function-local classes.

Summary:
Fixes http://llvm.org/PR33947.

https://godbolt.org/g/54XRMT

void f(int a) {
  struct A {
    void g(int a) {}
    A() { int a; }
  };
}

3 : <source>:3:16: warning: declaration shadows a local variable [-Wshadow]
    void g(int a) {}
               ^
1 : <source>:1:12: note: previous declaration is here
void f(int a) {
           ^
4 : <source>:4:15: warning: declaration shadows a local variable [-Wshadow]
    A() { int a; }
              ^
1 : <source>:1:12: note: previous declaration is here
void f(int a) {
           ^
2 warnings generated.

The local variable `a` of the function `f` can't be accessed from a method of
the function-local class A, thus no shadowing occurs and no diagnostic is
needed.

Reviewers: rnk, rsmith, arphaman, Quuxplusone

Reviewed By: rnk, Quuxplusone

Subscribers: Quuxplusone, cfe-commits

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

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

7 years ago[OpenCL] Add extension Sema check for subgroup builtins
Joey Gouly [Mon, 31 Jul 2017 15:15:59 +0000 (15:15 +0000)]
[OpenCL] Add extension Sema check for subgroup builtins

Check the subgroup extension is enabled, before doing other Sema checks.

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

7 years agoFix release notes indentation from r309562
Alex Lorenz [Mon, 31 Jul 2017 14:22:43 +0000 (14:22 +0000)]
Fix release notes indentation from r309562

The additions in r309562 triggered a docs buildbot failure.

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

7 years agoDocument '-Wpragma-pack' in the release notes
Alex Lorenz [Mon, 31 Jul 2017 14:08:41 +0000 (14:08 +0000)]
Document '-Wpragma-pack' in the release notes

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

7 years ago-Wpragma-pack: add an additional note and fixit when warning
Alex Lorenz [Mon, 31 Jul 2017 13:37:50 +0000 (13:37 +0000)]
-Wpragma-pack: add an additional note and fixit when warning
about unterminated push directives that are followed by a reset
('#pragma pack()')

This has been suggested by Hans Wennborg.

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

7 years ago[CMake][Modules] libclang: Ignore _CINDEX_LIB_ and CLANG_TOOL_EXTRA_BUILD for -fmodules.
NAKAMURA Takumi [Mon, 31 Jul 2017 11:45:20 +0000 (11:45 +0000)]
[CMake][Modules] libclang: Ignore _CINDEX_LIB_ and CLANG_TOOL_EXTRA_BUILD for -fmodules.

CLANG_TOOL_EXTRA_BUILD doesn't affect headers.

_CINDEX_LIB_ is defined when the target is SHARED.
On Win32, it affects clang-c/Platform.h and it shouldn't be ignored.

This is part of https://reviews.llvm.org/D35559

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

7 years agoAdded `applyAtomicChanges` function.
Eric Liu [Mon, 31 Jul 2017 09:22:34 +0000 (09:22 +0000)]
Added `applyAtomicChanges` function.

This re-commits r298913.
o See thread http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20170327/189084.html
o Tested with -DLLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY=0.

Summary: ... which applies a set of `AtomicChange`s on code.

Reviewers: klimek, djasper

Reviewed By: djasper

Subscribers: arphaman, mgorny, chapuni, cfe-commits

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

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

7 years ago[coroutines] Evaluate the operand of void `co_return` expressions.
Eric Fiselier [Mon, 31 Jul 2017 07:48:13 +0000 (07:48 +0000)]
[coroutines] Evaluate the operand of void `co_return` expressions.

Summary:
Previously Clang incorrectly ignored the expression of a void `co_return`. This patch addresses that bug.

I'm not quite sure if I got the code-gen right, but this patch is at least a start.

Reviewers: rsmith, GorNishanov

Reviewed By: rsmith, GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[Sema] Fix operator lookup to consider local extern declarations.
Eric Fiselier [Mon, 31 Jul 2017 00:24:28 +0000 (00:24 +0000)]
[Sema] Fix operator lookup to consider local extern declarations.

Summary:
Previously Clang was not considering operator declarations that occur at function scope. This is incorrect according to [over.match.oper]p3
> The set of non-member candidates is the result of the unqualified lookup of operator@ in the context of the expression according to the usual rules for name lookup in unqualified function calls.

This patch changes operator name lookup to consider block scope declarations.
This patch fixes PR27027.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

7 years agoAlso pass -pie back to the linker when linking on OpenBSD.
Brad Smith [Sun, 30 Jul 2017 21:13:59 +0000 (21:13 +0000)]
Also pass -pie back to the linker when linking on OpenBSD.

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

7 years agoFix a typo.
Brad Smith [Sun, 30 Jul 2017 20:33:06 +0000 (20:33 +0000)]
Fix a typo.

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

7 years ago[x86][inline-asm][ms-compat] legalize the use of "jc/jz short <op>"
Coby Tayree [Sun, 30 Jul 2017 11:13:46 +0000 (11:13 +0000)]
[x86][inline-asm][ms-compat] legalize the use of "jc/jz short <op>"

MS ignores the keyword "short" when used after a jc/jz instruction, LLVM ought to do the same.
llvm: D35892

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

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

7 years ago[x86][inline-asm]Allow a pack of Control Regs to be properly picked
Coby Tayree [Sun, 30 Jul 2017 10:19:10 +0000 (10:19 +0000)]
[x86][inline-asm]Allow a pack of Control Regs to be properly picked

Allows the incorporation of legit (x86) Control Regs within inline asm stataements

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

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

7 years agoCodeGenModule.cpp: [PR33810][Modules] Remove an assertion that confirms MangledDeclNa...
NAKAMURA Takumi [Sun, 30 Jul 2017 06:39:52 +0000 (06:39 +0000)]
CodeGenModule.cpp: [PR33810][Modules] Remove an assertion that confirms MangledDeclNames[CanonicalGD] might be still empty.

FIXME: It is accepted that MangledDeclNames[CanonicalGD] is overwritten here?

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

7 years agoPR33902: Invalidate line number cache when adding more text to existing buffer.
Richard Smith [Sun, 30 Jul 2017 06:31:29 +0000 (06:31 +0000)]
PR33902: Invalidate line number cache when adding more text to existing buffer.

This led to crashes as the line number cache would report a bogus line number
for a line of code, and we'd try to find a nonexistent column within the line
when printing diagnostics.

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

7 years agoCodeGenModule.cpp: [PR33810][Modules] Avoid reusing FoundStr to try to fix crash.
NAKAMURA Takumi [Sun, 30 Jul 2017 05:06:26 +0000 (05:06 +0000)]
CodeGenModule.cpp: [PR33810][Modules] Avoid reusing FoundStr to try to fix crash.

MangledDeclNames might grow up and be reallocated when it were reused by reentering CodeGenModule::getMangledName().

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

7 years agoCodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before rando...
NAKAMURA Takumi [Sun, 30 Jul 2017 04:08:23 +0000 (04:08 +0000)]
CodeGenModule.cpp: [PR33810][Modules] Make sure actual memory corruption before random crash with -fmodules.

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

7 years agoImprove readability of CXX method overrides list
Lenar Safin [Sat, 29 Jul 2017 20:42:58 +0000 (20:42 +0000)]
Improve readability of CXX method overrides list

Summary:
Separate CXX method overrides list entries with commas.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

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

7 years ago[X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer alignment...
Simon Pilgrim [Sat, 29 Jul 2017 15:33:34 +0000 (15:33 +0000)]
[X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets (annoyingly in the driver not via cc1), meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

This patch casts the vectors to explicitly aligned types prior to the load/store to ensure that the require alignment is respected.

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

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

7 years agoFix incorrect assertion condition.
Victor Leschuk [Sat, 29 Jul 2017 08:18:38 +0000 (08:18 +0000)]
Fix incorrect assertion condition.

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

7 years ago[test] FileCheck-ify a test to avoid a spurious failure, NFC
Vedant Kumar [Sat, 29 Jul 2017 00:19:52 +0000 (00:19 +0000)]
[test] FileCheck-ify a test to avoid a spurious failure, NFC

The path to one of my source trees contains 'builtin' as a substring, so
this test failed. Fix it with FileCheck.

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

7 years ago[ubsan] Diagnose invalid uses of builtins (clang)
Vedant Kumar [Sat, 29 Jul 2017 00:19:51 +0000 (00:19 +0000)]
[ubsan] Diagnose invalid uses of builtins (clang)

On some targets, passing zero to the clz() or ctz() builtins has undefined
behavior. I ran into this issue while debugging UB in __hash_table from libcxx:
the bug I was seeing manifested itself differently under -O0 vs -Os, due to a
UB call to clz() (see: libcxx/r304617).

This patch introduces a check which can detect UB calls to builtins.

llvm.org/PR26979

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

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

7 years agoAdopt to LLVM API change (llvm.dbg.value no longer has an offset)
Adrian Prantl [Fri, 28 Jul 2017 20:21:08 +0000 (20:21 +0000)]
Adopt to LLVM API change (llvm.dbg.value no longer has an offset)

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

7 years ago[CMake] Add Android toolchain CMake cache files.
Leo Li [Fri, 28 Jul 2017 17:40:28 +0000 (17:40 +0000)]
[CMake] Add Android toolchain CMake cache files.

Summary: Thoes files are used to build Android toolchain. D32816 makes it possible to build runtimes for targets.

Reviewers: beanz, srhines

Reviewed By: srhines

Subscribers: pirama, jroelofs, srhines, cfe-commits, mgorny

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

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

7 years ago[CMake] NFC. Add clang-tablegen-targets utility target
Chris Bieneman [Fri, 28 Jul 2017 15:33:47 +0000 (15:33 +0000)]
[CMake]  NFC. Add clang-tablegen-targets utility target

By creating this target other projects that depend on clang-generated headers (like LLDB) will no longer be order-dependent on Clang being processed by CMake first.

Also, by creating a dummy of this target in ClangConfig.cmake, projects that can build against out-of-tree clang can freely depend on the target without needing to have conditionals for if clang is in-tree or out-of-tree.

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

7 years agoRecommit r308327 3rd time: Add a warning for missing
Alex Lorenz [Fri, 28 Jul 2017 14:41:21 +0000 (14:41 +0000)]
Recommit r308327 3rd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The second recommit (r309106) was reverted because the "non-default #pragma
pack value chages the alignment of struct or union members in the included file"
warning proved to be too aggressive for external projects like Chromium
(https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit
makes the problematic warning a non-default one, and gives it the
-Wpragma-pack-suspicious-include warning option.

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Fri, 28 Jul 2017 14:01:51 +0000 (14:01 +0000)]
Strip trailing whitespace. NFCI.

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

7 years ago[X86] Add tests showing inability of vector non-temporal load/store intrinsic to...
Simon Pilgrim [Fri, 28 Jul 2017 13:47:02 +0000 (13:47 +0000)]
[X86] Add tests showing inability of vector non-temporal load/store intrinsic to force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets, meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

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

7 years agoclang-format: merge short case labels with trailing comments
Francois Ferrand [Fri, 28 Jul 2017 07:56:18 +0000 (07:56 +0000)]
clang-format: merge short case labels with trailing comments

Summary:
Allow merging short case labels when they actually end with a comment
(like a comment after the ``break``) and when followed by switch-level
comments (e.g. aligned with next case):

  switch(a) {
  case 0: break; // comment at end of case
  case 1: return value;
  // comment related to next case
  // comment related to next case
  case 2:
  }

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: fix block OpeningLineIndex around preprocessor
Francois Ferrand [Fri, 28 Jul 2017 07:56:14 +0000 (07:56 +0000)]
clang-format: fix block OpeningLineIndex around preprocessor

Summary:
The current code would return an incorrect value when a preprocessor
directive is present immediately after the opening brace: this causes
the nanespace end comment fixer to break in some places, for exemple it
would not add the comment in this case:

  namespace a {
  #define FOO
  }

Fixing the computation is simple enough, but it was breaking a feature,
as it would cause comments to be added also when the namespace
declaration was dependant on conditional compilation.

To fix this, a hash of the current preprocessor stack/branches is
computed at the beginning of parseBlock(), so that we explicitely do not
store the OpeningLineIndex when the beginning and end of the block are
not in the same preprocessor conditions.

Tthe hash is computed based on the line, but this could propbably be
improved by using the actual condition, so that clang-format would be
able to match multiple identical #ifdef blocks.

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

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

7 years agoUpdate comment in test case after r309308.
Akira Hatanaka [Fri, 28 Jul 2017 01:58:14 +0000 (01:58 +0000)]
Update comment in test case after r309308.

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

7 years ago[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table
Kostya Serebryany [Fri, 28 Jul 2017 00:10:10 +0000 (00:10 +0000)]
[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table

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

7 years agoHeaders: fix _Unwind_{G,S}etGR for non-EHABI targets
Saleem Abdulrasool [Thu, 27 Jul 2017 21:56:25 +0000 (21:56 +0000)]
Headers: fix _Unwind_{G,S}etGR for non-EHABI targets

The EHABI definition was being inlined into the users even when EHABI
was not in use.  Adjust the condition to ensure that the right version
is defined.

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

7 years ago[Headers] Add a test for arm64intr.h
Martin Storsjo [Thu, 27 Jul 2017 19:45:13 +0000 (19:45 +0000)]
[Headers] Add a test for arm64intr.h

This tests the ARM64 specific constants added in SVN r309081,
similar to the one added in r277928 for armintr.h.

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

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

7 years ago[OPENMP] Allow all lvalues in 'depend' clause.
Alexey Bataev [Thu, 27 Jul 2017 19:15:30 +0000 (19:15 +0000)]
[OPENMP] Allow all lvalues in 'depend' clause.

According to upcoming OpenMP 5.0 all addressable lvalue expressions are
allowed in deoend clause.

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

7 years agoRevert r264998 and r265035.
Akira Hatanaka [Thu, 27 Jul 2017 18:52:44 +0000 (18:52 +0000)]
Revert r264998 and r265035.

r303175 made changes to have __cxa_allocate_exception return a 16-byte
aligned pointer, so it's no longer necessary to specify a lower
alignment (8-bytes) for exception objects on Darwin.

rdar://problem/32363695

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

7 years agoUpdate to use enum classes for various ARM *Kind enums
Florian Hahn [Thu, 27 Jul 2017 16:28:39 +0000 (16:28 +0000)]
Update to use enum classes for various ARM *Kind enums

Summary: This updates the relevant Clang parts for the LLVM change D35882.

Reviewers: rengolin, chandlerc, javed.absar, rovka

Reviewed By: rovka

Subscribers: aemerson, cfe-commits, kristof.beyls

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

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

7 years agoFix double destruction of objects when OpenMP construct is canceled
Erich Keane [Thu, 27 Jul 2017 16:28:20 +0000 (16:28 +0000)]
Fix double destruction of objects when OpenMP construct is canceled

When an omp for loop is canceled the constructed objects are being destructed
twice.

It looks like the desired code is:

{

  Obj o;
  If (cancelled) branch-through-cleanups to cancel.exit.

}
[cleanups]
cancel.exit:

__kmpc_for_static_fini
br cancel.cont (*)

cancel.cont:

__kmpc_barrier
return

The problem seems to be the branch to cancel.cont is currently also going
through the cleanups calling them again. This change just does a direct branch
instead.

Patch By: michael.p.rice@intel.com

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

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

7 years agoMake new PM honor -fdebug-info-for-profiling (clang side)
Dehao Chen [Thu, 27 Jul 2017 15:29:53 +0000 (15:29 +0000)]
Make new PM honor -fdebug-info-for-profiling (clang side)

Summary: The new PM needs to invoke add-discriminator pass when building with -fdebug-info-for-profiling.

Reviewers: chandlerc, davidxl

Reviewed By: chandlerc

Subscribers: sanjoy, cfe-commits

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

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

7 years ago[clang-diff] Rename, NFC
Johannes Altmanninger [Thu, 27 Jul 2017 15:04:44 +0000 (15:04 +0000)]
[clang-diff] Rename, NFC

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

7 years ago[OPENMP] Codegen for 'in_reduction' clause.
Alexey Bataev [Thu, 27 Jul 2017 13:20:36 +0000 (13:20 +0000)]
[OPENMP] Codegen for 'in_reduction' clause.

Added codegen for task-based directive with in_reduction clause.
```
<body>
```
The next code is emitted:
```
void *td;
...
td = call i8* @__kmpc_task_reduction_init();
...
<type> *priv = (<type> *)call i8* @__kmpc_task_reduction_get_th_data(i32
GTID, i8* td, i8* <orig>)
```

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

7 years ago[CodeGen][ARM] ARM runtime helper functions are not always soft-fp
Peter Smith [Thu, 27 Jul 2017 10:43:53 +0000 (10:43 +0000)]
[CodeGen][ARM] ARM runtime helper functions are not always soft-fp

Re-commit r309257 with less precise register checks in arm-float-helpers.c
test.

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

7 years ago[CodeGen][ARM] Revert r309257
Peter Smith [Thu, 27 Jul 2017 09:57:13 +0000 (09:57 +0000)]
[CodeGen][ARM] Revert r309257

The test arm-float-helpers.c appears to be failing on some builders and
needs some work to make it more robust.

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

7 years ago[CodeGen][ARM] ARM runtime helper functions are not always soft-fp
Peter Smith [Thu, 27 Jul 2017 09:21:41 +0000 (09:21 +0000)]
[CodeGen][ARM] ARM runtime helper functions are not always soft-fp

The ARM Runtime ABI document (IHI0043) defines the AEABI floating point
helper functions in 4.1.2 The floating-point helper functions. These
functions always use the base PCS (soft-fp). However helper functions
defined outside of this document such as the complex-number multiply and
divide helpers are not covered by this requirement and should use
hard-float PCS if the target is hard-float as both compiler-rt and libgcc
for a hard-float sysroot implement these functions with a hard-float PCS.

All of the floating point helper functions that are explicitly soft float
are expanded in the llvm ARM backend. This change makes clang not force the
BuiltinCC to AAPCS for AAPCS_VFP. With this change the ARM compiler-rt
tests involving _Complex pass with both hard-fp and soft-fp targets.

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

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

7 years ago[PowerPC] Pass CPU to assembler with -no-integrated-as
Nemanja Ivanovic [Thu, 27 Jul 2017 08:58:28 +0000 (08:58 +0000)]
[PowerPC] Pass CPU to assembler with -no-integrated-as

This just adds the CPU to a list of commands passed to GAS when not using the
integrated assembler.

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

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

7 years ago[Coverage] NFC: Simplify sanity checks with a SpellingRange utility
Vedant Kumar [Thu, 27 Jul 2017 02:20:25 +0000 (02:20 +0000)]
[Coverage] NFC: Simplify sanity checks with a SpellingRange utility

This should simplify D35925.

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

7 years ago[Coverage] NFC: Save a pair of calls to get{Start,End}
Vedant Kumar [Thu, 27 Jul 2017 02:20:20 +0000 (02:20 +0000)]
[Coverage] NFC: Save a pair of calls to get{Start,End}

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

7 years agoHeaders: improve ARM EHABI coverage of unwind.h
Saleem Abdulrasool [Wed, 26 Jul 2017 22:55:23 +0000 (22:55 +0000)]
Headers: improve ARM EHABI coverage of unwind.h

Ensure that we define the `_Unwind_Control_Block` structure used on ARM
EHABI targets.  This is needed for building libc++abi with the unwind.h
from the resource dir.  A minor fallout of this is that we needed to
create a typedef for _Unwind_Exception to work across ARM EHABI and
non-EHABI targets.  The structure definitions here are based originally
on the documentation from ARM under the "Exception Handling ABI for the
ARMĀ® Architecture" Section 7.2.  They are then adjusted to more closely
reflect the definition in libunwind from LLVM.  Those changes are
compatible in layout but permit easier use in libc++abi and help
maintain compatibility between libunwind and the compiler provided
definition.

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

7 years agoAdd branch weights to branches for static initializers.
Richard Smith [Wed, 26 Jul 2017 22:01:09 +0000 (22:01 +0000)]
Add branch weights to branches for static initializers.

The initializer for a static local variable cannot be hot, because it runs at
most once per program. That's not quite the same thing as having a low branch
probability, but under the assumption that the function is invoked many times,
modeling this as a branch probability seems reasonable.

For TLS variables, the situation is less clear, since the initialization side
of the branch can run multiple times in a program execution, but we still
expect initialization to be rare relative to non-initialization uses. It would
seem worthwhile to add a PGO counter along this path to make this estimation
more accurate in future.

For globals with guarded initialization, we don't yet apply any branch weights.
Due to our use of COMDATs, the guard will be reached exactly once per DSO, but
we have no idea how many DSOs will define the variable.

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

7 years agoConvert mac file format to unix
Konstantin Zhuravlyov [Wed, 26 Jul 2017 21:59:45 +0000 (21:59 +0000)]
Convert mac file format to unix

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

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

7 years agoClang and LLVM search for different versions of libxml2, reset found
Eric Beckmann [Wed, 26 Jul 2017 21:47:17 +0000 (21:47 +0000)]
Clang and LLVM search for different versions of libxml2, reset found
variable before each search so that they don't conflict.

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

7 years agoRevert r309106 "Recommit r308327 2nd time: Add a warning for missing"
Hans Wennborg [Wed, 26 Jul 2017 21:29:24 +0000 (21:29 +0000)]
Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"

The warning fires on non-suspicious code in Chromium. Reverting until a
solution is figured out.

> Recommit r308327 2nd time: Add a warning for missing
> '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files
>
> The first recommit (r308441) caused a "non-default #pragma pack value might
> change the alignment of struct or union members in the included file" warning
> in LLVM itself. This recommit tweaks the added warning to avoid warnings for
> #includes that don't have any records that are affected by the non-default
> alignment. This tweak avoids the previously emitted warning in LLVM.
>
> Original message:
>
> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
>
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
>
> rdar://10184173
>
> Differential Revision: https://reviews.llvm.org/D35484

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

7 years ago[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef
Alexey Sotkin [Wed, 26 Jul 2017 18:49:54 +0000 (18:49 +0000)]
[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef

Subscribers: cfe-commits, yaxunl, Anastasia

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

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

7 years agoAdd bitrig removal to release notes
Erich Keane [Wed, 26 Jul 2017 18:04:45 +0000 (18:04 +0000)]
Add bitrig removal to release notes

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

7 years agoRegression test for PR10856
Serge Pavlov [Wed, 26 Jul 2017 14:58:55 +0000 (14:58 +0000)]
Regression test for PR10856

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

7 years agounguarded availability: add a fixit for the "annotate '...'
Alex Lorenz [Wed, 26 Jul 2017 13:58:02 +0000 (13:58 +0000)]
unguarded availability: add a fixit for the "annotate '...'
with an availability attribute to silence" note

rdar://33539233

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

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

7 years ago[Bash-autocompletion] Show HelpText with possible flags
Yuka Takahashi [Wed, 26 Jul 2017 13:36:58 +0000 (13:36 +0000)]
[Bash-autocompletion] Show HelpText with possible flags

Summary:
`clang --autocomplete=-std` will show
```
-std:   Language standard to compile for
-std=   Language standard to compile for
-stdlib=        C++ standard library to use
```
after this change.

However, showing HelpText with completion in bash seems super tricky, so
this feature will be used in other shells (fish, zsh...).

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits, hiraditya

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

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

7 years ago[Bash-completion] Fixed a bug that file doesn't autocompleted after =
Yuka Takahashi [Wed, 26 Jul 2017 13:30:36 +0000 (13:30 +0000)]
[Bash-completion] Fixed a bug that file doesn't autocompleted after =

Summary:
File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so
fixed this bug by checking if $flags contains only a newline or not.

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

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

7 years agoRecommit r308327 2nd time: Add a warning for missing
Alex Lorenz [Wed, 26 Jul 2017 12:20:57 +0000 (12:20 +0000)]
Recommit r308327 2nd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

7 years agoUpdate after LLVM change r309087
George Rimar [Wed, 26 Jul 2017 09:10:17 +0000 (09:10 +0000)]
Update after LLVM change r309087

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

7 years ago[clang] Add ARM64 support to armintr.h for MSVC compatibility
Mandeep Singh Grang [Wed, 26 Jul 2017 05:29:40 +0000 (05:29 +0000)]
[clang] Add ARM64 support to armintr.h for MSVC compatibility

Summary: This fixes compiling with headers from the Windows SDK for ARM64.

Reviewers: compnerd, ruiu, mstorsjo

Reviewed By: compnerd, mstorsjo

Subscribers: mgorny, aemerson, javed.absar, kristof.beyls, llvm-commits, cfe-commits

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

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

7 years ago[StaticAnalyzer] LoopUnrolling - Attempt #2 to fix a crash in r309006.
Peter Szecsi [Tue, 25 Jul 2017 23:49:16 +0000 (23:49 +0000)]
[StaticAnalyzer] LoopUnrolling - Attempt #2 to fix a crash in r309006.

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

7 years ago[CodeGen] Correctly model std::byte's aliasing properties
David Majnemer [Tue, 25 Jul 2017 23:33:58 +0000 (23:33 +0000)]
[CodeGen] Correctly model std::byte's aliasing properties

std::byte, when defined as an enum, needs to be given special treatment
with regards to its aliasing properties. An array of std::byte is
allowed to be used as storage for other types.

This fixes PR33916.

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

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

7 years agoReorder tests to match latest SD-6 draft.
Richard Smith [Tue, 25 Jul 2017 23:31:42 +0000 (23:31 +0000)]
Reorder tests to match latest SD-6 draft.

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

7 years agoclang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h: Add a forward decl AnalysisM...
NAKAMURA Takumi [Tue, 25 Jul 2017 23:23:17 +0000 (23:23 +0000)]
clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h: Add a forward decl AnalysisManager, to unbreak modules build.

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

7 years ago[clang] Add abi-breaking-checks support to clang
Mandeep Singh Grang [Tue, 25 Jul 2017 23:00:02 +0000 (23:00 +0000)]
[clang] Add abi-breaking-checks support to clang

Summary: You can now use REQUIRES:abi-breaking-checks in clang too

Reviewers: chapuni, probinson, ddunbar, jroelofs

Reviewed By: jroelofs

Subscribers: jroelofs, cfe-commits

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

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

7 years ago[StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006.
Peter Szecsi [Tue, 25 Jul 2017 21:54:58 +0000 (21:54 +0000)]
[StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006.

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

7 years agoFix a bot by linking clang-import-test against libclangDriver
Sean Callanan [Tue, 25 Jul 2017 20:09:30 +0000 (20:09 +0000)]
Fix a bot by linking clang-import-test against libclangDriver

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

7 years ago[ExternalASTMerger] Import Objective-C classes
Sean Callanan [Tue, 25 Jul 2017 19:54:22 +0000 (19:54 +0000)]
[ExternalASTMerger] Import Objective-C classes

This patch adds functionality and a test for importing Objective-C classes
and their methods.

It also adds a flag to clang-import-test to set the language used for
parsing. This takes the same argument format as the -x option to the
driver.

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

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

7 years ago[Frontend] Mark some ASTUnit methods as const. NFC.
Vedant Kumar [Tue, 25 Jul 2017 19:53:27 +0000 (19:53 +0000)]
[Frontend] Mark some ASTUnit methods as const. NFC.

Patch by Hamza Sood!

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

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

7 years ago[ubsan] Null-check pointers in -fsanitize=vptr (PR33881)
Vedant Kumar [Tue, 25 Jul 2017 19:34:23 +0000 (19:34 +0000)]
[ubsan] Null-check pointers in -fsanitize=vptr (PR33881)

The instrumentation generated by -fsanitize=vptr does not null check a
user pointer before loading from it. This causes crashes in the face of
UB member calls (this=nullptr), i.e it's causing user programs to crash
only after UBSan is turned on.

The fix is to make run-time null checking a prerequisite for enabling
-fsanitize=vptr, and to then teach UBSan to reuse these run-time null
checks to make -fsanitize=vptr safe.

Testing: check-clang, check-ubsan, a stage2 ubsan-enabled build

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

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

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