]> granicus.if.org Git - clang/log
clang
6 years agoWe have in place support for parsing #pragma FENV_ACCESS, but that
Kevin P. Neal [Tue, 14 Aug 2018 17:06:56 +0000 (17:06 +0000)]
We have in place support for parsing #pragma FENV_ACCESS, but that
information is then discarded with a warning to the user that we don't
support it.

This patch gets us one step closer by getting the info down into the
AST in most cases.

Reviewed by: rsmith
Differential Revision: https://reviews.llvm.org/D49865

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

6 years agoRevert test commit
Kevin P. Neal [Tue, 14 Aug 2018 16:57:10 +0000 (16:57 +0000)]
Revert test commit

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

6 years agoTest commit
Kevin P. Neal [Tue, 14 Aug 2018 16:56:25 +0000 (16:56 +0000)]
Test commit

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

6 years ago[OpenCL] Add test for constant sampler argument
Sven van Haastregt [Tue, 14 Aug 2018 13:56:52 +0000 (13:56 +0000)]
[OpenCL] Add test for constant sampler argument

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

6 years ago[gnu-objc] Make selector order deterministic.
David Chisnall [Tue, 14 Aug 2018 10:05:25 +0000 (10:05 +0000)]
[gnu-objc] Make selector order deterministic.

Summary:
This probably fixes PR35277, though there may be other sources of
nondeterminism (this was the only case of iterating over a DenseMap).

It's difficult to provide a test case for this, because it shows up only
on systems with ASLR enabled.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: bmwiedemann, mgrang, cfe-commits

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

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

6 years agoAdd a stub mangling for ObjC selectors in the Microsoft ABI.
David Chisnall [Tue, 14 Aug 2018 10:04:36 +0000 (10:04 +0000)]
Add a stub mangling for ObjC selectors in the Microsoft ABI.

This mangling is used only for outlined SEH finally blocks, which have
internal linkage.

This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with
expensive checks enabled, on Windows.  This test should probably be
specifying a triple: it currently picks up whatever the host environment
is using.  Unfortunately, I have no idea what it is trying to test,
because it contains no comments and predates Clang having working
Objective-C IR generation.

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

6 years ago[XRay][clang] Add more test cases of -fxray-modes= (NFC)
Dean Michael Berris [Tue, 14 Aug 2018 09:16:37 +0000 (09:16 +0000)]
[XRay][clang] Add more test cases of -fxray-modes= (NFC)

This confirms expectations for multiple values provided through the
driver when selecting specific modes and the order of appearance of
individual values for the `-fxray-modes=` flag.

This change just adds more test cases to an existing test file.

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

6 years ago[analyzer] Made a buildbot happy.
Kristof Umann [Tue, 14 Aug 2018 08:38:35 +0000 (08:38 +0000)]
[analyzer] Made a buildbot happy.

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

6 years ago[analyzer][UninitializedObjectChecker] Void pointers are casted back to their dynamic...
Kristof Umann [Tue, 14 Aug 2018 08:20:51 +0000 (08:20 +0000)]
[analyzer][UninitializedObjectChecker] Void pointers are casted back to their dynamic type in note message

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

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

6 years ago[X86] Lowering addus/subus intrinsics to native IR
Tomasz Krupa [Tue, 14 Aug 2018 08:01:38 +0000 (08:01 +0000)]
[X86] Lowering addus/subus intrinsics to native IR

Summary: This is the patch that lowers x86 intrinsics to native IR in order to enable optimizations.

Reviewers: craig.topper, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: cfe-commits

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

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

6 years ago[CStringSyntaxChecker] Check strlcat sizeof check
David Carlier [Tue, 14 Aug 2018 05:12:53 +0000 (05:12 +0000)]
[CStringSyntaxChecker] Check strlcat sizeof check

- Assuming strlcat is used with strlcpy we check as we can if the last argument does not equal os not larger than the buffer.
- Advising the proper usual pattern.

Reviewers: NoQ, george.karpenkov

Reviewed By: george.karpenkov

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

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

6 years agoRevert r339623 "Model type attributes as regular Attrs."
Reid Kleckner [Tue, 14 Aug 2018 01:55:37 +0000 (01:55 +0000)]
Revert r339623 "Model type attributes as regular Attrs."

This breaks compiling atlwin.h in Chromium. I'm sure the code is invalid
in some way, but we put a lot of work into accepting it, and I'm sure
rejecting it was not an intended consequence of this refactoring. :)

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

6 years agoMove test inputs into Inputs directory.
Richard Smith [Tue, 14 Aug 2018 00:18:48 +0000 (00:18 +0000)]
Move test inputs into Inputs directory.

We don't need a new ExpectedOutputs/ convention. Expected outputs are
just another form of test input.

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

6 years ago[CodeGen] Before returning a copy/dispose helper function, bitcast it to
Akira Hatanaka [Tue, 14 Aug 2018 00:15:42 +0000 (00:15 +0000)]
[CodeGen] Before returning a copy/dispose helper function, bitcast it to
a void pointer type.

This fixes a bug introduced in r339438.

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

6 years agoFix check strings in test/CodeGenObjC/arc-blocks.m in preperation for
Akira Hatanaka [Tue, 14 Aug 2018 00:15:41 +0000 (00:15 +0000)]
Fix check strings in test/CodeGenObjC/arc-blocks.m in preperation for
fixing a bug introduced in r339438.

Check the descriptor global variables in the IR at both -O0 and -O2.

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

6 years ago[analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields
George Karpenkov [Mon, 13 Aug 2018 23:32:15 +0000 (23:32 +0000)]
[analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields

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

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

6 years ago[analyzer] [NFC] Introduce separate targets for testing the analyzer: check-clang...
George Karpenkov [Mon, 13 Aug 2018 23:12:43 +0000 (23:12 +0000)]
[analyzer] [NFC] Introduce separate targets for testing the analyzer: check-clang-analyzer and check-clang-analyzer-z3

Current testing setup for analyzer tests with Z3 is rather inconvenient:

There's no way to run the analyzer tests separately (I use
LIT_FILTER=Analysis ninja check-clang, but a direct target is nicer).

When Clang is built with Z3 support, there's no way to *not* run tests
with Z3 solver, and this is often desired, as tests with Z3 solver take
a very long time.

This patch introduces two extra targets:

 - check-clang-analyzer
 - check-clang-analyzer-z3

which solve those problems.

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

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

6 years agoFix Clang warnings and bad #include filenames in r339595 and r339599.
Richard Smith [Mon, 13 Aug 2018 22:07:11 +0000 (22:07 +0000)]
Fix Clang warnings and bad #include filenames in r339595 and r339599.

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

6 years agoModel type attributes as regular Attrs.
Richard Smith [Mon, 13 Aug 2018 22:07:09 +0000 (22:07 +0000)]
Model type attributes as regular Attrs.

Specifically, AttributedType now tracks a regular attr::Kind rather than
having its own parallel Kind enumeration, and AttributedTypeLoc now
holds an Attr* instead of holding an ad-hoc collection of Attr fields.

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

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

6 years agoConvert if/else to a switch. NFC.
Akira Hatanaka [Mon, 13 Aug 2018 20:59:57 +0000 (20:59 +0000)]
Convert if/else to a switch. NFC.

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

6 years ago[OPENMP] Fix emission of the loop doacross constructs.
Alexey Bataev [Mon, 13 Aug 2018 19:04:24 +0000 (19:04 +0000)]
[OPENMP] Fix emission of the loop doacross constructs.

The number of loops associated with the OpenMP loop constructs should
not be considered as the number loops to collapse.

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

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p5.: Handle pedantic mode in the...
Kristof Umann [Mon, 13 Aug 2018 18:48:34 +0000 (18:48 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p5.: Handle pedantic mode in the checker class only

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

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

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p4.: Wrap FieldRegions and reduce...
Kristof Umann [Mon, 13 Aug 2018 18:43:08 +0000 (18:43 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p4.: Wrap FieldRegions and reduce weight on FieldChainInfo

Before this patch, FieldChainInfo used a spaghetti: it took care of way too many cases,
even though it was always meant as a lightweight wrapper around
ImmutableList<const FieldRegion *>.
This problem is solved by introducing a lightweight polymorphic wrapper around const
FieldRegion *, FieldNode. It is an interface that abstracts away special cases like
pointers/references, objects that need to be casted to another type for a proper note
messages.

Changes to FieldChainInfo:

  * Now wraps ImmutableList<const FieldNode &>.
  * Any pointer/reference related fields and methods were removed
  * Got a new add method. This replaces it's former constructors as a way to create a
    new FieldChainInfo objects with a new element.

Changes to FindUninitializedField:

  * In order not to deal with dynamic memory management, when an uninitialized field is
    found, the note message for it is constructed and is stored instead of a
    FieldChainInfo object. (see doc around addFieldToUninits).

Some of the test files are changed too, from now on uninitialized pointees of references
always print "uninitialized pointee" instead of "uninitialized field" (which should've
really been like this from the beginning).

I also updated every comment according to these changes.

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

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

6 years agoEnforce instantiation of template multiversion functions
Erich Keane [Mon, 13 Aug 2018 18:33:20 +0000 (18:33 +0000)]
Enforce instantiation of template multiversion functions

Multiversioned member functions inside of a template type were
not properly being emitted.  The solution to this is to simply
ensure that their bodies are correctly evaluated/assigned during
template instantiation.

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

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out from...
Kristof Umann [Mon, 13 Aug 2018 18:22:22 +0000 (18:22 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out from FieldChainInfo

This is a standalone part of the effort to reduce FieldChainInfos inteerface.

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

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

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer chasing to...
Kristof Umann [Mon, 13 Aug 2018 18:17:05 +0000 (18:17 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer chasing to a separate file

In this patch, the following classes and functions have been moved to a header file:

    FieldChainInfo
    FindUninitializedFields
    isPrimitiveType

This also meant that they moved from anonymous namespace to clang::ento.

Code related to pointer chasing now relies in its own file.

There's absolutely no functional change in this patch -- its literally just copy pasting.

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

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

6 years ago[Sema] fix -Wfloat-conversion test case.
Nick Desaulniers [Mon, 13 Aug 2018 18:07:50 +0000 (18:07 +0000)]
[Sema] fix -Wfloat-conversion test case.

Summary:
Fixes r339581 ("[SEMA] add more -Wfloat-conversion to
compound assigment analysis").

This test case was caught in postsubmit testing.

Reviewers: aaron.ballman, gkistanova

Reviewed By: aaron.ballman

Subscribers: cfe-commits, srhines

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

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

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList factory is...
Kristof Umann [Mon, 13 Aug 2018 17:55:52 +0000 (17:55 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList factory is no longer static

This patch is the first part of a series of patches to refactor UninitializedObjectChecker. The goal of this effort is to

    Separate pointer chasing from the rest of the checker,
    Increase readability and reliability,
    Don't impact performance (too bad).

In this one, ImmutableList's factory is moved to FindUninitializedFields.

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

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

6 years ago[AST] Update/correct the static_asserts for the bit-fields in Type
Bruno Ricci [Mon, 13 Aug 2018 16:40:57 +0000 (16:40 +0000)]
[AST] Update/correct the static_asserts for the bit-fields in Type

The current static_assert only checks that ObjCObjectTypeBitfields
fits into an unsigned. However it turns out that FunctionTypeBitfields
do not currently fits into an unsigned. Therefore the anonymous
union containing the bit-fields always use 8 bytes instead of 4.

This patch removes the lone misguided static_assert and systematically
checks the size of each bit-field.

Reviewed By: erichkeane

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

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

6 years ago[SEMA] add more -Wfloat-conversion to compound assigment analysis
Nick Desaulniers [Mon, 13 Aug 2018 16:38:07 +0000 (16:38 +0000)]
[SEMA] add more -Wfloat-conversion to compound assigment analysis

Summary: Fixes Bug: https://bugs.llvm.org/show_bug.cgi?id=27061

Reviewers: aaron.ballman, acoomans

Reviewed By: aaron.ballman, acoomans

Subscribers: acoomans, cfe-commits, srhines, pirama

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

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

6 years agoRevert "[OPENMP] Fix emission of the loop doacross constructs."
Alexey Bataev [Mon, 13 Aug 2018 14:42:18 +0000 (14:42 +0000)]
Revert "[OPENMP] Fix emission of the loop doacross constructs."

This reverts commit r339568 because of the problems with the buildbots.

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

6 years ago[clang-format] Fix comment, NFC
Krasimir Georgiev [Mon, 13 Aug 2018 14:32:29 +0000 (14:32 +0000)]
[clang-format] Fix comment, NFC

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

6 years agoSummary:Add clang::reinitializes attribute
Martin Bohme [Mon, 13 Aug 2018 14:11:03 +0000 (14:11 +0000)]
Summary:Add clang::reinitializes attribute

Summary:
This is for use by clang-tidy's bugprone-use-after-move check -- see
corresponding clang-tidy patch at https://reviews.llvm.org/D49910.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

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

6 years ago[OPENMP] Fix emission of the loop doacross constructs.
Alexey Bataev [Mon, 13 Aug 2018 14:05:43 +0000 (14:05 +0000)]
[OPENMP] Fix emission of the loop doacross constructs.

The number of loops associated with the OpenMP loop constructs should
not be considered as the number loops to collapse.

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

6 years ago[ASTImporter] Improved import of friend templates.
Balazs Keri [Mon, 13 Aug 2018 13:08:37 +0000 (13:08 +0000)]
[ASTImporter] Improved import of friend templates.

Summary:
When importing a friend class template declaration,
this declaration should not be merged with any other existing declaration
for the same type. Otherwise the getFriendDecl of the FriendDecl can point
to an other already referenced declaration, this case causes problems.
Additionally the previous decl of class templates is set at import.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

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

6 years agoRevert "Allow relockable scopes with thread safety attributes."
Haojian Wu [Mon, 13 Aug 2018 12:50:30 +0000 (12:50 +0000)]
Revert "Allow relockable scopes with thread safety attributes."

This reverts commit r339456.

The change introduces a new crash, see

class SCOPED_LOCKABLE FileLock {
 public:
  explicit FileLock()
      EXCLUSIVE_LOCK_FUNCTION(file_);
  ~FileLock() UNLOCK_FUNCTION(file_);
  void Lock() EXCLUSIVE_LOCK_FUNCTION(file_);
  Mutex file_;
};

void relockShared2() {
  FileLock file_lock;
  file_lock.Lock();
}

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

6 years ago[clang] Store code completion token range in preprocessor.
Kadir Cetinkaya [Mon, 13 Aug 2018 08:13:35 +0000 (08:13 +0000)]
[clang] Store code completion token range in preprocessor.

Summary:
This change is to support a new fature in clangd, tests will be send toclang-tools-extra with that change.

Unittests are included in: https://reviews.llvm.org/D50449

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

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

6 years ago[ASTMatchers] Let hasAnyArgument also support CXXUnresolvedConstructExpr
Shuai Wang [Sun, 12 Aug 2018 23:30:05 +0000 (23:30 +0000)]
[ASTMatchers] Let hasAnyArgument also support CXXUnresolvedConstructExpr

Subscribers: cfe-commits

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

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

6 years agoRenaming arg_const_range to const_arg_range; NFC.
Aaron Ballman [Sun, 12 Aug 2018 21:19:22 +0000 (21:19 +0000)]
Renaming arg_const_range to const_arg_range; NFC.

This form makes more sense (it is a range over constant arguments) and is most consistent with const_arg_iterator (there are zero instances of arg_const_iterator).

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

6 years ago[ASTMatchers] Add matchers unresolvedMemberExpr, cxxDependentScopeMemberExpr
Shuai Wang [Sun, 12 Aug 2018 17:34:36 +0000 (17:34 +0000)]
[ASTMatchers] Add matchers unresolvedMemberExpr, cxxDependentScopeMemberExpr

Subscribers: cfe-commits

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

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

6 years ago[ASTImporter] Added test case for opaque enums
Raphael Isemann [Sat, 11 Aug 2018 23:43:46 +0000 (23:43 +0000)]
[ASTImporter] Added test case for opaque enums

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

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

6 years ago[ASTImporter] Added test case for CXXConversionDecl importing
Raphael Isemann [Sat, 11 Aug 2018 23:43:02 +0000 (23:43 +0000)]
[ASTImporter] Added test case for CXXConversionDecl importing

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

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

6 years agoMake the section boundary checks on Windows not depend on the order as they are emitt...
Douglas Yung [Sat, 11 Aug 2018 02:46:47 +0000 (02:46 +0000)]
Make the section boundary checks on Windows not depend on the order as they are emitted in reverse when the compiler is built by Visual C++.

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

6 years ago[analyzer] Fix keyboard navigation for .msgNote events
George Karpenkov [Sat, 11 Aug 2018 01:47:41 +0000 (01:47 +0000)]
[analyzer] Fix keyboard navigation for .msgNote events

Does not go to msgNote's.

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

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

6 years ago[analyzer] InnerPointerChecker: improve warning messages and notes.
Reka Kovacs [Fri, 10 Aug 2018 23:56:57 +0000 (23:56 +0000)]
[analyzer] InnerPointerChecker: improve warning messages and notes.

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

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

6 years ago[analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate files, use...
George Karpenkov [Fri, 10 Aug 2018 23:51:43 +0000 (23:51 +0000)]
[analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate files, use diff instead of a FileCheck - II

Some files were missed by https://reviews.llvm.org/D50545

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

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

6 years ago[analyzer] Record nullability implications on getting items from NSDictionary
George Karpenkov [Fri, 10 Aug 2018 22:27:04 +0000 (22:27 +0000)]
[analyzer] Record nullability implications on getting items from NSDictionary

If we get an item from a dictionary, we know that the item is non-null
if and only if the key is non-null.

This patch is a rather hacky way to record this implication, because
some logic needs to be duplicated from the solver.
And yet, it's pretty simple, performant, and works.

Other possible approaches:

 - Record the implication, in future rely on Z3 to pick it up.
 - Generalize the current code and move it to the constraint manager.

rdar://34990742

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

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

6 years ago[analyzer] Fix tracking expressions through negation operator
George Karpenkov [Fri, 10 Aug 2018 21:42:19 +0000 (21:42 +0000)]
[analyzer] Fix tracking expressions through negation operator

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

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

6 years ago[analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate files, use...
George Karpenkov [Fri, 10 Aug 2018 21:36:45 +0000 (21:36 +0000)]
[analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate files, use diff instead of a FileCheck

Some of the analyzer tests check the exact plist output, in order to
verify that the diagnostics produced is correct.
Current testing setup has many issues:

plist output clobbers tests, making them harder to read
it is impossible to debug test failures given error messages from FileCheck.
The only recourse is manually creating the files and using the diff
again, it is impossible to update the tests given the error message:
the only process is a tedious manual one,
going from a separate plist file to CHECK directives.

This patch offers a much better approach of using "diff" directly in place of FileCheck,
and moving tests to separate files.

Generated using the following script:

```
import os
import glob
import re
import subprocess

diagnostics_key = "// CHECK:  <key>diagnostics</key>"

def process_file(f, data):
    idx = data.index(diagnostics_key)
    plist_out_f = 'ExpectedOutputs/plists/%s.plist' % f
    plist_out_folder = os.path.join('ExpectedOutputs/plists/', os.path.dirname(f))
    plist_data = data[idx:]
    plist_data = plist_data.replace('// CHECK: ', '')
    plist_data = plist_data.replace('// CHECK-NEXT: ', '')
    plist_data += "</dict>\n</plist>\n"
    data = data[:idx]

    ptn = re.compile("FileCheck --?input-file(=| )(%t|%t\.plist) %s")

    if not ptn.findall(data):
        print "none found =/ skipping..."
        return

    data = ptn.sub(lambda m: "tail -n +11 %s | diff -u -w - %%S/../%s" % (m.group(2), plist_out_f), data)

    with open(f, 'w') as out_f:
        out_f.write(data)

    subprocess.check_call(["mkdir", "-p", plist_out_folder])
    with open(plist_out_f, 'w') as out_f:
        out_f.write(plist_data)

def main():
    files = glob.glob("**/*.*")
    for f in files:
        with open(f) as f_handler:
            data = f_handler.read()
        if diagnostics_key in data:
            print "Converting %s" %f
            process_file(f, data)

if __name__ == "__main__":
    main()
```

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

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

6 years agoInvalidate static locals when escaping lambdas
George Karpenkov [Fri, 10 Aug 2018 18:28:04 +0000 (18:28 +0000)]
Invalidate static locals when escaping lambdas

Lambdas can affect static locals even without an explicit capture.

rdar://39537031

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

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

6 years agoAllow relockable scopes with thread safety attributes.
Aaron Ballman [Fri, 10 Aug 2018 17:33:47 +0000 (17:33 +0000)]
Allow relockable scopes with thread safety attributes.

Patch by Aaron Puchert

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

6 years agoMake changes to the check strings so that the test I modified in r339438
Akira Hatanaka [Fri, 10 Aug 2018 17:07:27 +0000 (17:07 +0000)]
Make changes to the check strings so that the test I modified in r339438
passes on 32-bit targets.

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

6 years ago[CodeGen] Merge equivalent block copy/helper functions.
Akira Hatanaka [Fri, 10 Aug 2018 15:09:24 +0000 (15:09 +0000)]
[CodeGen] Merge equivalent block copy/helper functions.

Clang generates copy and dispose helper functions for each block literal
on the stack. Often these functions are equivalent for different blocks.
This commit makes changes to merge equivalent copy and dispose helper
functions and reduce code size.

To enable merging equivalent copy/dispose functions, the captured object
infomation is encoded into the helper function name. This allows IRGen
to check whether an equivalent helper function has already been emitted
and reuse the function instead of generating a new helper function
whenever a block is defined. In addition, the helper functions are
marked as linkonce_odr to enable merging helper functions that have the
same name across translation units and marked as unnamed_addr to enable
the linker's deduplication pass to merge functions that have different
names but the same content.

rdar://problem/42640608

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

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

6 years agoFix a deprecated warning in the last commit.
David Chisnall [Fri, 10 Aug 2018 12:53:18 +0000 (12:53 +0000)]
Fix a deprecated warning in the last commit.

Done as a separate commit to make it easier to cherry pick the changes
to the release branch.

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

6 years agoAdd Windows support for the GNUstep Objective-C ABI V2.
David Chisnall [Fri, 10 Aug 2018 12:53:13 +0000 (12:53 +0000)]
Add Windows support for the GNUstep Objective-C ABI V2.

Summary:
Introduces funclet-based unwinding for Objective-C and fixes an issue
where global blocks can't have their isa pointers initialised on
Windows.

After discussion with Dustin, this changes the name mangling of
Objective-C types to prevent a C++ catch statement of type struct X*
from catching an Objective-C object of type X*.

Reviewers: rjmccall, DHowett-MSFT

Reviewed By: rjmccall, DHowett-MSFT

Subscribers: mgrang, mstorsjo, smeenai, cfe-commits

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

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

6 years agoclang-cl: accept -fcrash-diagnostics-dir=
Hans Wennborg [Fri, 10 Aug 2018 11:40:50 +0000 (11:40 +0000)]
clang-cl: accept -fcrash-diagnostics-dir=

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

6 years agoFix a wrong type bug in ParsedAttr::TypeTagForDatatypeData
Bruno Ricci [Fri, 10 Aug 2018 11:20:20 +0000 (11:20 +0000)]
Fix a wrong type bug in ParsedAttr::TypeTagForDatatypeData

This patch fixes a wrong type bug inside ParsedAttr::TypeTagForDatatypeData.
The details to the best of my knowledge are as follow. The incredible thing
is that everything works out just fine by chance due to a sequence of lucky
coincidences in the layout of various types.

The struct ParsedAttr::TypeTagForDatatypeData contains among other things
a ParsedType *MatchingCType, where ParsedType is just OpaquePtr<QualType>.

However the member MatchingCType is initialized in the constructor for
type_tag_for_datatype attribute as follows:

new (&ExtraData.MatchingCType) ParsedType(matchingCType);

This results in the ParsedType being constructed in the location of the
ParsedType * Later ParsedAttr::getMatchingCType do return
*getTypeTagForDatatypeDataSlot().MatchingCType; which instead of
dereferencing the ParsedType * will dereference the QualType inside
the ParsedType. Now this QualType in this case contains no qualifiers
and therefore is a valid Type *. Therefore getMatchingCType returns a
Type or at least the stuff that is in the first sizeof(void*) bytes of it,
But it turns out that Type inherits from ExtQualsCommonBase and that the
first member of ExtQualsCommonBase is a const Type *const BaseType. This
Type * in this case points to the original Type pointed to by the
QualType and so everything works fine even though all the types were wrong.

This bug was only found because I changed the layout of Type,
which obviously broke all of this long chain of improbable events.

Reviewed By: erichkeane

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

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

6 years agoclang-cl: Support /guard:cf,nochecks
Hans Wennborg [Fri, 10 Aug 2018 09:49:21 +0000 (09:49 +0000)]
clang-cl: Support /guard:cf,nochecks

This extension emits the guard cf table without inserting the
instrumentation. Currently that's what clang-cl does with /guard:cf
anyway, but this allows a user to request that explicitly.

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

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

6 years agoFix size calculation from r339380
Richard Trieu [Fri, 10 Aug 2018 01:30:10 +0000 (01:30 +0000)]
Fix size calculation from r339380

r339380 changed the trailing types of ParsedAttr to use llvm::TrailingObjects.
However, it did not copy over one of the size attributes, causing a too
small allocation for this object.  The error was detected with
AddressSanitizer use-after-poison

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

6 years agoMark up deprecated methods as such
Stephen Kelly [Thu, 9 Aug 2018 22:45:38 +0000 (22:45 +0000)]
Mark up deprecated methods as such

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years agoRemove obsolete set call
Stephen Kelly [Thu, 9 Aug 2018 22:44:03 +0000 (22:44 +0000)]
Remove obsolete set call

Summary:
Case case of the switch statement here makes the same call, but it is
already done at the start of the function.

Reviewers: rsmith, dblaikie

Subscribers: cfe-commits

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

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

6 years agoAMDGPU: Add another missing builtin
Matt Arsenault [Thu, 9 Aug 2018 22:18:37 +0000 (22:18 +0000)]
AMDGPU: Add another missing builtin

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

6 years agoAdded LLVM metadata to generated IR to increase vectorization width
Emmett Neyman [Thu, 9 Aug 2018 21:59:01 +0000 (21:59 +0000)]
Added LLVM metadata to generated IR to increase vectorization width

Summary: Edited `loop_proto_to_llvm` to emit metadata at the end of the generated IR. This metadata will increase the vector width when the IR is optimized.

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

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

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

6 years agoFix and recommit r339382 based on solution from RSmith:
Erich Keane [Thu, 9 Aug 2018 21:18:13 +0000 (21:18 +0000)]
Fix and recommit r339382 based on solution from RSmith:

As sent on cfe-commits:
 "You need to use "friend TrailingObjects;" here, not
 "friend class TrailingObjects;", to avoid breaking MSVC
 (which doesn't implement injected-class-names quite according to spec)."

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

6 years agoRevert -r339382, which apparently breaks the Windows build.
Erich Keane [Thu, 9 Aug 2018 21:13:46 +0000 (21:13 +0000)]
Revert -r339382, which apparently breaks the Windows build.

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

6 years agoPort getLocEnd -> getEndLoc
Stephen Kelly [Thu, 9 Aug 2018 21:09:38 +0000 (21:09 +0000)]
Port getLocEnd -> getEndLoc

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years agoPort getLocStart -> getBeginLoc
Stephen Kelly [Thu, 9 Aug 2018 21:08:08 +0000 (21:08 +0000)]
Port getLocStart -> getBeginLoc

Reviewers: teemperor!

Subscribers: jholewinski, whisperity, jfb, cfe-commits

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

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

6 years agoPort getStartLoc -> getBeginLoc
Stephen Kelly [Thu, 9 Aug 2018 21:05:56 +0000 (21:05 +0000)]
Port getStartLoc -> getBeginLoc

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years ago[NFC] Complete the rule-of-5 for ParsedAttr
Erich Keane [Thu, 9 Aug 2018 21:04:34 +0000 (21:04 +0000)]
[NFC] Complete the rule-of-5 for ParsedAttr

Add move assign/construct as 'deleted' to ParsedAttr
to complete the rule-of-5.

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

6 years ago[NFC] Simplify 'friend' declaration in ParsedAttr
Erich Keane [Thu, 9 Aug 2018 21:03:39 +0000 (21:03 +0000)]
[NFC] Simplify 'friend' declaration in ParsedAttr

As suggested in the post-commit review for D50531,
change from the templatized TrailingObjects friend declaration
to a version referring to the base.

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

6 years ago[NFC] Convert ParsedAttr to use llvm::TrailingObjects
Erich Keane [Thu, 9 Aug 2018 20:25:12 +0000 (20:25 +0000)]
[NFC] Convert ParsedAttr to use llvm::TrailingObjects

ParsedAttr is using a hand-rolled trailing-objects
implementation that gets cleaned up quite a bit by
just using llvm::TrailingObjects. This is a large
TrailingObjects list, but most things are length '0'.

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

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

6 years agoFix build
Stephen Kelly [Thu, 9 Aug 2018 20:21:09 +0000 (20:21 +0000)]
Fix build

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

6 years ago[Sema] P0961R1: Relaxing the structured bindings customization point finding rules
Erik Pilkington [Thu, 9 Aug 2018 20:11:13 +0000 (20:11 +0000)]
[Sema] P0961R1: Relaxing the structured bindings customization point finding rules

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

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

6 years agoAdd getEndLoc API to replace getLocEnd
Stephen Kelly [Thu, 9 Aug 2018 20:05:47 +0000 (20:05 +0000)]
Add getEndLoc API to replace getLocEnd

Subscribers: cfe-commits

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

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

6 years agoAdd getBeginLoc API to replace getStartLoc
Stephen Kelly [Thu, 9 Aug 2018 20:05:18 +0000 (20:05 +0000)]
Add getBeginLoc API to replace getStartLoc

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years agoAdd getBeginLoc API to replace getLocStart
Stephen Kelly [Thu, 9 Aug 2018 20:05:03 +0000 (20:05 +0000)]
Add getBeginLoc API to replace getLocStart

Subscribers: cfe-commits

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

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

6 years ago[analyzer] Fix the bug in UninitializedObjectChecker caused by not handling block...
George Karpenkov [Thu, 9 Aug 2018 19:03:12 +0000 (19:03 +0000)]
[analyzer] Fix the bug in UninitializedObjectChecker caused by not handling block pointers

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

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

6 years ago[AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c tests
Sjoerd Meijer [Thu, 9 Aug 2018 14:07:27 +0000 (14:07 +0000)]
[AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c tests

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

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

6 years agoImplement diagnostic stream operator for ParsedAttr.
Erich Keane [Thu, 9 Aug 2018 13:21:32 +0000 (13:21 +0000)]
Implement diagnostic stream operator for ParsedAttr.

As a part of attempting to clean up the way attributes are
printed, this patch adds an operator << to the diagnostics/
partialdiagnostics so that ParsedAttr can be sent directly.

This patch also rewrites a large amount* of the times when
ParsedAttr was printed using its IdentifierInfo object instead
of being printed itself.
*"a large amount" == "All I could find".

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

6 years agoFix structural inequivalency of forward EnumDecl
Gabor Marton [Thu, 9 Aug 2018 12:36:25 +0000 (12:36 +0000)]
Fix structural inequivalency of forward EnumDecl

Summary:
Currently we consider one forward declared RecordDecl and another with a
definition equal. We have to do the same in case of enums.

Reviewers: a_sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

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

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

6 years agoAdd support for importing imaginary literals
Gabor Marton [Thu, 9 Aug 2018 12:18:07 +0000 (12:18 +0000)]
Add support for importing imaginary literals

Reviewers: a_sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

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

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

6 years agoCorrectly initialise global blocks on Windows.
David Chisnall [Thu, 9 Aug 2018 08:02:42 +0000 (08:02 +0000)]
Correctly initialise global blocks on Windows.

Summary:
Windows does not allow globals to be initialised to point to globals in
another DLL.  Exported globals may be referenced only from code.  Work
around this by creating an initialiser that runs in early library
initialisation and sets the isa pointer.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: cfe-commits

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

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

6 years ago[CMake] Use normalized Windows target triples
Petr Hosek [Thu, 9 Aug 2018 02:16:18 +0000 (02:16 +0000)]
[CMake] Use normalized Windows target triples

Changes the default Windows target triple returned by
GetHostTriple.cmake from the old environment names (which we wanted to
move away from) to newer, normalized ones. This also requires updating
all tests to use the new systems names in constraints.

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

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

6 years agoRefactor attribute printing to be a bit more obviously-correct.
Richard Smith [Thu, 9 Aug 2018 01:21:06 +0000 (01:21 +0000)]
Refactor attribute printing to be a bit more obviously-correct.

No functionality change intended.

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

6 years agoAdded another optimization pass to make vectorizing possible
Emmett Neyman [Thu, 9 Aug 2018 00:58:23 +0000 (00:58 +0000)]
Added another optimization pass to make vectorizing possible

Summary: I noticed that my code wasn't going deep into the loop vectorizer code so added another pass that makes it go further.

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

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

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

6 years agoDelete some unreachable AST printing code.
Richard Smith [Thu, 9 Aug 2018 00:44:49 +0000 (00:44 +0000)]
Delete some unreachable AST printing code.

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

6 years ago[VFS] Remove superfluous semicolon from unittest.
Craig Topper [Wed, 8 Aug 2018 22:31:14 +0000 (22:31 +0000)]
[VFS] Remove superfluous semicolon from unittest.

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

6 years ago[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr
Craig Topper [Wed, 8 Aug 2018 22:31:12 +0000 (22:31 +0000)]
[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr

This addresses a FIXME that has existed since before clang supported the builtin.

This time with only reviewed changes.

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

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

6 years ago[ADT] Normalize empty triple components
Petr Hosek [Wed, 8 Aug 2018 22:23:57 +0000 (22:23 +0000)]
[ADT] Normalize empty triple components

LLVM triple normalization is handling "unknown" and empty components
differently; for example given "x86_64-unknown-linux-gnu" and
"x86_64-linux-gnu" which should be equivalent, triple normalization
returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's
config.sub returns "x86_64-unknown-linux-gnu" for both
"x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the
triple normalization to behave the same way, replacing empty triple
components with "unknown".

This addresses PR37129.

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

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

6 years agoRevert r339287 "[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuil...
Craig Topper [Wed, 8 Aug 2018 21:21:21 +0000 (21:21 +0000)]
Revert r339287 "[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr"

This add an additional unintended change in it.

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

6 years ago[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr
Craig Topper [Wed, 8 Aug 2018 20:59:40 +0000 (20:59 +0000)]
[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr

This addresses a FIXME that has existed since before clang supported the builtin.

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

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

6 years ago[Headers] Define *_HAS_SUBNORM for FLT, DBL, LDBL
Pirama Arumuga Nainar [Wed, 8 Aug 2018 20:38:38 +0000 (20:38 +0000)]
[Headers] Define *_HAS_SUBNORM for FLT, DBL, LDBL

Summary:
These macros are defined in the C11 standard and can be defined based on
the __*_HAS_DENORM__ default macros.

Reviewers: bruno, rsmith, doug.gregor

Subscribers: llvm-commits, enh, srhines

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

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

6 years ago[Builtins] Implement __builtin_clrsb to be compatible with gcc
Craig Topper [Wed, 8 Aug 2018 19:55:52 +0000 (19:55 +0000)]
[Builtins] Implement __builtin_clrsb to be compatible with gcc

gcc defines an intrinsic called __builtin_clrsb which counts the number of extra sign bits on a number. This is equivalent to counting the number of leading zeros on a positive number or the number of leading ones on a negative number and subtracting one from the result. Since we can't count leading ones we need to invert negative numbers to count zeros.

This patch will cause the builtin to be expanded inline while gcc uses a call to a function like clrsbdi2 that is implemented in libgcc. But this is similar to what we already do for popcnt. And I don't think compiler-rt supports clrsbdi2.

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

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

6 years ago[CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is specified
Craig Topper [Wed, 8 Aug 2018 19:14:23 +0000 (19:14 +0000)]
[CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is specified

r330571 added a new FrontendTimesIsEnabled variable and replaced many usages of llvm::TimePassesIsEnabled. Including the place that set llvm::TimePassesIsEnabled for -ftime-report. The effect of this is that -ftime-report now only contains the timers specifically referenced in CodeGenAction.cpp and none of the timers in the backend.

This commit adds back the assignment, but otherwise leaves everything else unchanged.

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

6 years agoAMDGPU: Fix enabling denormals by default on pre-VI targets
Matt Arsenault [Wed, 8 Aug 2018 17:48:37 +0000 (17:48 +0000)]
AMDGPU: Fix enabling denormals by default on pre-VI targets

Fast FMAF is not a sufficient condition to enable denormals.
Before VI, enabling denormals caused F32 instructions to
run at F64 speeds.

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

6 years agoCDDecl More automatic variable tail padding test
JF Bastien [Wed, 8 Aug 2018 17:05:17 +0000 (17:05 +0000)]
CDDecl More automatic variable tail padding test

Test tail padded automatic variable at different width, because they encounter different codegen.

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

6 years ago[DebugInfo][OpenCL] Address post-commit review for r338299
Scott Linder [Wed, 8 Aug 2018 15:56:12 +0000 (15:56 +0000)]
[DebugInfo][OpenCL] Address post-commit review for r338299

NFC refactor of code to generate debug info for OpenCL 2.X blocks.

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

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

6 years ago[CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning...
Simon Pilgrim [Wed, 8 Aug 2018 15:53:14 +0000 (15:53 +0000)]
[CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning (PR38210)

As suggested by @theraven on PR38210, this patch fixes the gcc -Woverloaded-virtual warnings by renaming the extra CGObjCGNU::GetSelector method to CGObjCGNU::GetTypedSelector

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

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

6 years agoFix -Wdocumentation warnings. NFCI.
Simon Pilgrim [Wed, 8 Aug 2018 15:34:00 +0000 (15:34 +0000)]
Fix -Wdocumentation warnings. NFCI.

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

6 years ago[AST] Check described template at structural equivalence check.
Balazs Keri [Wed, 8 Aug 2018 15:04:27 +0000 (15:04 +0000)]
[AST] Check described template at structural equivalence check.

Summary:
When checking a class or function the described class or function template
is checked too.
Split StructuralEquivalenceContext::Finish into multiple functions.
Improved test with symmetric check, added new tests.

Reviewers: martong, a.sidorin, a_sidorin, bruno

Reviewed By: martong, a.sidorin

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

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