Commit Graph

67441 Commits

Author SHA1 Message Date
Richard Smith 19a311a483 Disallow explicit instantiation and explicit specialization for deduction guides.
llvm-svn: 294641
2017-02-09 22:47:51 +00:00
Richard Smith 3af700977b Diagnose attempts to explicitly instantiate a template at class scope. Previously Clang would simply ignore the 'template' keyword in this case.
llvm-svn: 294639
2017-02-09 22:14:25 +00:00
Amjad Aboud 546bc1103b [DebugInfo] Added support to Clang FE for generating debug info for preprocessor macros.
Added "-fdebug-macro" flag (and "-fno-debug-macro" flag) to enable (and to disable) emitting macro debug info.
Added CC1 "-debug-info-macro" flag that enables emitting macro debug info.

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

llvm-svn: 294637
2017-02-09 22:07:24 +00:00
Vedant Kumar 6eed0d5bb5 [docs] coverage: Clarify which flags enable gcov-style profiling (NFC)
Point out that --coverage and -ftest-coverage, which is what most people
are used to, do not enable clang's frontend based coverage pass.

Suggested by Benn Bolay!

llvm-svn: 294626
2017-02-09 21:33:21 +00:00
Davide Italiano 05f25fa950 [CodeGen] Remove unneeded `private`. NFCI.
llvm-svn: 294623
2017-02-09 21:19:51 +00:00
Richard Smith f445f196ae Rename IsExplicitSpecialization -> IsMemberSpecialization when we're talking
about member specializations to avoid ambiguous and confusing terminology.

llvm-svn: 294622
2017-02-09 21:04:43 +00:00
Richard Smith 60437620db [c++1z] P0091R3: Basic support for deducing class template arguments via deduction-guides.
llvm-svn: 294613
2017-02-09 19:17:44 +00:00
Marcos Pividori cc709cebc8 [windows] Fix test for cl driver.
cl-link.c test was failing after r294604 because of the change in the order of
parameters.

llvm-svn: 294609
2017-02-09 18:40:52 +00:00
Reid Kleckner 04f9f91da6 [MS] Implement the __fastfail intrinsic as a builtin
__fastfail terminates the process immediately with a special system
call. It does not run any process shutdown code or exception recovery
logic.

Fixes PR31854

llvm-svn: 294606
2017-02-09 18:31:06 +00:00
Marcos Pividori 147f62fc0b [windows] [asan] Add wholearchive flag when including asan_cxx lib.
We need -wholearchive for asan_cxx, the same than for asan.
Clang Driver will add asan_cxx at the beginning of the arg list that we pass to
the linker. To ensure that all the static libraries are linked to asan_cxx, we
force the linker to include the object files in asan_cxx.

This fixes some linker errors when compiling with address sanitizer for MT and
passing the static library libFuzzer.

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

llvm-svn: 294604
2017-02-09 18:22:35 +00:00
Krasimir Georgiev b8b987f508 [clang-format] Fix typo in comment.
llvm-svn: 294570
2017-02-09 09:02:13 +00:00
Craig Topper 41cb8ffcc1 [X86] Fix copy and paste bug in clzero test from r294559.
llvm-svn: 294560
2017-02-09 06:22:43 +00:00
Craig Topper 4574226c3f [X86] Clzero flag addition and inclusion under znver1
1. Adds the command line flag for clzero.
2. Includes the clzero flag under znver1.
3. Defines the macro for clzero.
4. Adds a new file which has the intrinsic definition for clzero instruction.

Patch by Ganesh Gopalasubramanian with some additional tests from me.

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

llvm-svn: 294559
2017-02-09 06:10:14 +00:00
Douglas Yung 60fc1dd532 Add check that "#define unix 1" is present for the PS4 target.
llvm-svn: 294534
2017-02-09 00:07:38 +00:00
Mike Aizatsky 9afa12bbc5 [sancov] pc_guard_init is called at least once per DSO.
Summary: Documentation update for https://reviews.llvm.org/D29662

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

llvm-svn: 294522
2017-02-08 21:28:39 +00:00
David Blaikie ee12322372 Initialize builtins during modular codegen
llvm-svn: 294512
2017-02-08 20:51:11 +00:00
Richard Smith ef2cd8f8c3 More fixes for places where 'decltype(auto)' is permitted in the C++ grammar but makes no sense.
llvm-svn: 294509
2017-02-08 20:39:08 +00:00
Richard Smith 3f846bd9fe Don't crash on 'decltype(auto)::'. Rather than treating it as a meaningless
nested-name-specifier (as the standard appears to require), treat it as the
type specifier 'decltype(auto)' followed by a nested-name-specifier starting
with '::'.

llvm-svn: 294506
2017-02-08 19:58:48 +00:00
Charles Li 4f80074629 [Lit Test] Make tests C++11 compatible - Parse OpenMP
Differential Revision: https://reviews.llvm.org/D29725

llvm-svn: 294504
2017-02-08 19:46:15 +00:00
Reid Kleckner a858981c1d [MS] Fix C++ destructor thunk line info for a declaration
Sometimes the MS ABI needs to emit thunks for declarations that don't
have bodies. Destructor thunks make calls to inlinable functions, so
they need line info or LLVM will complain.

Fixes PR31893

llvm-svn: 294465
2017-02-08 16:09:32 +00:00
Krasimir Georgiev 2091a3a0b9 [clang-format] Move OriginalPrefix from base to subclass.
Summary:
OriginalPrefix is only needed for line comment sections. Moved from the base class to the child class.
No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 294457
2017-02-08 14:45:19 +00:00
Krasimir Georgiev fd0dda765e [clang-format] Move comment tests to their own file.
Summary: With a growing suite of comment-related tests, it makes sense to take them out of the main test file. No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek, mgorny

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

llvm-svn: 294439
2017-02-08 12:53:18 +00:00
Krasimir Georgiev f62f958a58 [clang-format] Break before a sequence of line comments aligned with the next line.
Summary:
Make the comment alignment respect sections of line comments originally alinged
with the next token. Until now the decision how to break a continuous sequence
of line comments into sections was taken without reference to the next token.

source:
```
class A {
public: // comment about public
  // comment about a
  int a;
}
```

format before:
```
class A {
public: // comment about public
        // comment about a
  int a;
}
```

format after:
```
class A {
public: // comment about public
  // comment about a
  int a;
}
```

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 294435
2017-02-08 10:30:44 +00:00
Craig Topper d2bf7b03e5 [X86] Add -mprefetchwt1/-mno-prefetchwt1 command line options and __PREFETCHWT1__ define to match gcc.
llvm-svn: 294424
2017-02-08 08:23:40 +00:00
Craig Topper 204ecffdb4 [X86] Add -msgx/-mno-sgx command line options and __SGX__ define to match gcc.
llvm-svn: 294423
2017-02-08 08:23:17 +00:00
Craig Topper 177a57ceb3 [X86] Update command line documentation for -mclwb and -mmovbe which I forgot in my previous commits.
llvm-svn: 294420
2017-02-08 07:57:01 +00:00
Craig Topper b16cb82c93 [X86] Add -mmpx/-mno-mpx command line options and __MPX__ define to match gcc.
llvm-svn: 294419
2017-02-08 07:56:42 +00:00
Craig Topper 8c708cf6bc [X86] Add -mclwb/-mno-clwb command line arguments and __CLWB__ define to match gcc.
In the future, we should also add a clwb intrinsic to the backend, a frontend builtin, and an instrinsic header file.

llvm-svn: 294416
2017-02-08 07:36:58 +00:00
Craig Topper 32c959dab3 [X86] Remove 'umip' feature flag.
This feature flag indicates that the processor has support for removing certain instructions from user mode software. But the feature flag by itself doesn't indicate if the support is enabled in the OS. The affected instructions aren't even instructions the compiler would emit. So I don't think think this feature flag should be in the compiler.

llvm-svn: 294414
2017-02-08 07:13:22 +00:00
Craig Topper ef40aaf787 [X86] Add -mmovbe/-mno-movbe command line options to match gcc.
llvm-svn: 294413
2017-02-08 07:13:19 +00:00
Craig Topper 78b4787593 [X86] Add -mclflushopt/-mno-clflushopt command line support and __CLFLUSHOPT__ define to match gcc.
llvm-svn: 294411
2017-02-08 06:48:58 +00:00
Craig Topper 7d494ef610 Use LLVM_FALLTHROUGH instead of FALLTHROUGH comments.
llvm-svn: 294404
2017-02-08 05:44:30 +00:00
Craig Topper c31d9e4a01 [X86] Remove PCOMMIT feature support since Intel has deprecated this instruction with no plans to release products with it.
Intel's documentation for the deprecation https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction

llvm-svn: 294403
2017-02-08 05:44:28 +00:00
Dylan McKay e8232d73f5 [AVR] Add support for the 'interrupt' and 'naked' attributes
Summary:
This teaches clang how to parse and lower the 'interrupt' and 'naked'
attributes.

This allows interrupt signal handlers to be written.

Reviewers: aaron.ballman

Subscribers: malcolm.parsons, cfe-commits

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

llvm-svn: 294402
2017-02-08 05:09:26 +00:00
Saleem Abdulrasool a6ae060db4 Sema: add warning for c++ member variable shadowing
Add a warning for shadowed variables across records.  Referencing a
shadow'ed variable may not give the desired variable.  Add an optional
warning for the shadowing.

Patch by James Sun!

llvm-svn: 294401
2017-02-08 03:30:13 +00:00
Richard Smith c88aa3f3a6 Diagnose an attempt to give a deduction-guide a function body.
llvm-svn: 294397
2017-02-08 01:27:29 +00:00
Richard Smith 8f8697f3e1 Fix constructor declarator detection for the case when the name is followed by
an attribute-specifier-seq. (Also fixes the same problem for deduction-guides.)

llvm-svn: 294396
2017-02-08 01:16:55 +00:00
Richard Smith f283fdcd50 P0091R3: Improved syntactic checking of deduction-guides.
llvm-svn: 294395
2017-02-08 00:35:25 +00:00
Bruno Cardoso Lopes 15300655ab [ASTReader] Improve ReadASTBlock error message when module not available
Point to the PCM file that could not be found.

rdar://problem/30381981

llvm-svn: 294362
2017-02-07 21:55:02 +00:00
Bruno Cardoso Lopes 17da34d2bd [PCH] Fix a regression when PCH is used with -fmodules
Following up on r291465 after a regression in r276159. When we use
-fmodule-name=X while building a PCH, modular headers in X will be
textually included and the compiler knows that we are not building
module X, so don't serialize such headers in the PCH as being part of a
module, because at this point they are not.

This was causing subtle bugs and malformed AST crashes, for instance,
when using the PCH in subsequent compiler invocation with -fmodules, the
HFI for a modular header would map to the PCH, which would force a
module load of and unexistent module ID.

rdar://problem/30171164

llvm-svn: 294361
2017-02-07 21:54:57 +00:00
Vassil Vassilev a2c2d94dcb Enable -dump-deserialized-decls and -error-on-deserialized-decl for modules.
llvm-svn: 294359
2017-02-07 21:49:41 +00:00
Daniel Jasper 697a8ec6cd clang-format: Fix bad variable declaration detection.
Before:
  LooooooooooooooooongType
  variable(nullptr, [](A *a) {});

After:
  LooooooooooooooooongType
      variable(nullptr, [](A *a) {});

llvm-svn: 294358
2017-02-07 21:38:16 +00:00
Saleem Abdulrasool 5602709b98 Revert "Basic: match GCC behaviour for SuS macro"
This reverts commit SVN r294148.  Seems that it was mistaken, and GCC
does still define `__unix` and `unix` when in GNU mode.

llvm-svn: 294332
2017-02-07 19:00:06 +00:00
Martin Probst 8e3eba0373 clang-format: [JS] correcly format object literal methods.
Summary:
In JavaScript, object literals can contain methods:

   var x = {
     a() { return 1; },
   };

Previously, clang-format always parsed nested {} inside a braced list as
further braced lists. Special case this logic for JavaScript to try
parsing as a braced list, but fall back to parsing as a child block.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 294315
2017-02-07 16:33:13 +00:00
Anastasia Stulova 32f0a4330a [OpenCL] Accept logical NOT for pointer types in CL1.1
Fix for bug 30217 - incorrect error given for logical
NOT operation with a pointer type: corrected sema check
and improved related tests.

Review: D29038
llvm-svn: 294313
2017-02-07 16:09:41 +00:00
Martin Probst 16282993b7 clang-format: [JS] exclaim preceding regex literals.
Summary:
Regex detection would incorrectly classify a trailing `!` operator
(nullability cast) followed by a `/` as the start of a regular
expression literal. This fixes code such as:

    var foo = x()! / 10;

Which would previously parse a regexp all the way to the end of the
source file (or next `/`).

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 294304
2017-02-07 14:08:03 +00:00
Martin Probst 1027fb8a06 clang-format: [JS] handle parenthesized class expressions.
Summary:
In JavaScript, classes are expressions, so they can appear e.g. in
argument lists.

    var C = foo(class {
      bar() {
        return 1;
      }
    };

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 294302
2017-02-07 14:05:30 +00:00
Dylan McKay ecb6e7b83c Revert "Revert "[AVR] Allow specifying the CPU on the command line""
This reverts commit 7ac30e0f839fdab6d723ce2ef6a5b7a4cf03d150.

llvm-svn: 294282
2017-02-07 06:04:18 +00:00
Matt Arsenault 77ce553891 AMDGPU: Add a test checking alignments of emitted globals/allocas
Make sure the spec required type alignments are used in preparation
for a possible change which may break this.

llvm-svn: 294278
2017-02-07 04:28:02 +00:00
Peter Collingbourne 8e6a25feca Driver: Do not link safestack with --whole-archive.
This allows it to be used with the other sanitizers.

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

llvm-svn: 294274
2017-02-07 03:21:57 +00:00