Commit Graph

69718 Commits

Author SHA1 Message Date
Rafael Espindola aa0226ed71 Update for llvm change.
llvm-svn: 309912
2017-08-03 02:16:28 +00:00
Tim Shen 1efd2229f0 [Sema] Add a comment on an identified bug on default arguments.
Summary:
The mis-compile is triggered by internal code, but I haven't reduced it to a small piece of code. Add a FIXME here, since a decent fix doesn't seem to be trivial.

The decent fix can be changing Decl::Init to PointerUnion<Stmt *, EvaluatedStmt *, ParamVarDecl *>, and make setUninstantiatedDefaultArg take a ParamVarDecl *, which contains the Expr * as the default argument. This way, getTemplateInstantiationArgs can take that ParamVarDecl and do the right thing.

Reviewers: rsmith

Subscribers: sanjoy, cfe-commits

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

llvm-svn: 309908
2017-08-03 00:18:11 +00:00
Eli Friedman 7f53fbfcdc [coverage] Make smaller regions for the first case of a switch.
We never overwrite the end location of a region, so we would end up with
an overly large region when we reused the switch's region.

It's possible this code will be substantially rewritten in the near
future to deal with fallthrough more accurately, but this seems like
an improvement on its own for now.

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

llvm-svn: 309901
2017-08-02 23:22:50 +00:00
Benjamin Kramer 634f103cb5 Remove unused diagnostic. NFC.
llvm-svn: 309888
2017-08-02 21:16:50 +00:00
Rafael Espindola 2e8a7d36ff Update for llvm change.
llvm-svn: 309885
2017-08-02 20:32:35 +00:00
Han Shen 0d7ac5f037 [UBSan] Provide default blacklist filename for UBSan
Summary:
This is to provide a default blacklist filename for UBSan.

While UBSan is turned on, it's better that clang pick up a blacklist file (when exists), just as what ASan / MSan does, so we do not end up adding the "-fsanitize-blacklist" option to every command line.

Reviewers: chandlerc, echristo, vsk, eugenis

Reviewed By: vsk, eugenis

Subscribers: vsk, eugenis, echristo, cfe-commits

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

llvm-svn: 309873
2017-08-02 19:53:38 +00:00
Vedant Kumar bbfdb7d8c8 [docs] Remove accidental unindent to appease the sphinx bot
Bot failure:
http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/12043/steps/docs-clang-html/logs/stdio

llvm-svn: 309852
2017-08-02 18:24:12 +00:00
Vedant Kumar a0c3671b20 [ubsan] Have -fsanitize=vptr emit a null check if -fsanitize=null isn't available
In r309007, I made -fsanitize=null a hard prerequisite for -fsanitize=vptr. I
did not see the need for the two checks to have separate null checking logic
for the same pointer. I expected the two checks to either always be enabled
together, or to be mutually compatible.

In the mailing list discussion re: r309007 it became clear that that isn't the
case. If a codebase is -fsanitize=vptr clean but not -fsanitize=null clean,
it's useful to have -fsanitize=vptr emit its own null check. That's what this
patch does: with it, -fsanitize=vptr can be used without -fsanitize=null.

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

llvm-svn: 309846
2017-08-02 18:10:31 +00:00
Walter Lee 4e93a6986e Define _GNU_SOURCE for RTEMS c++
Summary: This is required by the libc++ locale support.

Reviewers: jyknight

Subscribers: fedor.sergeev

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

llvm-svn: 309815
2017-08-02 14:36:52 +00:00
Alex Lorenz 6ad001df1c [rename] NFC, extract symbol canonicalization logic into function
This function will be used by the clang-refactor's rename actions

llvm-svn: 309813
2017-08-02 14:15:27 +00:00
Manuel Klimek 696e505278 Unify and simplify the behavior of the hasDeclaration matcher.
Originally, we weren't able to match on Type nodes themselves (only QualType),
so the hasDeclaration matcher was initially written to give what we thought are
reasonable results for QualType matches.

When we chagned the matchers to allow matching on Type nodes, it turned out
that the hasDeclaration matcher was by chance written templated enough to now
allow hasDeclaration to also match on (some) Type nodes.

This patch change the hasDeclaration matcher to:
a) work the same on Type and QualType nodes,
b) be completely explicit about what nodes we can match instead of just allowing
   anything with a getDecl() to match,
c) explicitly control desugaring only one level in very specific instances.
d) adds hasSpecializedTemplate and tagType matchers to allow migrating
  existing use cases that now need more explicit matchers

Note: This patch breaks clang-tools-extra. The corresponding patch there
is approved and will land in a subsequent patch.

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

llvm-svn: 309809
2017-08-02 13:04:44 +00:00
Daniel Marjamaki fabe840e75 [StaticAnalyzer] Fix false positives for unreachable code in macros.
Example:

#define MACRO(C)   if (C) { static int x; .. }
void foo() {
	MACRO(0);
}

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

llvm-svn: 309799
2017-08-02 08:26:56 +00:00
Ilya Biryukov 47035c0255 Use VFS operations in FileManager::makeAbsolutePath.
Summary: It used to call into llvm::sys::fs::make_absolute.

Reviewers: akyrtzi, erikjv, bkramer, krasimir, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 309795
2017-08-02 07:25:24 +00:00
Yuka Takahashi 7b370e46e7 [Bash-autocompletion] Add comment to test so that it is easier to fix
Summary:
clang/test/Driver/autocomplete.c is a test for --autocomplete, and this
test might break if people add/modify flags or HelpText. So I've add
comment for future developers so that they can fix this file according
to the change they had made.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits

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

llvm-svn: 309794
2017-08-02 07:20:27 +00:00
Petr Hosek a350f656a5 [CMake] Include llvm-objcopy tool in Fuchsia toolchain
Differential Revision: https://reviews.llvm.org/D36194

llvm-svn: 309786
2017-08-02 02:49:09 +00:00
Petr Hosek c765035583 [Driver] Disable static C++ library support on Fuchsia
Don't support or build static C++ libraries for Fuchsia.

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

llvm-svn: 309778
2017-08-02 01:18:02 +00:00
Bruno Cardoso Lopes d89a1eb4fb [Headers][Darwin] Allow #include_next<float.h> to work on Darwin prior to 10.7
This fixes PR31504 and it's a follow up from adding #include_next<float.h>
for Darwin in r289018.

rdar://problem/29856682

llvm-svn: 309752
2017-08-01 22:10:36 +00:00
Yan Wang d79f3f630f [clang] Change the condition of unnecessary packed warning
Summary:
Change the condition of this unnecessary packed warning. The packed is unnecessary when
1. the alignment of the struct/class won't alter.
2. the size is unchanged.
3. the offset of each field is the same.

Remove all field-level warning.

Reviewers: chh, akyrtzi, rtrieu

Reviewed By: chh

Subscribers: rsmith, srhines, cfe-commits, xazax.hun

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

llvm-svn: 309750
2017-08-01 21:41:39 +00:00
Matt Arsenault 7a124f3ce5 Fix creating bitcasts with wrong address space
In a future commit AMDGPU will start passing
aggregates directly to more functions, triggering
asserts in test/CodeGenOpenCL/addr-space-struct-arg.cl

llvm-svn: 309741
2017-08-01 20:36:57 +00:00
Johannes Altmanninger 31b52d635b [clang-diff] Renames, NFC
llvm-svn: 309738
2017-08-01 20:17:46 +00:00
Johannes Altmanninger 8b0e0663e1 [clang-diff] Move data declarations to the public header
llvm-svn: 309737
2017-08-01 20:17:40 +00:00
Josh Gao 253be33610 Revert "Thread Safety Analysis: fix assert_capability."
This reverts commit rL309725.

Broke test/Sema/attr-capabilities.c.

llvm-svn: 309731
2017-08-01 19:53:31 +00:00
Josh Gao bbd6108369 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

llvm-svn: 309725
2017-08-01 19:18:05 +00:00
Petr Hosek 836a64b53e [CMake] Include sancov tool in Fuchsia toolchain
Differential Revision: https://reviews.llvm.org/D35930

llvm-svn: 309724
2017-08-01 19:15:32 +00:00
Bruno Cardoso Lopes 08e5107689 [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

llvm-svn: 309722
2017-08-01 19:05:25 +00:00
Martin Probst 9926abb91f clang-format: [JS] no whitespace between typeof operator and l_paren.
llvm-svn: 309713
2017-08-01 17:42:16 +00:00
Martin Probst cde9815dc2 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

llvm-svn: 309712
2017-08-01 17:35:57 +00:00
Martin Probst 22e00f09a0 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

llvm-svn: 309710
2017-08-01 17:22:15 +00:00
Martin Probst ec36326d85 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

llvm-svn: 309707
2017-08-01 17:19:32 +00:00
Martin Probst db51cc5745 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

llvm-svn: 309703
2017-08-01 17:12:15 +00:00
Martin Probst 4bf1d7ad81 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

llvm-svn: 309697
2017-08-01 15:54:43 +00:00
Martin Probst cb870c57b3 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

llvm-svn: 309695
2017-08-01 15:46:10 +00:00
Krasimir Georgiev 43d8fd38be [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

llvm-svn: 309689
2017-08-01 14:58:14 +00:00
Joey Gouly fa76b49cef [OpenCL] Add missing subgroup builtins
This adds get_kernel_max_sub_group_size_for_ndrange and
get_kernel_sub_group_count_for_ndrange.

llvm-svn: 309678
2017-08-01 13:27:09 +00:00
Coby Tayree d2bb48f0bd [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

llvm-svn: 309672
2017-08-01 10:51:09 +00:00
Malcolm Parsons 31d08b6e51 [ASTMatchers] Allow forField to match indirect fields.
This is needed for PR32966.

Reviewed by alexfh.

llvm-svn: 309667
2017-08-01 09:53:55 +00:00
Akira Hatanaka 011ed19c0f Use -target instead of -arch in test case.
llvm-svn: 309640
2017-07-31 23:08:52 +00:00
Akira Hatanaka 086597aee3 Silence warning -Wmissing-sysroot.
llvm-svn: 309636
2017-07-31 22:46:00 +00:00
Peter Collingbourne 396943a75b Re-apply r309622 with a fix for MSVC.
Patch by Vlad Tsyrklevich!

llvm-svn: 309635
2017-07-31 22:35:33 +00:00
Akira Hatanaka 4a94d8d5f7 [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

llvm-svn: 309633
2017-07-31 22:19:34 +00:00
Walter Lee 973131071a Move RTEMS to OSTargets.h
Differential Revision: https://reviews.llvm.org/D36106

llvm-svn: 309626
2017-07-31 21:00:16 +00:00
Peter Collingbourne ab65b0dba1 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

llvm-svn: 309624
2017-07-31 20:53:16 +00:00
Peter Collingbourne 8867b216dc 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

llvm-svn: 309622
2017-07-31 20:45:14 +00:00
Martin Storsjo f3ed393d69 [Attr] Make TargetWindows and TargetMicrosoftCXXABI match on aarch64 as well
Differential Revision: https://reviews.llvm.org/D36100

llvm-svn: 309620
2017-07-31 20:40:59 +00:00
Martin Storsjo 588a3e5e6c [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

llvm-svn: 309619
2017-07-31 20:40:53 +00:00
Martin Storsjo 42927caae1 [test] Fix mistagged CHECK-NOT-lines for AARCH64-DARWIN in Preprocessor/init.c
Differential Revision: https://reviews.llvm.org/D36099

llvm-svn: 309618
2017-07-31 20:40:48 +00:00
Craig Topper 228b622b38 [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.

llvm-svn: 309616
2017-07-31 20:21:53 +00:00
Akira Hatanaka fb82a59a8c [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

llvm-svn: 309607
2017-07-31 19:16:40 +00:00
Martin Storsjo e2a247ccb0 [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

llvm-svn: 309598
2017-07-31 18:17:38 +00:00
Alexey Bataev 3e66070a04 [OPENMP] Change the name of outer non-debug function in debug mode, NFC.
llvm-svn: 309575
2017-07-31 16:43:06 +00:00