Martin Probst [Fri, 4 Aug 2017 17:07:15 +0000 (17:07 +0000)]
clang-format: [JS] support fields with case/switch/default labels.
Summary:
`case:` and `default:` would normally parse as labels for a `switch` block.
However in TypeScript, they can be used in field declarations, e.g.:
interface I {
case: string;
}
This change special cases parsing them in declaration lines to avoid wrapping
them.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D36148
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310070
91177308-0d34-0410-b5e6-
96231b3b80d8
Stefan Maksimovic [Fri, 4 Aug 2017 12:37:34 +0000 (12:37 +0000)]
Revert r304953 for release 5.0.0
This is causing failures when compiling clang with -O3
as one of the structures used by clang is passed by
value and uses the fastcc calling convention.
Faliures manifest for stage2 mips build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310057
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Fri, 4 Aug 2017 10:40:18 +0000 (10:40 +0000)]
[Driver] Error if ARM mode was selected explicitly for M-profile CPUs.
Summary:
M-class profiles do not support ARM execution mode, so providing
-marm/-mno-thumb does not make sense in combination with -mcpu/-march
options that support the M-profile.
This is a follow-up patch to D35569 and it seemed pretty clear that we
should emit an error in the driver in this case.
We probably also should warn/error if the provided -mcpu/-march options
do not match, e.g. -mcpu=cortex-m0 -march=armv8-a is invalid, as
cortex-m0 does not support armv8-a. But that should be a separate patch
I think.
Reviewers: echristo, richard.barton.arm, rengolin, labrinea, charles.baylis
Reviewed By: rengolin
Subscribers: aemerson, javed.absar, kristof.beyls, cfe-commits
Differential Revision: https://reviews.llvm.org/D35826
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310047
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Fri, 4 Aug 2017 08:41:42 +0000 (08:41 +0000)]
Fix typo and update documentation.
The hasDeclaration documentation was outdated after r288366.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310041
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Fri, 4 Aug 2017 08:25:15 +0000 (08:25 +0000)]
[mips] Fix typo (missed space) in the warning message
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310038
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Fri, 4 Aug 2017 08:25:09 +0000 (08:25 +0000)]
[mips] Code formatting fix. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310037
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 4 Aug 2017 06:35:32 +0000 (06:35 +0000)]
Revert r309984, "Use "foo-12345.o" instead of "foo.o-12345" as temporary file name."
It generates MODULE-XXXXXXXXXXXX-%%%%%%%%.pcm, then GlobalModuleIndex.cpp is confused with the suffix ".pcm"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310030
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Fri, 4 Aug 2017 04:08:23 +0000 (04:08 +0000)]
Revert "[coverage] Special-case calls to noreturn functions."
This reverts commit r309995. It looks like it's responsible for breaking
the stage2 coverage build:
http://green.lab.llvm.org/green/job/clang-stage2-coverage-R_build/1402
The cfe-commits discussion re: r309995 has more context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310019
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Fri, 4 Aug 2017 02:39:27 +0000 (02:39 +0000)]
[Driver][Fuchsia] Pass --hash-style=gnu to the linker
The .gnu_hash format is superior, and all versions of the Fuchsia
dynamic linker support it.
Differential Revision: https://reviews.llvm.org/D36254
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310017
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Fri, 4 Aug 2017 00:29:20 +0000 (00:29 +0000)]
[Coverage] Precise region termination with deferred regions
The current coverage implementation doesn't handle region termination
very precisely. Take for example an `if' statement with a `return':
void f() {
if (true) {
return; // The `if' body's region is terminated here.
}
// This line gets the same coverage as the `if' condition.
}
If the function `f' is called, the line containing the comment will be
marked as having executed once, which is not correct.
The solution here is to create a deferred region after terminating a
region. The deferred region is completed once the start location of the
next statement is known, and is then pushed onto the region stack.
In the cases where it's not possible to complete a deferred region, it
can safely be dropped.
Testing: lit test updates, a stage2 coverage-enabled build of clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310010
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 3 Aug 2017 23:55:42 +0000 (23:55 +0000)]
[Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.
This commit fixes a bug where clang/llvm doesn't emit an unwind table
for a function when it is marked noexcept. Without this patch, the
following code terminates with an uncaught exception on ARM64:
int foo1() noexcept {
try {
throw 0;
} catch (int i) {
return 0;
}
return 1;
}
int main() {
return foo1();
}
rdar://problem/
32411865
Differential Revision: https://reviews.llvm.org/D35693
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310006
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Thu, 3 Aug 2017 23:02:22 +0000 (23:02 +0000)]
Enable AddressSanitizer for Fuchsia targets
Patch by Roland McGrath
Differential Revision: https://reviews.llvm.org/D35922
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309999
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Thu, 3 Aug 2017 22:27:36 +0000 (22:27 +0000)]
[coverage] Special-case calls to noreturn functions.
The code after a noreturn call doesn't execute.
The pattern in the testcase is pretty common in LLVM (a switch with
a default case that calls llvm_unreachable).
Differential Revision: https://reviews.llvm.org/D36250
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309995
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 3 Aug 2017 21:06:36 +0000 (21:06 +0000)]
Use "foo-12345.o" instead of "foo.o-12345" as temporary file name.
This helps some tools that do things based on the output's extension.
For example, we got reports from users on Windows that have a tool that scan a
build output dir (but skip .obj files). The tool would keep the "foo.obj-12345"
file open, and then when clang tried to rename the temp file to the final
output filename, that would fail. By making the tempfile end in ".obj", tools
like this will now skip the temp files as well.
https://reviews.llvm.org/D36238
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309984
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 3 Aug 2017 19:39:51 +0000 (19:39 +0000)]
[mips] Revert r309942 & r309940
This reverts commit r309942 & commit r309940.
A revert was requested following post commit review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309978
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 3 Aug 2017 19:25:02 +0000 (19:25 +0000)]
Revert accidentally-committed files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309976
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 3 Aug 2017 19:24:27 +0000 (19:24 +0000)]
Don't emit undefined-internal warnings for CXXDeductionGuideDecls.
Patch by ~paul (cynecx on phabricator)! Some test massaging by me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309975
91177308-0d34-0410-b5e6-
96231b3b80d8
Devin Coughlin [Thu, 3 Aug 2017 18:12:22 +0000 (18:12 +0000)]
[Analyzer] Add support for displaying cross-file diagnostic paths in HTML output
This change adds support for cross-file diagnostic paths in html output. If the
diagnostic path is not cross-file, there is no change in the output.
Patch by Vlad Tsyrklevich!
Differential Revision: https://reviews.llvm.org/D30406
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309968
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 3 Aug 2017 16:46:17 +0000 (16:46 +0000)]
Revert r304836.
See discussion in https://reviews.llvm.org/D33900#824172
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309960
91177308-0d34-0410-b5e6-
96231b3b80d8
Don Hinton [Thu, 3 Aug 2017 16:13:13 +0000 (16:13 +0000)]
[diagtool] Add ability to pass in the id and return the name for a
particular diagnostic.
Differential Revision: https://reviews.llvm.org/D36252
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309955
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Horvath [Thu, 3 Aug 2017 15:38:14 +0000 (15:38 +0000)]
Fix some typos in the documentation.
Patch by: Reka Nikolett Kovacs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309948
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 3 Aug 2017 14:35:06 +0000 (14:35 +0000)]
[mips] Fixup r309940.
Needed a // REQUIRES: mips-registered-target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309942
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Thu, 3 Aug 2017 14:17:29 +0000 (14:17 +0000)]
[clang-format] Fix indent of 'key <...>' and 'key {...}' in text protos
Summary:
This patch fixes the indentation of the code pattern `key <...>`and `key {...}` in text protos.
Previously, such line would be alinged depending on the column of the previous
colon, which usually indents too much.
I'm gonna go ahead and commit this since it's a straightforward bugfix.
Reviewers: djasper, klimek
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D36143
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309941
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 3 Aug 2017 14:01:17 +0000 (14:01 +0000)]
[mips] Implement -muninit-const-in-rodata
This option when combined with -mgpopt and -membedded-data places all
uninitialized constant variables in the read-only section.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D35917
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309940
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Thu, 3 Aug 2017 13:43:45 +0000 (13:43 +0000)]
[clang-format] Fix parsing of <>-style proto options
Summary:
This patch fixes the parsing of proto option fields like `option op = <...>`.
Previously the parser did not enter the right code path inside the angle braces,
causing the contents to be split into several unwrapped lines inside.
I'll just go ahead and commit this since it's a straightforward bugfix.
Reviewers: djasper, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36217
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309937
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 3 Aug 2017 13:04:29 +0000 (13:04 +0000)]
[mips] Add support -m(no-)embedded-data option
Add support for the -membedded-data option which places constant data in
the .rodata section, rather than the .sdata section.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D35914
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309935
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 3 Aug 2017 02:16:28 +0000 (02:16 +0000)]
Update for llvm change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309912
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Shen [Thu, 3 Aug 2017 00:18:11 +0000 (00:18 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309908
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 2 Aug 2017 23:22:50 +0000 (23:22 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309901
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 2 Aug 2017 21:16:50 +0000 (21:16 +0000)]
Remove unused diagnostic. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309888
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 2 Aug 2017 20:32:35 +0000 (20:32 +0000)]
Update for llvm change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309885
91177308-0d34-0410-b5e6-
96231b3b80d8
Han Shen [Wed, 2 Aug 2017 19:53:38 +0000 (19:53 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309873
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 2 Aug 2017 18:24:12 +0000 (18:24 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309852
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 2 Aug 2017 18:10:31 +0000 (18:10 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309846
91177308-0d34-0410-b5e6-
96231b3b80d8
Walter Lee [Wed, 2 Aug 2017 14:36:52 +0000 (14:36 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309815
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 2 Aug 2017 14:15:27 +0000 (14:15 +0000)]
[rename] NFC, extract symbol canonicalization logic into function
This function will be used by the clang-refactor's rename actions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309813
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Wed, 2 Aug 2017 13:04:44 +0000 (13:04 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309809
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Marjamaki [Wed, 2 Aug 2017 08:26:56 +0000 (08:26 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309799
91177308-0d34-0410-b5e6-
96231b3b80d8
Ilya Biryukov [Wed, 2 Aug 2017 07:25:24 +0000 (07:25 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309795
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuka Takahashi [Wed, 2 Aug 2017 07:20:27 +0000 (07:20 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309794
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 2 Aug 2017 02:49:09 +0000 (02:49 +0000)]
[CMake] Include llvm-objcopy tool in Fuchsia toolchain
Differential Revision: https://reviews.llvm.org/D36194
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309786
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 2 Aug 2017 01:18:02 +0000 (01:18 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309778
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Tue, 1 Aug 2017 22:10:36 +0000 (22:10 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309752
91177308-0d34-0410-b5e6-
96231b3b80d8
Yan Wang [Tue, 1 Aug 2017 21:41:39 +0000 (21:41 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309750
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 1 Aug 2017 20:36:57 +0000 (20:36 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309741
91177308-0d34-0410-b5e6-
96231b3b80d8
Johannes Altmanninger [Tue, 1 Aug 2017 20:17:46 +0000 (20:17 +0000)]
[clang-diff] Renames, NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309738
91177308-0d34-0410-b5e6-
96231b3b80d8
Johannes Altmanninger [Tue, 1 Aug 2017 20:17:40 +0000 (20:17 +0000)]
[clang-diff] Move data declarations to the public header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309737
91177308-0d34-0410-b5e6-
96231b3b80d8
Josh Gao [Tue, 1 Aug 2017 19:53:31 +0000 (19:53 +0000)]
Revert "Thread Safety Analysis: fix assert_capability."
This reverts commit rL309725.
Broke test/Sema/attr-capabilities.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309731
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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