Commit Graph

69892 Commits

Author SHA1 Message Date
Martin Probst 83e0220b3f clang-format: [JS] do not insert whitespace in call positions.
Summary:
In JavaScript, may keywords can be used in method names and thus call sites:

    foo.delete();
    foo.instanceof();

clang-format would previously insert whitespace after the `instanceof`. This
change generically skips inserting whitespace between a keyword and a
parenthesis if preceded by a dot, i.e. in a callsite.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 310851
2017-08-14 16:08:16 +00:00
Alexey Bataev 6e01dc1b84 [OPENMP][DEBUG] Fix for PR33676: Debug info for OpenMP region is broken.
After some changes in clang/LLVM debug info for task-based regions was
not generated at all. Patch fixes this problem.

llvm-svn: 310850
2017-08-14 16:03:47 +00:00
Alexey Bataev 3c595a6b2c [OPENMP] Generalization of calls of the outlined functions.
General improvement of the outlined functions calls.

llvm-svn: 310840
2017-08-14 15:01:03 +00:00
Brian Gesiak 1333aaca97 [Parse] Fix typo in header docs (NFC)
Summary:
Fix typo "delcarations", added in rL310609 and rL310627.

llvm-svn: 310838
2017-08-14 14:29:11 +00:00
Aaron Ballman 2cf8df6251 Fixes a typo in a comment; NFC.
llvm-svn: 310837
2017-08-14 14:16:00 +00:00
Krasimir Georgiev 9b5a89b0e2 clang-format: Fix left pointer alignment after delctype/typeof
Change 272124* introduced a regression in spaceRequiredBetween for left aligned pointers to decltype and typeof expressions. This fix adds logic to fix this. The test added is based on a related test in determineStarAmpUsage. Also add test cases for the regression.

http://llvm.org/viewvc/llvm-project?view=revision&revision=272124
LLVM bug tracker: https://bugs.llvm.org/show_bug.cgi?id=30407

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

Fix contributed by euhlmann!

llvm-svn: 310831
2017-08-14 11:06:07 +00:00
Alex Lorenz b176693d99 Set the lexical context for dummy tag decl inside createTagFromNewDecl
This is a follow-up to r310706. This change has been recommended by
Bruno Cardoso Lopes and Richard Smith.

llvm-svn: 310829
2017-08-14 10:59:44 +00:00
Artem Dergachev a7c80a4c07 [analyzer] Rename functions responsible for CFG-based suppress-on-sink.
Update comments. No functional change intended.

Addresses Devin's post-commit review comments in https://reviews.llvm.org/D35673
and https://reviews.llvm.org/D35674.

llvm-svn: 310820
2017-08-14 08:38:47 +00:00
Jonas Hahnfeld 21b60edb05 Fix memory leak in ToolChain::TranslateOpenMPTargetArgs
rL310433 introduced a code path where DAL is not returned and must be freed.
This change allows to run openmp-offload.c when Clang is built with ASan.

llvm-svn: 310817
2017-08-14 07:44:05 +00:00
Richard Smith b115e5dda2 Rename cxx1z -> cxx17 across all diagnostic IDs.
llvm-svn: 310805
2017-08-13 23:37:29 +00:00
Richard Smith cbaaa295f0 Replace remaining user-visible mentions of C++1z with C++17.
llvm-svn: 310804
2017-08-13 22:26:53 +00:00
Richard Smith 6c74e32139 [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for C++17 and before.
llvm-svn: 310803
2017-08-13 21:32:33 +00:00
Martin Storsjo 31cac7a67c [AArch64] Add support for a MinGW AArch64 target
Differential Revision: https://reviews.llvm.org/D36364

llvm-svn: 310798
2017-08-13 19:42:17 +00:00
Sylvestre Ledru d23dd6c633 clang-format: add an option -verbose to list the files being processed
Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Tags: #clang

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

llvm-svn: 310778
2017-08-12 15:15:10 +00:00
Richard Smith 6c716116df PR34163: Don't cache an incorrect key function for a class if queried between
the class becoming complete and its inline methods being parsed.

This replaces the hack of using the "late parsed template" flag to track member
functions with bodies we've not parsed yet; instead we now use the "will have
body" flag, which carries the desired implication that the function declaration
*is* a definition, and that we've just not parsed its body yet.

llvm-svn: 310776
2017-08-12 01:46:03 +00:00
Bruno Cardoso Lopes 4164dd9167 Revert "[Modules] Prevent #import to reenter header if not building a module."
This reverts commit r310605. Richard pointed out a better way to achieve
this, which I'll post a patch for soon.

llvm-svn: 310775
2017-08-12 01:38:26 +00:00
Kostya Serebryany 3e78c4bddc Add a Dockerfile for clang-proto-fuzzer
Summary: Add a Dockerfile for clang-proto-fuzzer

Reviewers: morehouse, vitalybuka

Reviewed By: morehouse

Subscribers: hintonda, cfe-commits

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

llvm-svn: 310774
2017-08-12 01:27:10 +00:00
Alex Shlyapnikov a9f6a52925 Disabling openmp-offload.c on linux until it is stabilized on all local configurations.
Differential revision: https://reviews.llvm.org/D29660

llvm-svn: 310772
2017-08-11 23:10:39 +00:00
Gheorghe-Teodor Bercea 0499212ebf [OpenMP] Move failing flag tests to disabled GPU
offloading test file. This should prevent further errors
with the sanitizer.

Diff: D29660
llvm-svn: 310765
2017-08-11 21:17:50 +00:00
George Karpenkov 33613f63f6 Add -fsanitize=fuzzer-no-link flag to the driver.
The flag will perform instrumentation necessary to the fuzzing,
but will NOT link libLLVMFuzzer.a library.
Necessary when modifying CFLAGS for projects which may produce
executables as well as a fuzzable target.

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

llvm-svn: 310733
2017-08-11 17:22:58 +00:00
Gheorghe-Teodor Bercea 9c52574886 [OpenMP] Enable previously successful offloading tests.
Create a separate test file to contain all tests for OpenMP
offloading to GPUs.

Make libdevice checking more robust by accounting for
the case in which no libdevice is found.

This changes are in connrection with diff: D29660

llvm-svn: 310718
2017-08-11 15:46:22 +00:00
Simon Dardis 16bddf21cf [mips] Add missing mips-registered-target to mips test.
llvm-svn: 310715
2017-08-11 15:23:23 +00:00
Simon Dardis ad9d05de8f [mips] Support implicit gpopt with N64 when using -fno-pic
As clang defaults to -mno-abicalls when using -fno-pic for N64, implicitly use
-mgpopt in that case.

Reviewers: atanasyan

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

llvm-svn: 310714
2017-08-11 15:01:34 +00:00
Alex Lorenz 213d34330f [modules] Set the lexical DC for dummy tag decls that refer to hidden
declarations that are made visible after the dummy is parsed and ODR verified

Prior to this commit the
"(getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."),"
assertion failure was triggered during semantic analysis of the dummy
tag declaration that was declared in another tag declaration because its
lexical context did not point to the outer tag decl.

rdar://32292196

llvm-svn: 310706
2017-08-11 12:06:52 +00:00
Stefan Maksimovic ac642ae7c0 Revert r302670 for the upcoming 5.0.0 release
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.

llvm-svn: 310704
2017-08-11 11:39:07 +00:00
Stefan Maksimovic 76391b101d Revert r310057
Bring back changes which r304953 introduced since
they were in fact not the cause of failures described
in r310057 commit message.

llvm-svn: 310702
2017-08-11 11:03:54 +00:00
Yuka Takahashi 9b6b5d5a88 [Bash-autocompletion] Add --autocomplete flag to 5.0 release notes
Summary:
I thought we should add this information to release notes, because we
added a new flag to clang driver.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits

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

llvm-svn: 310700
2017-08-11 09:44:42 +00:00
Josh Gao 55afa7504f Revert "Thread Safety Analysis: warn on nonsensical attributes."
This reverts commit rL310403, which caused spurious warnings in libc++,
because it didn't properly handle templated scoped lockable types.

llvm-svn: 310698
2017-08-11 07:54:35 +00:00
Richard Smith 9d07ae77e7 Implement latest feature test macro recommendations, P0096R4.
llvm-svn: 310694
2017-08-11 03:39:40 +00:00
Richard Smith b9e5af2123 Update cxx_status to mention the upcoming Clang 5 release.
llvm-svn: 310693
2017-08-11 03:16:11 +00:00
Richard Smith f8c735c770 PR33850: Update cxx_dr_status for Clang 5 branch.
llvm-svn: 310692
2017-08-11 03:14:20 +00:00
Richard Smith 0887754110 PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument.
llvm-svn: 310691
2017-08-11 02:04:19 +00:00
Akira Hatanaka 8d7bdf6dff [Sema][ObjC] Fix spurious -Wcast-qual warnings.
We do not meaningfully track object const-ness of Objective-C object
types. Silence the -Wcast-qual warning that is issued when casting to or
from Objective-C object types results in losing const qualification.

rdar://problem/33807915

llvm-svn: 310672
2017-08-11 00:06:49 +00:00
Craig Topper 699ae0c173 [X86] Implement __builtin_cpu_is
This patch adds support for __builtin_cpu_is. I've tried to match the strings supported to the latest version of gcc.

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

llvm-svn: 310657
2017-08-10 20:28:30 +00:00
Kamil Rytarowski 9fef3b3948 Enable bunch of sanitizers on NetBSD/X86 and X86_64
Summary:
Enable more sanitizers:
 - i386 and amd64:
 * SanitizerKind::Vptr;
 * SanitizerKind::Leak;
 * SanitizerKind::SafeStack;
 * SanitizerKind::Function;

 - amd64 only:
 * SanitizerKind::Thread;

These sanitizers are in the process of upstreaming to LLVM projects.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dim, vitalybuka, kcc, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: #sanitizers, cfe-commits

Tags: #sanitizers

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

llvm-svn: 310649
2017-08-10 18:53:52 +00:00
Alex Shlyapnikov 5f1ac1444b Disabling openmp-offload.c on linux until it is stabilized on all local configurations.
llvm-svn: 310640
2017-08-10 17:55:01 +00:00
Brian Gesiak 75023dbf51 [Parse] Document Parser::SkipFunctionBodies
Reviewers: erikjv, doug.gregor

Subscribers: cfe-commits

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

llvm-svn: 310627
2017-08-10 17:02:04 +00:00
Gheorghe-Teodor Bercea 14528c60ba [OpenMP] Delete tests in openmp-offload.c which cuase failures
until a better way to perform these tests is figured out.

Change connected to diff: D29654

llvm-svn: 310625
2017-08-10 16:56:59 +00:00
Bob Wilson 7a85cc52d7 Add a getName accessor for ModuleMacros.
Swift would like to be able to access the name of a ModuleMacro.
There was some discussion of this in
https://github.com/apple/swift-clang/pull/93, suggesting that it makes
sense to have this accessor in Clang.

llvm-svn: 310622
2017-08-10 16:42:46 +00:00
Ilya Biryukov b88de41636 Fixed a race condition in PrecompiledPreamble.
Summary:
Two PrecompiledPreambles, used in parallel on separate threads,
could be writing preamble to the same temporary file.

Reviewers: bkramer, krasimir, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 310618
2017-08-10 16:10:40 +00:00
Momchil Velikov 57c681f33e Place implictly declared functions at block scope
Such implicitly declared functions behave as if the enclosing block
contained the declaration extern int name() (C90, 6.3.3.2 Function calls),
thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers).

This patch fixes https://bugs.llvm.org/show_bug.cgi?id=33224

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

llvm-svn: 310616
2017-08-10 15:43:06 +00:00
Simon Atanasyan c717041e84 [mips] Group all `-mabicalls` related checks in the single place. NFC
llvm-svn: 310615
2017-08-10 15:42:31 +00:00
Simon Atanasyan c038841e8b [mips] Show warning in case of mixing -mlong-calls and -mabicalls options
While we do not support `-mshared / -mno-shared` properly, show warning
and ignore `-mlong-calls` option in case of implicitly or explicitly
provided `-mabicalls` option.

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

llvm-svn: 310614
2017-08-10 15:42:25 +00:00
Simon Atanasyan 3306e3a8e8 [mips] Notify user that `-mabicalls` is ignored on non-PIC N64 ABI
The -mabicalls option does not make sense in the case of non position
independent code for the N64 ABI. After this change the driver shows a
warning that -mabicalls is ignored in that case.

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

llvm-svn: 310613
2017-08-10 15:42:16 +00:00
Brian Gesiak a9d31f9199 [Parse] Document PrintStats, SkipFunctionBodies
Summary:
Add documentation for `clang::ParseAST` parameters `PrintStats` and
`SkipFunctionBodies`. Also, remove a tiny bit of trailing whitespace.

Reviewers: craig.topper, doug.gregor, erikjv

Subscribers: cfe-commits

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

llvm-svn: 310609
2017-08-10 15:30:35 +00:00
Bruno Cardoso Lopes fca5abc9d2 [Modules] Prevent #import to reenter header if not building a module.
When non-modular headers are imported while not building a module but
in -fmodules mode, be conservative and preserve the default #import
semantic: do not reenter headers.

rdar://problem/33745031

llvm-svn: 310605
2017-08-10 15:16:24 +00:00
Alexander Potapenko 5241081532 [sanitizer-coverage] Change cmp instrumentation to distinguish const operands
This implementation of SanitizerCoverage instrumentation inserts different
callbacks depending on constantness of operands:

  1. If both operands are non-const, then a usual
     __sanitizer_cov_trace_cmp[1248] call is inserted.
  2. If exactly one operand is const, then a
     __sanitizer_cov_trace_const_cmp[1248] call is inserted. The first
     argument of the call is always the constant one.
  3. If both operands are const, then no callback is inserted.

This separation comes useful in fuzzing when tasks like "find one operand
of the comparison in input arguments and replace it with the other one"
have to be done. The new instrumentation allows us to not waste time on
searching the constant operands in the input.

Patch by Victor Chibotaru.

llvm-svn: 310600
2017-08-10 15:00:13 +00:00
Nikolai Bozhenov 1f626cd2eb [ValueTracking] Enabling ValueTracking patch by default (recommit). Part 1.
The original patch was an improvement to IR ValueTracking on non-negative
integers. It has been checked in to trunk (D18777, r284022). But was disabled by
default due to performance regressions.
Perf impact has improved. The patch would be enabled by default.
 
Reviewers: reames, hfinkel
 
Differential Revision: https://reviews.llvm.org/D34101
 
Patch by: Olga Chupina <olga.chupina@intel.com>

llvm-svn: 310582
2017-08-10 11:22:52 +00:00
Alex Lorenz 994f231792 Revert r310489 and follow-up commits r310505, r310519, r310537 and r310549
Commit r310489 caused 'openmp-offload.c' test failures on Darwin and other
platforms:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/39230/testReport/junit/Clang/Driver/openmp_offload_c/

The follow-up commits tried to fix the test, but the test is still failing.

llvm-svn: 310580
2017-08-10 10:34:46 +00:00
Alexander Kornienko cf007a7614 [Lexer] Finding beginning of token with escaped new line
Summary:
Lexer::GetBeginningOfToken produced invalid location when
backtracking across escaped new lines.

This fixes PR26228

Reviewers: akyrtzi, alexfh, rsmith, doug.gregor

Reviewed By: alexfh

Subscribers: alexfh, cfe-commits

Patch by Paweł Żukowski!

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

llvm-svn: 310576
2017-08-10 10:06:16 +00:00