]> granicus.if.org Git - clang/log
clang
7 years agoAMDGPU: Fix target options fp32/64-denormals
Yaxun Liu [Tue, 13 Sep 2016 17:37:09 +0000 (17:37 +0000)]
AMDGPU: Fix target options fp32/64-denormals

Fix target options for fp32/64-denormals so that

+fp64-denormals is set if fp64 is supported
-fp32-denormals if fp32 denormals is not supported, or -cl-denorms-are-zero is set
+fp32-denormals if fp32 denormals is supported and -cl-denorms-are-zero is not set

If target feature fp32/64-denormals is explicitly set, they will override default options and options deduced from -cl-denorms-are-zero.

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

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

7 years agoObjectiveC generics: Add ObjCTypeParamType in the type system.
Manman Ren [Tue, 13 Sep 2016 17:25:08 +0000 (17:25 +0000)]
ObjectiveC generics: Add ObjCTypeParamType in the type system.

We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the
representation of "T <protocol>" where T is a type parameter. Before this,
we use TypedefType to represent the type parameter for ObjC.

ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from
ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized
to the underlying type with the protocol qualifiers.

rdar://24619481
rdar://25060179

Differential Revision: http://reviews.llvm.org/D23079

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

7 years agoObjectiveC: Refactor applyObjCProtocolQualifiers.
Manman Ren [Tue, 13 Sep 2016 17:03:12 +0000 (17:03 +0000)]
ObjectiveC: Refactor applyObjCProtocolQualifiers.

To construct the canonical type of ObjCTypeParamType, we need to apply
qualifiers on ObjCObjectPointerType. The updated applyObjCProtocolQualifiers
handles this case by merging the protocol lists, constructing a new
ObjCObjectType, then a new ObjCObjectPointerType.

rdar://24619481
rdar://25060179

Differential Revision: http://reviews.llvm.org/D24059

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

7 years agoAdd a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.
Manman Ren [Tue, 13 Sep 2016 16:45:29 +0000 (16:45 +0000)]
Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.

Now ObjCObjectType extends from ObjCProtocolQualifiers. We save number of
protocols in ObjCProtocolQualifiers.

This is in preparation of adding a new type class ObjCTypeParamType that
can take protocol qualifiers.

rdar://24619481
rdar://25060179

Differential Revision: http://reviews.llvm.org/D23078

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

7 years agoTraversing template paramter lists of DeclaratorDecls and/or TagDecls.
Nico Weber [Tue, 13 Sep 2016 15:05:04 +0000 (15:05 +0000)]
Traversing template paramter lists of DeclaratorDecls and/or TagDecls.

The unit tests in this patch demonstrate the need to traverse template
parameter lists of DeclaratorDecls (e.g. VarDecls, CXXMethodDecls) and
TagDecls (e.g. EnumDecls, RecordDecls).

Fixes PR29042.
https://reviews.llvm.org/D24268

Patch from Lukasz
Ɓukasz Anforowicz <lukasza@chromium.org>!

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

7 years agoRemove redundant comma around parenthesis in parameter list.
Eric Liu [Tue, 13 Sep 2016 15:02:43 +0000 (15:02 +0000)]
Remove redundant comma around parenthesis in parameter list.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoRevert accidentally checked in change in r281315.
Vassil Vassilev [Tue, 13 Sep 2016 10:38:26 +0000 (10:38 +0000)]
Revert accidentally checked in change in r281315.

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

7 years agoSimplify. NFC.
Vassil Vassilev [Tue, 13 Sep 2016 10:36:12 +0000 (10:36 +0000)]
Simplify. NFC.

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

7 years agoAllow register variables in naked functions.
Nikola Smiljanic [Tue, 13 Sep 2016 07:02:02 +0000 (07:02 +0000)]
Allow register variables in naked functions.

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

7 years agoclang-format: Add Java detection to git-clang-format.
Stephen Hines [Tue, 13 Sep 2016 05:00:20 +0000 (05:00 +0000)]
clang-format: Add Java detection to git-clang-format.

Summary: This change adds "java" to the list of known extensions that clang-format supports.

Patch by Luis Hector Chavez

Reviewers: djasper

Subscribers: srhines, cfe-commits

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

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

7 years agoReapply r281276 with passing -emit-llvm in one of the tests
Adam Nemet [Tue, 13 Sep 2016 04:32:40 +0000 (04:32 +0000)]
Reapply r281276 with passing -emit-llvm in one of the tests

Original commit message:

Add -fdiagnostics-show-hotness

Summary:
I've recently added the ability for optimization remarks to include the
hotness of the corresponding code region.  This uses PGO and allows
filtering of the optimization remarks by relevance.  The idea was first
discussed here:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334

The general goal is to produce a YAML file with the remarks.  Then, an
external tool could dynamically filter these by hotness and perhaps by
other things.

That said it makes sense to also expose this at the more basic level
where we just include the hotness info with each optimization remark.
For example, in D22694, the clang flag was pretty useful to measure the
overhead of the additional analyses required to include hotness.
(Without the flag we don't even run the analyses.)

For the record, Hal has already expressed support for the idea of this
patch on IRC.

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

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

7 years agoHandle empty message in static_asserts.
Richard Trieu [Tue, 13 Sep 2016 01:37:01 +0000 (01:37 +0000)]
Handle empty message in static_asserts.

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

7 years agoFix interaction between serialization and c++1z feature.
Richard Trieu [Tue, 13 Sep 2016 01:20:40 +0000 (01:20 +0000)]
Fix interaction between serialization and c++1z feature.

In c++1z, static_assert is not required to have a StringLiteral message, where
previously it was required.  Update the AST Reader to be able to handle a
null StringLiteral.

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

7 years agoUpdate Clang for D20147 ("DebugInfo: New metadata representation for global variables.")
Peter Collingbourne [Tue, 13 Sep 2016 01:13:19 +0000 (01:13 +0000)]
Update Clang for D20147 ("DebugInfo: New metadata representation for global variables.")

Differential Revision: http://reviews.llvm.org/D20415

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

7 years agoRevert "Add -fdiagnostics-show-hotness"
Adam Nemet [Tue, 13 Sep 2016 00:16:49 +0000 (00:16 +0000)]
Revert "Add -fdiagnostics-show-hotness"

This reverts commit r281276.

Many bots are failing.

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

7 years ago[DebugInfo] Deduplicate debug info limiting logic
Reid Kleckner [Tue, 13 Sep 2016 00:01:23 +0000 (00:01 +0000)]
[DebugInfo] Deduplicate debug info limiting logic

We should be doing the same checks when a type is completed as we do
when a complete type is used during emission. Previously, we duplicated
the logic, and it got out of sync. This could be observed with
dllimported classes.

Also reduce a test case for this slightly.

Implementing review feedback from David Blaikie on r281057.

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

7 years ago[Sema] Fix PR30346: relax __builtin_object_size checks.
George Burgess IV [Mon, 12 Sep 2016 23:50:35 +0000 (23:50 +0000)]
[Sema] Fix PR30346: relax __builtin_object_size checks.

This patch makes us act more conservatively when trying to determine
the objectsize for an array at the end of an object. This is in
response to code like the following:

```
struct sockaddr {
  /* snip */
  char sa_data[14];
};

void foo(const char *s) {
  size_t slen = strlen(s) + 1;
  size_t added_len = slen <= 14 ? 0 : slen - 14;
  struct sockaddr *sa = malloc(sizeof(struct sockaddr) + added_len);
  strcpy(sa->sa_data, s);
  // ...
}
```

`__builtin_object_size(sa->sa_data, 1)` would return 14, when there
could be more than 14 bytes at `sa->sa_data`.

Code like this is apparently not uncommon. FreeBSD's manual even
explicitly mentions this pattern:
https://www.freebsd.org/doc/en/books/developers-handbook/sockets-essential-functions.html
(section 7.5.1.1.2).

In light of this, we now just give up on any array at the end of an
object if we can't find the object's initial allocation.

I lack numbers for how much more conservative we actually become as a
result of this change, so I chose the fix that would make us as
compatible with GCC as possible. If we want to be more aggressive, I'm
happy to consider some kind of whitelist or something instead.

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

7 years agoAdd -fdiagnostics-show-hotness
Adam Nemet [Mon, 12 Sep 2016 23:48:16 +0000 (23:48 +0000)]
Add -fdiagnostics-show-hotness

Summary:
I've recently added the ability for optimization remarks to include the
hotness of the corresponding code region.  This uses PGO and allows
filtering of the optimization remarks by relevance.  The idea was first
discussed here:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334

The general goal is to produce a YAML file with the remarks.  Then, an
external tool could dynamically filter these by hotness and perhaps by
other things.

That said it makes sense to also expose this at the more basic level
where we just include the hotness info with each optimization remark.
For example, in D22694, the clang flag was pretty useful to measure the
overhead of the additional analyses required to include hotness.
(Without the flag we don't even run the analyses.)

For the record, Hal has already expressed support for the idea of this
patch on IRC.

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

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

7 years agoFix a long comment line
Adam Nemet [Mon, 12 Sep 2016 23:48:11 +0000 (23:48 +0000)]
Fix a long comment line

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

7 years agoCodeGen: use some range-based for loops
Saleem Abdulrasool [Mon, 12 Sep 2016 21:15:23 +0000 (21:15 +0000)]
CodeGen: use some range-based for loops

Use range-based for loops to simplify the logic.  Add an explicit check for
MachO as the inline asm uses MachO specific directives.

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

7 years agoAdd a couple of test files missed in r281258.
Richard Smith [Mon, 12 Sep 2016 21:07:09 +0000 (21:07 +0000)]
Add a couple of test files missed in r281258.

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

7 years ago[modules] When we merge two definitions of a function, mark the retained
Richard Smith [Mon, 12 Sep 2016 21:06:40 +0000 (21:06 +0000)]
[modules] When we merge two definitions of a function, mark the retained
definition as visible in the discarded definition's module, as we do for
other kinds of definition.

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

7 years agoDiagnostics reference: "error:" should be red, not orange.
Richard Smith [Mon, 12 Sep 2016 17:55:49 +0000 (17:55 +0000)]
Diagnostics reference: "error:" should be red, not orange.

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

7 years agoTrivial documentation fix regarding Obj-C ARC objc_arc_weak_reference_unavailable
Jonathan Roelofs [Mon, 12 Sep 2016 16:14:52 +0000 (16:14 +0000)]
Trivial documentation fix regarding Obj-C ARC objc_arc_weak_reference_unavailable

Fixed incorrect docs that referred to:
  objc_arc_weak_unavailable
when it should be:
  objc_arc_weak_reference_unavailable

Patch by: Sean McBride!

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

7 years agoclang-format: Make emacs integration work with narrowed buffers.
Daniel Jasper [Mon, 12 Sep 2016 10:02:46 +0000 (10:02 +0000)]
clang-format: Make emacs integration work with narrowed buffers.

Use (call-process region nil ...) instead of (point-min) so that the
call works in narrowed buffers.

Patch by Philipp Stephani, thank you!

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

7 years ago[CFG] Add iterator_ranges to CFG and CFGBlock.
Martin Bohme [Mon, 12 Sep 2016 08:28:21 +0000 (08:28 +0000)]
[CFG] Add iterator_ranges to CFG and CFGBlock.

Summary: (Needed for D23353.)

Reviewers: alexfh

Subscribers: cfe-commits

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

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

7 years agoAdd virtual destructor (necessary due to the switch to shared_ptr).
Richard Smith [Mon, 12 Sep 2016 06:51:11 +0000 (06:51 +0000)]
Add virtual destructor (necessary due to the switch to shared_ptr).

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

7 years agoAttempt #3 to placate MSVC.
Richard Smith [Mon, 12 Sep 2016 06:38:31 +0000 (06:38 +0000)]
Attempt #3 to placate MSVC.

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

7 years agoAttempt #2 to placate MSVC
Richard Smith [Mon, 12 Sep 2016 06:23:26 +0000 (06:23 +0000)]
Attempt #2 to placate MSVC

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

7 years agoAttempt to placate MSVC.
Richard Smith [Mon, 12 Sep 2016 06:13:44 +0000 (06:13 +0000)]
Attempt to placate MSVC.

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

7 years agoAdd a mode to clang-tblgen to generate reference documentation for warning and
Richard Smith [Mon, 12 Sep 2016 05:58:29 +0000 (05:58 +0000)]
Add a mode to clang-tblgen to generate reference documentation for warning and
remark flags. For now I'm checking in a copy of the built documentation, but we
can replace this with a placeholder (as we do for the attributes reference
documentation) once we enable building this server-side.

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

7 years ago[MS ABI] Add /include directives for dynamic TLS
David Majnemer [Mon, 12 Sep 2016 02:51:43 +0000 (02:51 +0000)]
[MS ABI] Add /include directives for dynamic TLS

MSVC emits /include directives in the .drective section for the
__dyn_tls_init function (decorated as ___dyn_tls_init@12 for 32-bit).

This fixes PR30347.

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

7 years agoCodeGen: remove unnecessary else case
Saleem Abdulrasool [Sun, 11 Sep 2016 01:25:15 +0000 (01:25 +0000)]
CodeGen: remove unnecessary else case

Refactor the assignment so that its much more clear that the if-clause contains
the lookup, and once cached is directly used.  NFC.

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

7 years agoAdd missing test coverage for an inheritance model attrib merge diag.
Nico Weber [Sat, 10 Sep 2016 13:03:59 +0000 (13:03 +0000)]
Add missing test coverage for an inheritance model attrib merge diag.

Without this, no tests fail if I remove the Diag() in the first if in
Sema::mergeMSInheritanceAttr().

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

7 years ago[tablegen] Check that an optional IdentifierArgument of an attribute is
Akira Hatanaka [Sat, 10 Sep 2016 03:29:43 +0000 (03:29 +0000)]
[tablegen] Check that an optional IdentifierArgument of an attribute is
provided before trying to print it.

This fixes a segfault that occurs when function printPretty generated by
tablegen tries to print an optional argument of attribute
objc_bridge_related.

rdar://problem/28155469

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

7 years agoModules: for ObjectiveC try to keep the definition invariant.
Manman Ren [Fri, 9 Sep 2016 23:48:27 +0000 (23:48 +0000)]
Modules: for ObjectiveC try to keep the definition invariant.

When deserializing ObjCInterfaceDecl with definition data, if we already have
a definition, try to keep the definition invariant; also pull in the
categories even if it is not what getDefinition returns (this effectively
combines categories).

rdar://27926200
rdar://26708823

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

7 years agoDebug info: Bump the default DWARF version on Darwin to 4.
Adrian Prantl [Fri, 9 Sep 2016 21:10:35 +0000 (21:10 +0000)]
Debug info: Bump the default DWARF version on Darwin to 4.

This is a spiritual re-commit of r201375 with only a brief delay
for upgrading the green dragon builders.

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

7 years ago[CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.
Justin Lebar [Fri, 9 Sep 2016 20:35:43 +0000 (20:35 +0000)]
[CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.

Summary:
This fixes a bug where we were unable to compile the following CUDA
file with libstdc++ (didn't try libc++):

  #include <future>
  void foo() { std::shared_future<int> x; }

The problem is that <future> only defines std::shared_future if
__GCC_ATOMIC_INT_LOCK_FREE > 1.  When we compiled this file for device,
the macro was set to 1, and then the class didn't exist at all.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

7 years agoModules: revert r280728.
Manman Ren [Fri, 9 Sep 2016 19:03:07 +0000 (19:03 +0000)]
Modules: revert r280728.

In post-commit review, Richard suggested a better way to fix this.
rdar://27926200

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

7 years agoMyriad: nominally "support" ASAN.
Douglas Katzman [Fri, 9 Sep 2016 18:20:49 +0000 (18:20 +0000)]
Myriad: nominally "support" ASAN.

Doesn't work, but needs to be enabled in order to get there.

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

7 years agoAlso cleanup comments around redundant colons/commas in format::cleanup.
Eric Liu [Fri, 9 Sep 2016 17:50:49 +0000 (17:50 +0000)]
Also cleanup comments around redundant colons/commas in format::cleanup.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[DebugInfo] Ensure complete type is emitted with -fstandalone-debug
Reid Kleckner [Fri, 9 Sep 2016 17:03:53 +0000 (17:03 +0000)]
[DebugInfo] Ensure complete type is emitted with -fstandalone-debug

The logic for upgrading a class from a forward decl to a complete type
was not checking the debug info emission level before applying the
vtable optimization. This meant we ended up without debug info for a
class which was required to be complete. I noticed it because it
triggered an assertion during CodeView emission, but that's a separate
issue.

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

7 years agoMake -fstandalone-debug and -flimit-debug-info available in clang-cl
Reid Kleckner [Fri, 9 Sep 2016 16:42:50 +0000 (16:42 +0000)]
Make -fstandalone-debug and -flimit-debug-info available in clang-cl

Our limited debug info optimizations are breaking down at DLL
boundaries, so we're going to evaluate the size impact of these
settings, and possibly change the default.

Users should be able to override our settings, though.

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

7 years ago[codeview] Extend the heuristic for detecting classes imported from DLLs
Reid Kleckner [Fri, 9 Sep 2016 16:27:04 +0000 (16:27 +0000)]
[codeview] Extend the heuristic for detecting classes imported from DLLs

If a dynamic class contains a dllimport method, then assume the class
may not be constructed in this DLL, and therefore the vtable will live
in a different PDB.

This heuristic is still incomplete, and will miss things like abstract
base classes that are only constructed on one side of the DLL interface.
That said, this heuristic does detect some cases that are currently
problematic, and may be useful to other projects that don't use many
DLLs.

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

7 years agoUpdate clang for D21514. NFC
Amaury Sechet [Fri, 9 Sep 2016 04:42:49 +0000 (04:42 +0000)]
Update clang for D21514. NFC

Summary: As per title.

Reviewers: ahatanak, bkramer, whitequark, mehdi_amini, void

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21515

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

7 years ago[Docs] Fix typos, remove trailing whitespace.
George Burgess IV [Fri, 9 Sep 2016 02:45:48 +0000 (02:45 +0000)]
[Docs] Fix typos, remove trailing whitespace.

Avoided wrapping NullabilityDocs at 80cols, since that would've made
this diff much bigger, and never-ending lines seems to be the style for
many of the null-related docs.

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

7 years agoC++ Modules TS: Add parsing and some semantic analysis support for
Richard Smith [Thu, 8 Sep 2016 23:14:54 +0000 (23:14 +0000)]
C++ Modules TS: Add parsing and some semantic analysis support for
export-declarations. These don't yet have an effect on name visibility;
we still export everything by default.

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

7 years ago[Driver] Report invalid -mtune/-mcpu parameters when -arch=arm64
Vedant Kumar [Thu, 8 Sep 2016 22:53:19 +0000 (22:53 +0000)]
[Driver] Report invalid -mtune/-mcpu parameters when -arch=arm64

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

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

7 years agoImplement MS _rot intrinsics
Albert Gutowski [Thu, 8 Sep 2016 22:32:19 +0000 (22:32 +0000)]
Implement MS _rot intrinsics

Reviewers: thakis, Prazek, compnerd, rnk

Subscribers: majnemer, cfe-commits

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

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

7 years ago[modules] Apply ODR merging for function scoped tags only in C++ mode.
Vassil Vassilev [Thu, 8 Sep 2016 20:34:41 +0000 (20:34 +0000)]
[modules] Apply ODR merging for function scoped tags only in C++ mode.

In C mode, if we have a visible declaration but not a visible definition, a tag
defined in the declaration should be have a visible definition. In C++ we rely
on the ODR merging, whereas in C we cannot because each declaration of a
function gets its own set of declarations in its prototype scope.

Patch developed in collaboration with Richard Smith!

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

7 years agoRevert "[XRay] ARM 32-bit no-Thumb support in Clang"
Renato Golin [Thu, 8 Sep 2016 17:12:32 +0000 (17:12 +0000)]
Revert "[XRay] ARM 32-bit no-Thumb support in Clang"

This reverts commit r280889, as the original LLVM commits broke the thumb
buildbots.

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

7 years agoMoved unreachable to appease msvc, gcc and clang
Simon Pilgrim [Thu, 8 Sep 2016 11:03:41 +0000 (11:03 +0000)]
Moved unreachable to appease msvc, gcc and clang

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

7 years agoFixed a 'not all control paths return a value' warning on MSVC builds
Simon Pilgrim [Thu, 8 Sep 2016 09:59:58 +0000 (09:59 +0000)]
Fixed a 'not all control paths return a value' warning on MSVC builds

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

7 years agoAdd explicit casts to size_t to try to appease MSVC.
Peter Collingbourne [Thu, 8 Sep 2016 01:45:28 +0000 (01:45 +0000)]
Add explicit casts to size_t to try to appease MSVC.

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

7 years agoCodeGen: Clean up implementation of vtable initializer builder. NFC.
Peter Collingbourne [Thu, 8 Sep 2016 01:14:39 +0000 (01:14 +0000)]
CodeGen: Clean up implementation of vtable initializer builder. NFC.

- Simplify signature of CreateVTableInitializer function.
- Move vtable component builder to a separate function.
- Remove unnecessary accessors from VTableLayout class.

This is in preparation for a future change that will alter the type of the
vtable initializer.

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

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

7 years ago[XRay] ARM 32-bit no-Thumb support in Clang
Dean Michael Berris [Thu, 8 Sep 2016 00:23:28 +0000 (00:23 +0000)]
[XRay] ARM 32-bit no-Thumb support in Clang

Just a test for now, adapted from x86_64 tests of XRay.
This is one of 3 commits to different repositories of XRay ARM port. The
other 2 are:

1. https://reviews.llvm.org/D23931 (LLVM)
2. https://reviews.llvm.org/D23933 (compiler-rt)

Differential Review: https://reviews.llvm.org/D23932

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

7 years agoclang-format: [JavaScript] Change default AllowShortFunctionsOnASingleLine
Daniel Jasper [Wed, 7 Sep 2016 23:01:13 +0000 (23:01 +0000)]
clang-format: [JavaScript] Change default AllowShortFunctionsOnASingleLine
for Google style to "empty".

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

7 years agoclang-format: [JavaScript] Do requoting in a separate pass
Daniel Jasper [Wed, 7 Sep 2016 22:48:53 +0000 (22:48 +0000)]
clang-format: [JavaScript] Do requoting in a separate pass

The attempt to fix requoting behavior in r280487 after changes to
tooling::Replacements are incomplete. We essentially need to add to
replacements at the same position, one to insert a line break and one to
change the quoting and that's incompatible with the new
tooling::Replacement API, which does not allow for order-dependent
Replacements. To make the order clear, Replacements::merge() has to be
used, but that requires the merged Replacement to actually refer to the
changed text, which is hard to reproduce for the requoting.

This change fixes the behavior by moving the requoting to a completely
separate pass. The added benefit is that no weird ColumnWidth
calculations are necessary anymore and this should just work even if we
implement string literal splitting in the future.

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

7 years agoFix some Clang-tidy modernize-use-using and Include What You Use warnings; other...
Eugene Zelenko [Wed, 7 Sep 2016 21:53:17 +0000 (21:53 +0000)]
Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes.

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

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

7 years agoMove CHECK right before the function it describes.
George Burgess IV [Wed, 7 Sep 2016 20:15:03 +0000 (20:15 +0000)]
Move CHECK right before the function it describes.

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

7 years ago[Sema] Compare bad conversions in overload resolution.
George Burgess IV [Wed, 7 Sep 2016 20:03:19 +0000 (20:03 +0000)]
[Sema] Compare bad conversions in overload resolution.

r280553 introduced an issue where we'd emit ambiguity errors for code
like:

```
void foo(int *, int);
void foo(unsigned int *, unsigned int);

void callFoo() {
  unsigned int i;
  foo(&i, 0); // ambiguous: int->unsigned int is worse than int->int,
              // but unsigned int*->unsigned int* is better than
              // int*->int*.
}
```

This patch fixes this issue by changing how we handle ill-formed (but
valid) implicit conversions. Candidates with said conversions now always
rank worse than candidates without them, and two candidates are
considered to be equally bad if they both have these conversions for
the same argument.

Additionally, this fixes a case in C++11 where we'd complain about an
ambiguity in a case like:

```
void f(char *, int);
void f(const char *, unsigned);
void g() { f("abc", 0); }
```

...Since conversion to char* from a string literal is considered
ill-formed in C++11 (and deprecated in C++03), but we accept it as an
extension.

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

7 years agoAdd a few more test for []-style uuid attributes.
Nico Weber [Wed, 7 Sep 2016 19:41:35 +0000 (19:41 +0000)]
Add a few more test for []-style uuid attributes.

- Should diag on a function (clang-cl warns; it's an error in cl)
- Test the attribute on nested classes (clang-cl is more permissive and more
  self-consistent than cl here)

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

7 years agoDo not validate pch when -fno-validate-pch is set
Yaxun Liu [Wed, 7 Sep 2016 18:40:20 +0000 (18:40 +0000)]
Do not validate pch when -fno-validate-pch is set

There is a bug causing pch to be validated even though -fno-validate-pch is set. This patch fixes it.

ASTReader relies on ASTReaderListener to initialize SuggestedPredefines, which is required for compilations using PCH. Before this change, PCHValidator is the default ASTReaderListener. After this change, when -fno-validate-pch is set, PCHValidator is disabled, but we need a replacement ASTReaderListener to initialize SuggestedPredefines. Class SimpleASTReaderListener is implemented for this purpose.

This change only affects -fno-validate-pch. There is no functional change if -fno-validate-pch is not set.

If -fno-validate-pch is not set, conflicts in predefined macros between pch and current compiler instance causes error.

If -fno-validate-pch is set, predefine macros in current compiler override those in pch so that compilation can continue.

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

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

7 years agoTry contextually converting condition of constexpr if to Boolean value
Ismail Pazarbasi [Wed, 7 Sep 2016 18:24:54 +0000 (18:24 +0000)]
Try contextually converting condition of constexpr if to Boolean value

Summary:
C++1z 6.4.1/p2:
 If the if statement is of the form if constexpr, the value of the
 condition shall be a contextually converted constant expression of type
 bool [...]
C++1z 5.20/p4:
 [...] A contextually converted constant expression of type bool is an
 expression, contextually converted to bool (Clause4), where the
 converted expression is a constant expression and the conversion
 sequence contains only the conversions above. [...]

Contextually converting result of an expression `e` to a Boolean value
requires `bool t(e)` to be well-formed.

An explicit conversion function is only considered as a user-defined
conversion for direct-initialization, which is essentially what
//contextually converted to bool// requires.

Also, fixes PR28470.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

7 years ago[MS] Fix prologue this adjustment when 'this' is passed indirectly
Reid Kleckner [Wed, 7 Sep 2016 18:21:30 +0000 (18:21 +0000)]
[MS] Fix prologue this adjustment when 'this' is passed indirectly

Move the logic for doing this from the ABI argument lowering into
EmitParmDecl, which runs for all parameters. Our codegen is slightly
suboptimal in this case, as we may leave behind a dead store after
optimization, but it's 32-bit inalloca, and this fixes the bug in a
robust way.

Fixes PR30293

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

7 years ago[clang-offload-bundler] Fix some Clang-tidy modernize-use-override and Include What...
Eugene Zelenko [Wed, 7 Sep 2016 17:37:28 +0000 (17:37 +0000)]
[clang-offload-bundler] Fix some Clang-tidy modernize-use-override and Include What You Use warnings; other minor fixes.

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

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

7 years agoAdd missing include. White space.
Vassil Vassilev [Wed, 7 Sep 2016 17:30:50 +0000 (17:30 +0000)]
Add missing  include. White space.

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

7 years agoAdd MS __nop intrinsic to intrin.h
Reid Kleckner [Wed, 7 Sep 2016 16:55:12 +0000 (16:55 +0000)]
Add MS __nop intrinsic to intrin.h

Summary: There was no definition for __nop function - added inline
assembly.

Patch by Albert Gutowski!

Reviewers: rnk, thakis

Subscribers: cfe-commits

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

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

7 years agoParsing MS pragma intrinsic
Reid Kleckner [Wed, 7 Sep 2016 16:38:32 +0000 (16:38 +0000)]
Parsing MS pragma intrinsic

Parse pragma intrinsic, display warning if the function isn't a builtin
function in clang and suggest including intrin.h.

Patch by Albert Gutowski!

Reviewers: aaron.ballman, rnk

Subscribers: aaron.ballman, cfe-commits

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

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

7 years ago[MS] Fix 'this' type when calling virtual methods with inalloca
Reid Kleckner [Wed, 7 Sep 2016 15:15:51 +0000 (15:15 +0000)]
[MS] Fix 'this' type when calling virtual methods with inalloca

If the virtual method comes from a secondary vtable, then the type of
the 'this' parameter should be i8*, and not a pointer to the complete
class. In the MS ABI, the 'this' parameter on entry points to the vptr
containing the virtual method that was called, so we use i8* instead of
the normal type. We had a mismatch where the CGFunctionInfo of the call
didn't match the CGFunctionInfo of the declaration, and this resulted in
some assertions, but now both sides agree the type of 'this' is i8*.

Fixes one issue raised in PR30293

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

7 years ago[EfficiencySanitizer] [MIPS64] Enables esan clang driver options for MIPS64
Sagar Thakur [Wed, 7 Sep 2016 12:23:15 +0000 (12:23 +0000)]
[EfficiencySanitizer] [MIPS64] Enables esan clang driver options for MIPS64

Reviewed by bruening
Differential: D23800

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

7 years ago[OpenCL] Fix pipe built-in functions return type.
Alexey Bader [Wed, 7 Sep 2016 10:32:03 +0000 (10:32 +0000)]
[OpenCL] Fix pipe built-in functions return type.

By default return type of call expressions calling built-in
functions is set to bool.

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

Reviewers: Anastasia

Subscribers: dmitry, cfe-commits, yaxunl

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

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

7 years agoOpenCL: Defining __ENDIAN_LITTLE__ and fix target endianness
Matt Arsenault [Wed, 7 Sep 2016 07:08:02 +0000 (07:08 +0000)]
OpenCL: Defining __ENDIAN_LITTLE__ and fix target endianness

OpenCL requires __ENDIAN_LITTLE__ be set for little endian targets.
The default for targets was also apparently big endian, so AMDGPU
was incorrectly reported as big endian. Set this from the triple
so targets don't have another place to set the endianness.

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

7 years agoFix whitespace issues
Matt Arsenault [Wed, 7 Sep 2016 07:07:59 +0000 (07:07 +0000)]
Fix whitespace issues

^M and extra space

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

7 years agoFix clang's handling of the copy performed in the second phase of class
Richard Smith [Wed, 7 Sep 2016 02:14:33 +0000 (02:14 +0000)]
Fix clang's handling of the copy performed in the second phase of class
copy-initialization. We previously got this wrong in a couple of ways:
 - we only looked for copy / move constructors and constructor templates for
   this copy, and thus would fail to copy in cases where doing so should use
   some other constructor (but see core issue 670),
 - we mishandled the special case for disabling user-defined conversions that
   blocks infinite recursion through repeated application of a copy constructor
   (applying it in slightly too many cases) -- though as far as I can tell,
   this does not ever actually affect the result of overload resolution, and
 - we misapplied the special-case rules for constructors taking a parameter
   whose type is a (reference to) the same class type by incorrectly assuming
   that only happens for copy/move constructors (it also happens for
   constructors instantiated from templates and those inherited from base
   classes).

These changes should only affect strange corner cases (for instance, where the
copy constructor exists but has a non-const-qualified parameter type), so for
the most part it only causes us to produce more 'candidate' notes, but see the
test changes for other cases whose behavior is affected.

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

7 years ago[scan-build-py] Increase precision of timestamp in report directory name
Devin Coughlin [Tue, 6 Sep 2016 23:42:51 +0000 (23:42 +0000)]
[scan-build-py] Increase precision of timestamp in report directory name

This commit improves compatibility with the perl version of scan-build.

The perl version of scan-build produces output report directories with
increasing lexicographic ordering. This ordering is relied on by the CmpRuns.py
tool in utils/analyzer when comparing results for build commands with multiple
steps. That tool tries to line up the output directory for each step between
different runs of the analyzer based on the increasing directory name.

The python version of scan-build uses file.mkdtemp() with a time stamp
prefix to create report directories. The timestamp has a 1-second precision.
This means that when analysis of a single build step takes less than a second
the ordering property that CmpRuns.py expects will sometimes not hold,
depending on the timing and the random suffix generated by mkdtemp(). Ultimately
this causes CmpRuns to incorrectly correlate results from build steps and report
spurious differences between runs.

This commit increases the precision of the timestamp used in scan-build-py to
the microsecond level. This approach still has the same underlying issue -- but
in practice analysis of any build step is unlikely to take less than a
millisecond.

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

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

7 years agoclang-format: [JS] whitespace required between ! and as.
Martin Probst [Tue, 6 Sep 2016 18:55:34 +0000 (18:55 +0000)]
clang-format: [JS] whitespace required between ! and as.

Summary:
Before:
    x!as string
After:
    x! as string

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: [JS] ignore comments when wrapping returns.
Martin Probst [Tue, 6 Sep 2016 18:39:30 +0000 (18:39 +0000)]
clang-format: [JS] ignore comments when wrapping returns.

Summary:
When code contains a comment between `return` and the value:

    return /* lengthy comment here */ (
        lengthyValueComesHere);

Do not wrap before the comment, as that'd break the code through JS' automatic
semicolon insertion.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years agoModules: Fix an assertion in DeclContext::buildLookup.
Manman Ren [Tue, 6 Sep 2016 18:16:54 +0000 (18:16 +0000)]
Modules: Fix an assertion in DeclContext::buildLookup.

When calling getMostRecentDecl, we can pull in more definitions from
a module. We call getPrimaryContext afterwards to make sure that
we buildLookup on a primary context.

rdar://27926200

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

7 years agoFormatting with clang-format patch r280701
Leny Kholodov [Tue, 6 Sep 2016 17:06:14 +0000 (17:06 +0000)]
Formatting with clang-format patch r280701

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

7 years ago[clang-cl] Check that we are in clang cl mode before enabling support for the CL...
Pierre Gousseau [Tue, 6 Sep 2016 10:48:27 +0000 (10:48 +0000)]
[clang-cl] Check that we are in clang cl mode before enabling support for the CL environment variable.

Checking for the type of the command line tokenizer should not be the criteria to enable support for the CL environment variable, this change checks that we are in clang-cl mode instead.

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

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

7 years agoDebugInfo: use llvm::DINode::DIFlags type for debug info flags
Leny Kholodov [Tue, 6 Sep 2016 10:48:04 +0000 (10:48 +0000)]
DebugInfo: use llvm::DINode::DIFlags type for debug info flags

Use llvm::DINode::DIFlags type (strongly typed enum) for debug flags instead of unsigned int to avoid problems on platforms with sizeof(int) < 4: we already have flags with values > (1 << 16).

Patch by: Victor Leschuk <vleschuk@gmail.com>

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

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

7 years ago[OpenCL] Remove access qualifiers on images in arg info metadata.
Alexey Bader [Tue, 6 Sep 2016 10:10:28 +0000 (10:10 +0000)]
[OpenCL] Remove access qualifiers on images in arg info metadata.

Summary:
Remove access qualifiers on images in arg info metadata:
 * kernel_arg_type
 * kernel_arg_base_type

Image access qualifiers are inseparable from type in clang implementation,
but OpenCL spec provides a special query to get access qualifier
via clGetKernelArgInfo with CL_KERNEL_ARG_ACCESS_QUALIFIER.

Besides that OpenCL conformance test_api get_kernel_arg_info expects
image types without access qualifier.

Patch by Evgeniy Tyurin.

Reviewers: bader, yaxunl, Anastasia

Subscribers: cfe-commits

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

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

7 years agoAdd support for targeting armv6-unknown-cloudabi-eabihf.
Ed Schouten [Mon, 5 Sep 2016 18:38:34 +0000 (18:38 +0000)]
Add support for targeting armv6-unknown-cloudabi-eabihf.

I'm in the progress of adding ARMv6 support to CloudABI. On the compiler
side, everything seems to work properly with this tiny change applied.

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

7 years agoclang/test/Modules/compiler_builtins_x86.c: Fix r280658.
NAKAMURA Takumi [Mon, 5 Sep 2016 13:14:54 +0000 (13:14 +0000)]
clang/test/Modules/compiler_builtins_x86.c: Fix r280658.

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

7 years agoAttempt to fix buildbots not targetting x86
James Molloy [Mon, 5 Sep 2016 12:28:49 +0000 (12:28 +0000)]
Attempt to fix buildbots not targetting x86

r280613 introduced failures for all builds that don't target x86 by default. Add an explicit target to avoid a missing feature diagnostic.

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

7 years ago[AVX-512] Remove 128-bit and 256-bit masked floating point add/sub/mul/div builtins...
Craig Topper [Sun, 4 Sep 2016 18:30:17 +0000 (18:30 +0000)]
[AVX-512] Remove 128-bit and 256-bit masked floating point add/sub/mul/div builtins and replace with native operations.

We can't do the 512-bit ones because they take a rounding mode argument that we can't represent.

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

7 years agoTest case for r280607 to check presence and sanity of the *_LOCK_FREE
Joerg Sonnenberger [Sun, 4 Sep 2016 11:21:27 +0000 (11:21 +0000)]
Test case for r280607 to check presence and sanity of the *_LOCK_FREE
macros.

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

7 years ago[Modules] Add 'freestanding' to the 'requires-declaration' feature-list.
Elad Cohen [Sun, 4 Sep 2016 06:00:42 +0000 (06:00 +0000)]
[Modules] Add 'freestanding' to the 'requires-declaration' feature-list.

This adds support for modules that require (non-)freestanding
environment, such as the compiler builtin mm_malloc submodule.

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

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

7 years agoTrailing dot that shouldn't have been committed.
Joerg Sonnenberger [Sun, 4 Sep 2016 00:51:02 +0000 (00:51 +0000)]
Trailing dot that shouldn't have been committed.

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

7 years agoPR 27200: Fix names of the atomic lock-free macros.
Joerg Sonnenberger [Sun, 4 Sep 2016 00:44:10 +0000 (00:44 +0000)]
PR 27200: Fix names of the atomic lock-free macros.

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

7 years ago[AVX-512] Remove masked integer mullo builtins and replace with native IR.
Craig Topper [Sat, 3 Sep 2016 19:19:49 +0000 (19:19 +0000)]
[AVX-512] Remove masked integer mullo builtins and replace with native IR.

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

7 years ago[AVX-512] Remove masked integer add/sub builtins and replace with native IR.
Craig Topper [Sat, 3 Sep 2016 18:29:35 +0000 (18:29 +0000)]
[AVX-512] Remove masked integer add/sub builtins and replace with native IR.

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

7 years agoFix the attribute documentation build.
Aaron Ballman [Sat, 3 Sep 2016 15:36:52 +0000 (15:36 +0000)]
Fix the attribute documentation build.

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

7 years agoReplace the Radeon GCN GPU family names by more descriptive ones
Niels Ole Salscheider [Sat, 3 Sep 2016 07:13:54 +0000 (07:13 +0000)]
Replace the Radeon GCN GPU family names by more descriptive ones

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

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

7 years agoAdd a test Aaron asked for that I forgot to add before landing r280578.
Nico Weber [Sat, 3 Sep 2016 04:27:14 +0000 (04:27 +0000)]
Add a test Aaron asked for that I forgot to add before landing r280578.

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

7 years ago[ms] Add support for parsing uuid as a Microsoft attribute.
Nico Weber [Sat, 3 Sep 2016 03:25:22 +0000 (03:25 +0000)]
[ms] Add support for parsing uuid as a Microsoft attribute.

Some Windows SDK classes, for example
Windows::Storage::Streams::IBufferByteAccess, use the ATL way of spelling
attributes:

  [uuid("....")] class IBufferByteAccess {};

To be able to use __uuidof() to grab the uuid off these types, clang needs to
support uuid as a Microsoft attribute. There was already code to skip Microsoft
attributes, extend that to look for uuid and parse it.  Use the new "Microsoft"
attribute type added in r280575 (and r280574, r280576) for this.

Final part of https://reviews.llvm.org/D23895

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

7 years agoLet Microsoft attributes apply to the type, not the variable.
Nico Weber [Sat, 3 Sep 2016 03:01:32 +0000 (03:01 +0000)]
Let Microsoft attributes apply to the type, not the variable.

There was already a function that moved attributes off the declspec into
an attribute list for attributes applying to the type, teach that function to
also move Microsoft attributes around and rename it to match its new broader
role.

Nothing uses Microsoft attributes yet, so no behavior change.

Part of https://reviews.llvm.org/D23895

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

7 years agoAdd plumbing for new attribute type "Microsoft".
Nico Weber [Sat, 3 Sep 2016 02:55:10 +0000 (02:55 +0000)]
Add plumbing for new attribute type "Microsoft".

This is for attributes in []-delimited lists preceding a class, like e.g.
`[uuid("...")] class Foo {};`  Not used by anything yet, so no behavior change.
Part of https://reviews.llvm.org/D23895

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

7 years agoMove calls of MaybeParseMicrosoftAttributes() before ParseExternalDeclaration()
Nico Weber [Sat, 3 Sep 2016 02:48:03 +0000 (02:48 +0000)]
Move calls of MaybeParseMicrosoftAttributes() before ParseExternalDeclaration()
into ParseDeclOrFunctionDefInternal() (which is called by
MaybeParseMicrosoftAttributes()), so that the attributes can be stored in
the DeclSpec.  No behavior change yet, part of https://reviews.llvm.org/D23895

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