]> granicus.if.org Git - clang/log
clang
6 years agoRemove another 'using namespace llvm' from the
Alex Lorenz [Thu, 13 Jul 2017 12:49:22 +0000 (12:49 +0000)]
Remove another 'using namespace llvm' from the
RecursiveSymbolVisitor.h header

This should fix the modules build
(http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/).

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

6 years agoRemove 'using namespace llvm' from the USRFinder.h header
Alex Lorenz [Thu, 13 Jul 2017 11:27:12 +0000 (11:27 +0000)]
Remove 'using namespace llvm' from the USRFinder.h header

This should fix the modules build
(http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/).

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

6 years ago[ObjC] Pick a 'readwrite' property when synthesizing ambiguous
Alex Lorenz [Thu, 13 Jul 2017 11:06:22 +0000 (11:06 +0000)]
[ObjC] Pick a 'readwrite' property when synthesizing ambiguous
property and check for incompatible attributes

This commit changes the way ambiguous property synthesis (i.e. when synthesizing
a property that's declared in multiple protocols) is performed. Previously,
Clang synthesized the first property that was found. This lead to problems when
the property was synthesized in a class that conformed to two protocols that
declared that property and a second protocols had a 'readwrite' declaration -
the setter was not synthesized so the class didn't really conform to the second
protocol and user's code would crash at runtime when they would try to set the
property.

This commit ensures that a first readwrite property is selected. This is a
semantic change that changes users code in this manner:

```
@protocol P @property(readonly) int p; @end
@protocol P2 @property(readwrite) id p; @end
@interface I <P2> @end
@implementation I
@syntesize p; // Users previously got a warning here, and Clang synthesized
              // readonly 'int p' here. Now Clang synthesizes readwrite 'id' p..
@end
```

To ensure that this change is safe, the warning about incompatible types is
promoted to an error when this kind of readonly/readwrite ambiguity is detected
in the @implementation. This will ensure that previous code that had this subtle
bug and ignored the warning now will fail to compile with an error, and users
should not get suprises at runtime once they resolve the error.

The commit also extends the ambiguity checker, and now it can detect conflicts
among the different property attributes. An error diagnostic is used for
conflicting attributes, to ensure that the user won't get "suprises" at runtime.

ProtocolPropertyMap is removed in favour of a a set + vector because the map's
order of iteration is non-deterministic, so it couldn't be used to select the
readwrite property.

rdar://31579994

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

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

6 years ago[index] Objective-C method declarations and message sends with
Alex Lorenz [Thu, 13 Jul 2017 10:50:21 +0000 (10:50 +0000)]
[index] Objective-C method declarations and message sends with
an empty first selector piece should store the location of the first ':'

rdar://33188656

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

6 years ago[refactor][rename] Use a single base class for class that finds
Alex Lorenz [Thu, 13 Jul 2017 10:36:33 +0000 (10:36 +0000)]
[refactor][rename] Use a single base class for class that finds
a declaration at location and for class that searches for all occurrences of
a specific declaration

This commit uses a single RecursiveSymbolVisitor class for both
USRLocFindingASTVisitor and NamedDeclOccurrenceFindingVisitor to avoid duplicate
traversal code. It also traverses nested name specifier locs in the new class
and remove the separate matching step.

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

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

6 years agofix typos in comments; NFC
Hiroshi Inoue [Thu, 13 Jul 2017 06:51:20 +0000 (06:51 +0000)]
fix typos in comments; NFC

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

6 years ago[Sema] Mark a virtual CXXMethodDecl as used if a call to it can be
Akira Hatanaka [Thu, 13 Jul 2017 06:08:27 +0000 (06:08 +0000)]
[Sema] Mark a virtual CXXMethodDecl as used if a call to it can be
devirtualized.

The code to detect devirtualized calls is already in IRGen, so move the
code to lib/AST and make it a shared utility between Sema and IRGen.

This commit fixes a linkage error I was seeing when compiling the
following code:

$ cat test1.cpp
struct Base {
  virtual void operator()() {}
};

template<class T>
struct Derived final : Base {
  void operator()() override {}
};

Derived<int> *d;

int main() {
  if (d)
    (*d)();
  return 0;
}

rdar://problem/33195657

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

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

6 years agoReland "[Driver] Update Fuchsia driver path handling"
Petr Hosek [Wed, 12 Jul 2017 22:14:41 +0000 (22:14 +0000)]
Reland "[Driver] Update Fuchsia driver path handling"

Several improvements to the Fuchsia driver:

* Search for C++ library headers and libraries in directories that
are part of the toolchain distribution rather than sysroot.

* Use LLVM support utlities to construct paths to make sure the driver
is also usable on Windows for cross-compiling.

* Change the driver to inherit directly from ToolChain rather than
Generic_GCC since we don't need any of the GCC related multilib logic.

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

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

6 years ago[index] Don't add relation to a NamedDecl with no name
Ben Langmuir [Wed, 12 Jul 2017 22:05:30 +0000 (22:05 +0000)]
[index] Don't add relation to a NamedDecl with no name

Unless it's one of the special cases (tag, category) that we can handle.
This syncs up the check between handling a decl and handling a relation.

This would cause invalid nameless decls to end up in relations despite
having no name or USR.

rdar://problem/32474406

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

6 years agoRevert "[analyzer] Support generating and reasoning over more symbolic constraint...
Dominic Chen [Wed, 12 Jul 2017 21:43:42 +0000 (21:43 +0000)]
Revert "[analyzer] Support generating and reasoning over more symbolic constraint types"

Assertion `Loc::isLocType(SSE->getLHS()->getType())' failed in Analysis/PR3991.m

This reverts commit e469ff2759275e67f9072b3d67fac90f647c0fe6.

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

6 years ago[mips][mt][7/7] Add driver option for the MIPS MT ASE.
Simon Dardis [Wed, 12 Jul 2017 21:13:05 +0000 (21:13 +0000)]
[mips][mt][7/7] Add driver option for the MIPS MT ASE.

Reviewers: atanasyan, slthakur

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

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

6 years agoRevert "[Driver] Update Fuchsia driver path handling"
Petr Hosek [Wed, 12 Jul 2017 21:03:54 +0000 (21:03 +0000)]
Revert "[Driver] Update Fuchsia driver path handling"

The tests are failing on Windows.

This reverts commit 429fe8229496f639df6b0b4734beedb1d4317aa5.

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

6 years ago[DOXYGEN] Corrected typos and incorrect parameters description.
Ekaterina Romanova [Wed, 12 Jul 2017 20:18:55 +0000 (20:18 +0000)]
[DOXYGEN] Corrected typos and incorrect parameters description.

Corrected several typos and incorrect parameters description that Sony
's techinical writer found during review.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.

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

6 years ago[analyzer] Support generating and reasoning over more symbolic constraint types
Dominic Chen [Wed, 12 Jul 2017 19:37:57 +0000 (19:37 +0000)]
[analyzer] Support generating and reasoning over more symbolic constraint types

Summary: Generate more IntSymExpr constraints, perform SVal simplification for IntSymExpr and SymbolCast constraints, and create fully symbolic SymExprs

Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun

Subscribers: mgorny, cfe-commits

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

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

6 years ago[Driver] Update Fuchsia driver path handling
Petr Hosek [Wed, 12 Jul 2017 19:15:51 +0000 (19:15 +0000)]
[Driver] Update Fuchsia driver path handling

Several improvements to the Fuchsia driver:

* Search for C++ library headers and libraries in directories that
are part of the toolchain distribution rather than sysroot.

* Use LLVM support utlities to construct paths to make sure the driver
is also usable on Windows for cross-compiling.

* Change the driver to inherit directly from ToolChain rather than
Generic_GCC since we don't need any of the GCC related multilib logic.

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

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

6 years ago[OPENMP] Emit implicit taskgroup block around taskloop directives.
Alexey Bataev [Wed, 12 Jul 2017 18:09:32 +0000 (18:09 +0000)]
[OPENMP] Emit implicit taskgroup block around taskloop directives.

If taskloop directive has no associated nogroup clause, it must emitted
inside implicit taskgroup block. Runtime supports it, but we need to
generate implicit taskgroup block explicitly to support future
reductions codegen.

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

6 years ago[diagtool] Add a 'find-diagnostic-id' subcommand that converts a name of
Alex Lorenz [Wed, 12 Jul 2017 16:41:49 +0000 (16:41 +0000)]
[diagtool] Add a 'find-diagnostic-id' subcommand that converts a name of
the diagnostic to its enum value

This will be used by a script that invokes clang in a debugger and forces it
to stop when it reports a particular diagnostic.

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

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

6 years ago[clang] buildFixItInsertionLine should use Hints of the same FID and LineNo
Chih-Hung Hsieh [Wed, 12 Jul 2017 16:25:40 +0000 (16:25 +0000)]
[clang] buildFixItInsertionLine should use Hints of the same FID and LineNo

Fix bug https://bugs.llvm.org/show_bug.cgi?id=33734

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

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

6 years ago[clang-format] Keep level of comment before an empty line
Krasimir Georgiev [Wed, 12 Jul 2017 15:21:43 +0000 (15:21 +0000)]
[clang-format] Keep level of comment before an empty line

Summary:
This patch fixes bug https://bugs.llvm.org/show_bug.cgi?id=3313: a comment line
was aligned with the next #ifdef even in the presence of an empty line between
them.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

6 years ago[libclang] Support for querying whether an enum is scoped
Alex Lorenz [Wed, 12 Jul 2017 11:35:11 +0000 (11:35 +0000)]
[libclang] Support for querying whether an enum is scoped

This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).

Patch by Johann Klähn!

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

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

6 years agoRevert r307769 (Forgot to mention the name of the contributor).
Alex Lorenz [Wed, 12 Jul 2017 11:34:14 +0000 (11:34 +0000)]
Revert r307769 (Forgot to mention the name of the contributor).

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

6 years ago[libclang] Support for querying whether an enum is scoped
Alex Lorenz [Wed, 12 Jul 2017 11:31:37 +0000 (11:31 +0000)]
[libclang] Support for querying whether an enum is scoped

This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).

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

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

6 years agoExpose some type-conversion functions as part of the IRGen ABI.
John McCall [Wed, 12 Jul 2017 07:44:17 +0000 (07:44 +0000)]
Expose some type-conversion functions as part of the IRGen ABI.

Patch by Benoit Vey!

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

6 years agoCFG: Add CFGElement for automatic variables that leave the scope
Matthias Gehre [Wed, 12 Jul 2017 07:04:19 +0000 (07:04 +0000)]
CFG: Add CFGElement for automatic variables that leave the scope

Summary:
This mimics the implementation for the implicit destructors. The
generation of this scope leaving elements is hidden behind
a flag to the CFGBuilder, thus it should not affect existing code.

Currently, I'm missing a test (it's implicitly tested by the clang-tidy
lifetime checker that I'm proposing).
I though about a test using debug.DumpCFG, but then I would
have to add an option to StaticAnalyzer/Core/AnalyzerOptions
to enable the scope leaving CFGElement,
which would only be useful to that particular test.

Any other ideas how I could make a test for this feature?

Reviewers: krememek, jordan_rose

Subscribers: cfe-commits

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

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

6 years ago[ODRHash] Revert r307720 to fix buildbot.
Richard Trieu [Wed, 12 Jul 2017 00:38:27 +0000 (00:38 +0000)]
[ODRHash] Revert r307720 to fix buildbot.

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

6 years agoEnhance synchscope representation (clang)
Konstantin Zhuravlyov [Tue, 11 Jul 2017 22:23:37 +0000 (22:23 +0000)]
Enhance synchscope representation (clang)

Relevant changes required for r307722.

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

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

6 years ago[ODRHash] Support more method types.
Richard Trieu [Tue, 11 Jul 2017 22:10:49 +0000 (22:10 +0000)]
[ODRHash] Support more method types.

Hash CXXConstructorDecl and CXXDestructorDecl.  Extend the diagnostics from
CXXMethodDecl to include constructors and destructors.

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

6 years ago[OPENMP] Skip BuildMemberExpr() in BuildFieldReferenceExpr(), NFC, by Kai Noda
Alexey Bataev [Tue, 11 Jul 2017 19:43:28 +0000 (19:43 +0000)]
[OPENMP] Skip BuildMemberExpr() in BuildFieldReferenceExpr(), NFC, by Kai Noda

In the OpenMP mode, we don't need to call BuildMemberExpr() only to discard its
return value. BuildDeclRefExpr() is called instead.

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

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

6 years ago[OPENMP] Add restriction for reduction clause in taskloop directives.
Alexey Bataev [Tue, 11 Jul 2017 19:16:44 +0000 (19:16 +0000)]
[OPENMP] Add restriction for reduction clause in taskloop directives.

Added checks for the reduction clauses in the taskloop directives:
1. Only addressable items must be used in reduction clauses.
2. Reduction clauses cannot be used with nogroup clauses.

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

6 years agoAdd missing dllimport member pointer template argument test from r307446
Reid Kleckner [Tue, 11 Jul 2017 16:18:05 +0000 (16:18 +0000)]
Add missing dllimport member pointer template argument test from r307446

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

6 years agoNetBSD uses soft-float by default, unless the environment is EABIHF or
Joerg Sonnenberger [Tue, 11 Jul 2017 15:50:48 +0000 (15:50 +0000)]
NetBSD uses soft-float by default, unless the environment is EABIHF or
GNUEABIHF.

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

6 years agoRun the preprocessor test as frontend test for NetBSD, since CC1 mode
Joerg Sonnenberger [Tue, 11 Jul 2017 15:49:45 +0000 (15:49 +0000)]
Run the preprocessor test as frontend test for NetBSD, since CC1 mode
doesn't get flags like the default target CPU. Update for test to
reflect the difference.

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

6 years ago[ASTMatchers][NFC] integerLiteral(): Mention negative integers in
Clement Courbet [Tue, 11 Jul 2017 15:45:22 +0000 (15:45 +0000)]
[ASTMatchers][NFC] integerLiteral(): Mention negative integers in
documentation.

Trying to match integerLiteral(-1) will silently fail, because an numeric
literal is always positive.
- Update the documentation to explain how to match negative numeric
  literals.
- Add a unit test.

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

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

6 years ago[ObjC] Check that a subscript methods is declared for a qualified id type
Alex Lorenz [Tue, 11 Jul 2017 10:18:35 +0000 (10:18 +0000)]
[ObjC] Check that a subscript methods is declared for a qualified id type

Objective-C subscript expressions report errors when a subscript method is not
declared in the base class. However, prior to this commit, qualified id types
were not checked. This commit ensures that an appropriate error is reported
when a subscript method is not declared in any of the protocols that are
included in the qualified id type.

rdar://33213924

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

6 years agoRecursiveASTVisitor should visit the nested name qualifiers in
Alex Lorenz [Tue, 11 Jul 2017 09:39:23 +0000 (09:39 +0000)]
RecursiveASTVisitor should visit the nested name qualifiers in
a template specialisation

rdar://33123354

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

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

6 years ago[mips] Create the correct profiling symbol on Linux MIPS
Simon Atanasyan [Tue, 11 Jul 2017 06:19:01 +0000 (06:19 +0000)]
[mips] Create the correct profiling symbol on Linux MIPS

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

6 years ago[analyzer] Start fixing modeling of bool based types
Alexander Shaposhnikov [Tue, 11 Jul 2017 00:30:14 +0000 (00:30 +0000)]
[analyzer] Start fixing modeling of bool based types

This is a follow up for one of
the previous diffs https://reviews.llvm.org/D32328.
getTypeSize and with getIntWidth are not equivalent for bool
(see https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l08444),
this causes a number of issues
(for instance, if APint X representing a bool is created
with the wrong bit width then X is not comparable against Min/Max
(because of the different bit width), that results in crashes
(triggered asserts) inside assume* methods),
for examples see the newly added test cases.

Test plan: make check-all

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

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

6 years ago[clang-import-test] Test that enumerators and their values are found.
Sean Callanan [Tue, 11 Jul 2017 00:29:37 +0000 (00:29 +0000)]
[clang-import-test] Test that enumerators and their values are found.

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

6 years ago[clang-import-test] Committed missed update to clang-import-test.cpp
Sean Callanan [Tue, 11 Jul 2017 00:27:57 +0000 (00:27 +0000)]
[clang-import-test] Committed missed update to clang-import-test.cpp

I didn't commit clang-import-test.cpp in r307600, but it had some
changes that were part of https://reviews.llvm.org/D35220

Corrected that now.

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

6 years agoclang-import-test had some dead code. I did the following to eliminate it:
Sean Callanan [Mon, 10 Jul 2017 23:47:00 +0000 (23:47 +0000)]
clang-import-test had some dead code. I did the following to eliminate it:

- eliminated error handling for the indirect CompilerInstance, which should
  never generate an error as it is created;
- added a new test for direct importation; and
- removed an unused implementation of the CompleteType() API.

This brings clang-import-test.cpp and ExternalASTMerge.cpp back to 100%
coverage on all metrics measured by DLLVM_BUILD_INSTRUMENTED_COVERAGE.

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

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

6 years agoIsSpecialLong was only ever set in release mode as all of the uses are in asserts...
Eric Christopher [Mon, 10 Jul 2017 21:28:54 +0000 (21:28 +0000)]
IsSpecialLong was only ever set in release mode as all of the uses are in asserts. Wrap in ifndef NDEBUG.

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

6 years agoUse DenseMap instead std::map for GVSummaryMapTy
Dehao Chen [Mon, 10 Jul 2017 20:31:37 +0000 (20:31 +0000)]
Use DenseMap instead std::map for GVSummaryMapTy

Summary: Frontend change for https://reviews.llvm.org/D35148

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, cfe-commits

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

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

6 years agoAvoid white spaces in file names. NFC
Eric Liu [Mon, 10 Jul 2017 16:05:48 +0000 (16:05 +0000)]
Avoid white spaces in file names. NFC

Summary: White spaces in file names are causing Phabricator/SVN to crash.

Reviewers: bkramer

Subscribers: bogner, cfe-commits

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

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

6 years agoX86 Intrinsics: _bit_scan_forward should not be under #ifdef __RDRND__
Zvi Rackover [Mon, 10 Jul 2017 07:13:56 +0000 (07:13 +0000)]
X86 Intrinsics: _bit_scan_forward should not be under #ifdef __RDRND__

Summary:
The _bit_scan_forward and _bit_scan_reverse intrinsics were accidentally
masked under the preprocessor checks that prune intrinsics definitions for the
benefit of faster compile-time on Windows. This patch moves the
definitons out of that region.

Fixes pr33722

Reviewers: craig.topper, aaboud, thakis

Reviewed By: craig.topper

Subscribers: cfe-commits

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

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

6 years agoRemove incorrect FIXME comment; the FIXME was addressed before the changes were committed
Eric Fiselier [Mon, 10 Jul 2017 02:59:26 +0000 (02:59 +0000)]
Remove incorrect FIXME comment; the FIXME was addressed before the changes were committed

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

6 years agoRemove non-ascii characters introduced in r307513
Eric Fiselier [Mon, 10 Jul 2017 02:52:34 +0000 (02:52 +0000)]
Remove non-ascii characters introduced in r307513

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

6 years ago[coroutines] Include the implicit object parameter type when looking up coroutine_tra...
Eric Fiselier [Mon, 10 Jul 2017 01:27:22 +0000 (01:27 +0000)]
[coroutines] Include the implicit object parameter type when looking up coroutine_traits for member functions.

This patch was originally from Toby Allsopp, but I hijacked it and
fixed it up with his permission.

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

6 years ago[analyzer] Faster hashing of subsequences in CompoundStmts.
Raphael Isemann [Sun, 9 Jul 2017 21:14:36 +0000 (21:14 +0000)]
[analyzer] Faster hashing of subsequences in CompoundStmts.

Summary: This patches improves the hashing subsequences in CompoundStmts by incrementally hashing all subsequences with the same starting position. This results in a reduction of the time for this constraint while running over SQLite from 1.10 seconds to 0.55 seconds (-50%).

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: cfe-commits, xazax.hun, v.g.vassilev

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

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

6 years ago[X86] Add more feature flag bit defines to cpuid.h for gcc compatibility.
Craig Topper [Sun, 9 Jul 2017 17:43:11 +0000 (17:43 +0000)]
[X86] Add more feature flag bit defines to cpuid.h for gcc compatibility.

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

6 years ago[X86] Add __get_cpuid_count to cpuid.h. Update __get_cpuid to check the maximum level...
Craig Topper [Sun, 9 Jul 2017 17:43:10 +0000 (17:43 +0000)]
[X86] Add __get_cpuid_count to cpuid.h. Update __get_cpuid to check the maximum level support before accessing the leaf. Rename level to leaf everywhere.

This matches gcc behavior.

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

6 years ago[analyzer] Make StmtDataCollector part of the CloneDetection API
Raphael Isemann [Sun, 9 Jul 2017 15:56:39 +0000 (15:56 +0000)]
[analyzer] Make StmtDataCollector part of the CloneDetection API

Summary: We probably want to use this useful templates in other pieces of code (e.g. the one from D34329), so we should make this public.

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: cfe-commits, xazax.hun, v.g.vassilev, johannes

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

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

6 years agoFix build failure with gcc about mixing enum and non-enum
Yaxun Liu [Sat, 8 Jul 2017 19:13:41 +0000 (19:13 +0000)]
Fix build failure with gcc about mixing enum and non-enum

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

6 years ago[Bash-autocompletion] Auto complete cc1 options if -cc1 is specified
Yuka Takahashi [Sat, 8 Jul 2017 17:48:59 +0000 (17:48 +0000)]
[Bash-autocompletion] Auto complete cc1 options if -cc1 is specified

Summary:
We don't want to autocomplete flags whose Flags class has `NoDriverOption` when argv[1] is not `-cc1`.

Another idea for this implementation is to make --autocomplete a cc1
option and handle it in clang Frontend, by porting --autocomplete
handler from Driver to Frontend, so that we can handle Driver options
and CC1 options in unified manner.

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

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

6 years ago[Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properly
Yuka Takahashi [Sat, 8 Jul 2017 17:34:02 +0000 (17:34 +0000)]
[Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properly

Summary: Fixed a bug that -foo=bar wasn't handled properly on old version of bash.

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

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

6 years ago[CodeGen] Fold variable into assert.
Benjamin Kramer [Sat, 8 Jul 2017 14:14:57 +0000 (14:14 +0000)]
[CodeGen] Fold variable into assert.

Avoids warnings in Release builds.

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

6 years agoCodeGen: Fix address space of global variable
Yaxun Liu [Sat, 8 Jul 2017 13:24:52 +0000 (13:24 +0000)]
CodeGen: Fix address space of global variable

Certain targets (e.g. amdgcn) require global variable to stay in global or constant address
space. In C or C++ global variables are emitted in the default (generic) address space.
This patch introduces virtual functions TargetCodeGenInfo::getGlobalVarAddressSpace
and TargetInfo::getConstantAddressSpace to handle this in a general approach.

It only affects IR generated for amdgcn target.

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

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

6 years ago[analyzer] Fix a path in the developer manual
Gabor Horvath [Sat, 8 Jul 2017 08:23:52 +0000 (08:23 +0000)]
[analyzer] Fix a path in the developer manual

Patch by: Reka Nikolett Kovacs

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

6 years ago[ODRHash] Support FriendDecl
Richard Trieu [Sat, 8 Jul 2017 02:04:42 +0000 (02:04 +0000)]
[ODRHash] Support FriendDecl

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

6 years ago[X86] Move AVX512VPOPCNTDQ in __builtin_cpu_support's enum to match trunk gcc.
Craig Topper [Sat, 8 Jul 2017 00:47:44 +0000 (00:47 +0000)]
[X86] Move AVX512VPOPCNTDQ in __builtin_cpu_support's enum to match trunk gcc.

There are two other features before it that we don't currently support in the the frontend or backend so I left placeholders to keep the encoding correct.

I think the compiler-rt implementation of this feature is even further out of date.

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

6 years agoFix warnings introduced by r307434.
Richard Smith [Sat, 8 Jul 2017 00:37:59 +0000 (00:37 +0000)]
Fix warnings introduced by r307434.

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

6 years agoRevert r307445 as it breaks on certain platforms.
Dehao Chen [Fri, 7 Jul 2017 22:40:37 +0000 (22:40 +0000)]
Revert r307445 as it breaks on certain platforms.

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

6 years ago[MS] Don't statically initialize dllimport member function pointers
Reid Kleckner [Fri, 7 Jul 2017 22:04:29 +0000 (22:04 +0000)]
[MS] Don't statically initialize dllimport member function pointers

Summary:
r306137 made dllimport pointers to member functions non-constant. This
is correct because a load must be executed to resolve any dllimported
data. However, r306137 did not account for the use of dllimport member
function pointers used as template arguments.

This change re-lands r306137 with a template instantiation fix.

This fixes PR33570.

Reviewers: rnk, majnemer

Subscribers: cfe-commits

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

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

6 years agoAdd sample PGO integration test to cover profile annotation and inlining.
Dehao Chen [Fri, 7 Jul 2017 22:01:47 +0000 (22:01 +0000)]
Add sample PGO integration test to cover profile annotation and inlining.

Summary: The patch makes the integration test cover major sample PGO components.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: sanjoy, cfe-commits

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

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

6 years agoAdd testcase for r305850.
Lang Hames [Fri, 7 Jul 2017 21:51:11 +0000 (21:51 +0000)]
Add testcase for r305850.

Accidentally left this out of the original commit.

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

6 years agoEnable the new PM + SamlePGO + ThinLTO testing.
Dehao Chen [Fri, 7 Jul 2017 20:53:17 +0000 (20:53 +0000)]
Enable the new PM + SamlePGO + ThinLTO testing.

Summary: This patch should be enabled after https://reviews.llvm.org/D34895

Reviewers: chandlerc, tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: sanjoy, mehdi_amini, inglorion, eraman, cfe-commits

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

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

6 years ago[modules ts] Basic for module linkage.
Richard Smith [Fri, 7 Jul 2017 20:04:28 +0000 (20:04 +0000)]
[modules ts] Basic for module linkage.

In addition to the formal linkage rules, the Modules TS includes cases where
internal-linkage symbols within a module interface unit can be referenced from
outside the module via exported inline functions / templates. We give such
declarations "module-internal linkage", which is formally internal linkage, but
results in an externally-visible symbol.

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

6 years ago[X86] Replace 'fallthrough' comments with LLVM_FALLTHROUGH.
Craig Topper [Fri, 7 Jul 2017 18:41:09 +0000 (18:41 +0000)]
[X86] Replace 'fallthrough' comments with LLVM_FALLTHROUGH.

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

6 years agoclang-format: [JS] do not wrap after "readonly".
Martin Probst [Fri, 7 Jul 2017 13:17:10 +0000 (13:17 +0000)]
clang-format: [JS] do not wrap after "readonly".

Summary:
Breaks after "readonly" trigger automatic semicolon insertion in field
declarations.

Reviewers: krasimir, djasper

Subscribers: klimek

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

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

6 years agoRecommit [driver][macOS] Pick the system version for the
Alex Lorenz [Fri, 7 Jul 2017 10:41:19 +0000 (10:41 +0000)]
Recommit [driver][macOS] Pick the system version for the
deployment target if the SDK is newer than the system

This commit reverts the revert commit r305891. Now the change from r305678
should be correct because `llvm::sys::getProcessTriple` now returns the correct
macOS version of the system after the LLVM change r307372.

Original commit message:

This commit improves the driver by making sure that it picks the system version
for the deployment target when the version of the macOS SDK is newer than the
system version.

rdar://29449467

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

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

6 years ago[driver][mips] Pass long-calls feature flag to the MIPS backend
Simon Atanasyan [Fri, 7 Jul 2017 10:35:33 +0000 (10:35 +0000)]
[driver][mips] Pass long-calls feature flag to the MIPS backend

Check the `-mlong-calls` command line option and pass the `long-calls`
feature flag to the backend. Handling of this feature flag in the backend
needs to be implemented by a separate commit.

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

6 years ago[Frontend] Verify that the bitstream is not empty before reading
Alex Lorenz [Fri, 7 Jul 2017 10:25:12 +0000 (10:25 +0000)]
[Frontend] Verify that the bitstream is not empty before reading
the serialised diagnostics

Clang should avoid calling report_fatal_error when the file with the serialised
diagnostics is empty. This commit changes Clang's serialised diagnostic reader,
now it reports an appropriate error instead of crashing.

rdar://31939877

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

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

6 years agoFix crash parsing invalid code
Olivier Goffart [Fri, 7 Jul 2017 09:38:59 +0000 (09:38 +0000)]
Fix crash parsing invalid code

The code in the test caused a crash with this backtrace:

 RecordLayoutBuilder.cpp:2934: const clang::ASTRecordLayout &clang::ASTContext::getASTRecordLayout(const clang::RecordDecl *) const: Assertion `!D->isInvalidDecl() && "Cannot get layout of invalid decl!"' failed.
 [...]
 #7 0x00007f63963d845a __assert_fail_base (/usr/lib/libc.so.6+0x2c45a)
 #8 0x00007f63963d84d2 (/usr/lib/libc.so.6+0x2c4d2)
 #9 0x00007f63937a0631 clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const /home/olivier/prog/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:2935:3
 #10 0x00007f63937a1ad5 getFieldOffset(clang::ASTContext const&, clang::FieldDecl const*) /home/olivier/prog/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:3057:37
 #11 0x00007f6391869f14 clang::Sema::RefersToMemberWithReducedAlignment(clang::Expr*, llvm::function_ref<void (clang::Expr*, clang::RecordDecl*, clang::FieldDecl*, clang::CharUnits)>) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaChecking.cpp:12139:23
 #12 0x00007f639186a2f8 clang::Sema::CheckAddressOfPackedMember(clang::Expr*) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaChecking.cpp:12190:1
 #13 0x00007f6391a7a81c clang::Sema::CheckAddressOfOperand(clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaExpr.cpp:11111:10
 #14 0x00007f6391a7f5d2 clang::Sema::CreateBuiltinUnaryOp(clang::SourceLocation, clang::UnaryOperatorKind, clang::Expr*) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaExpr.cpp:11932:18

Fixing by bailing out for invalid classes.

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

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

6 years ago[ObjC] Avoid the -Wunguarded-availability warnings for protocol
Alex Lorenz [Fri, 7 Jul 2017 09:15:29 +0000 (09:15 +0000)]
[ObjC] Avoid the -Wunguarded-availability warnings for protocol
requirements in protocol/class/category declarations

The unguarded availability warnings in the protocol requirements of a protocol
/class/category declaration can be avoided. This matches the behaviour of
Swift's diagnostics. The warnings for deprecated/unavailable protocols are
preserved.

rdar://33156429

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

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

6 years agoUpdate Cross-DSO CFI documentation.
Evgeniy Stepanov [Fri, 7 Jul 2017 00:48:12 +0000 (00:48 +0000)]
Update Cross-DSO CFI documentation.

Reviewers: pcc

Subscribers: llvm-commits

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

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

6 years agoThis call-site should have been updated as part of D34304.
Sterling Augustine [Thu, 6 Jul 2017 22:47:19 +0000 (22:47 +0000)]
This call-site should have been updated as part of D34304.

Summary: Use an argument adjuster to preserve behavior inadvertantly changed by D34304.

Reviewers: klimek

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

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

6 years agoChange remaining references to lit.util.capture to use subprocess.check_output.
David L. Jones [Thu, 6 Jul 2017 21:46:47 +0000 (21:46 +0000)]
Change remaining references to lit.util.capture to use subprocess.check_output.

Summary:
The capture() function was removed in r306625. This should fix PGO breakages
reported by Michael Zolotukhin.

Reviewers: mzolotukhin

Subscribers: sanjoy, llvm-commits

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

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

6 years agoReject attempts to build a module without -fmodules, rather than silently doing weird...
Richard Smith [Thu, 6 Jul 2017 21:05:56 +0000 (21:05 +0000)]
Reject attempts to build a module without -fmodules, rather than silently doing weird things.

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

6 years agoAllow CompilerInvocations to generate .d files.
Sterling Augustine [Thu, 6 Jul 2017 21:02:52 +0000 (21:02 +0000)]
Allow CompilerInvocations to generate .d files.

Summary:
Most clang tools should ignore the -M
family of options because one wouldn't want them
to generate a new dependency (.d) file. However,
some tools may want this dependency file. This
patch creates a mechanism for them to do this.

This implementation just plumbs a boolean down
several layers of calls. Each of the modified calls
has several call sites, and so a single member
variable or new API entry point won't work.

An alternative would be to write a function to filter
the -M family of arguments out of CC1Args, and have
each caller call that function by hand before calling
newInvocation, Invocation::run, or buildAstFromCodeWithArgs.
This is a more complicated and error-prone solution.
Why burden all the callers to remember to use
this function?

But I could rewrite this patch to use that method if
that is deemed more appropriate.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

6 years ago [Objective-C] Fix non-determinism in clang
Mandeep Singh Grang [Thu, 6 Jul 2017 18:49:57 +0000 (18:49 +0000)]
 [Objective-C] Fix non-determinism in clang

Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet).

Reviewers: dblaikie, davide, rsmith

Reviewed By: dblaikie

Subscribers: cfe-commits, llvm-commits

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

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

6 years agoThis reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
Sjoerd Meijer [Thu, 6 Jul 2017 16:37:31 +0000 (16:37 +0000)]
This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
problems in testing, see comments in D34161 for some more details.
A fix is in progres in D35011, but a revert seems better now as the fix will
probably take some more time to land.

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

6 years ago[OpenMP] Extend CLANG target options with device offloading kind.
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:22:21 +0000 (16:22 +0000)]
[OpenMP] Extend CLANG target options with device offloading kind.

Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld

Reviewed By: hfinkel

Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits

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

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

6 years ago[OpenMP] Customize CUDA-based tool chain selection
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:08:15 +0000 (16:08 +0000)]
[OpenMP] Customize CUDA-based tool chain selection

Summary: This patch provides a generic way of selecting CUDA based tool chains as host-device pairs.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: Hahnfeld

Subscribers: rengolin, cfe-commits

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

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

6 years ago[clang-format] Add TextProto language name, NFC
Krasimir Georgiev [Thu, 6 Jul 2017 14:39:39 +0000 (14:39 +0000)]
[clang-format] Add TextProto language name, NFC

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

6 years ago[clang-format] Add space between a message field key and the opening bracket in proto...
Krasimir Georgiev [Thu, 6 Jul 2017 13:58:29 +0000 (13:58 +0000)]
[clang-format] Add space between a message field key and the opening bracket in proto messages

Summary:
This patch updates the formatting of message fields of type `a{...}` to `a {...}`
for proto messages.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[OpenCL] Test on image access modifiers and image type can only be a type of a functi...
Egor Churaev [Thu, 6 Jul 2017 07:06:11 +0000 (07:06 +0000)]
[OpenCL] Test on image access modifiers and image type can only be a type of a function argument.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years ago[modules ts] Do not emit strong function definitions from the module interface unit...
Richard Smith [Thu, 6 Jul 2017 00:30:00 +0000 (00:30 +0000)]
[modules ts] Do not emit strong function definitions from the module interface unit in every user.

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

7 years ago[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS...
Richard Smith [Thu, 6 Jul 2017 00:29:13 +0000 (00:29 +0000)]
[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS flag to work if copy-pasted.

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

7 years agoFix test case in pre-C++11 mode; address Aaron Ballman's code review.
Douglas Gregor [Wed, 5 Jul 2017 21:12:37 +0000 (21:12 +0000)]
Fix test case in pre-C++11 mode; address Aaron Ballman's code review.

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

7 years agoFix one more reference to lit.util.capture()
Michael Zolotukhin [Wed, 5 Jul 2017 21:06:11 +0000 (21:06 +0000)]
Fix one more reference to lit.util.capture()

The capture method was removed in r306643.

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

7 years agoCope with Range-v3's CONCEPT_REQUIRES idiom
Douglas Gregor [Wed, 5 Jul 2017 20:20:15 +0000 (20:20 +0000)]
Cope with Range-v3's CONCEPT_REQUIRES idiom

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

7 years agoCustomize the SFINAE diagnostics for enable_if to provide the failed condition.
Douglas Gregor [Wed, 5 Jul 2017 20:20:14 +0000 (20:20 +0000)]
Customize the SFINAE diagnostics for enable_if to provide the failed condition.

When enable_if disables a particular overload resolution candidate,
rummage through the enable_if condition to find the specific condition
that caused the failure. For example, if we have something like:

    template<
      typename Iter,
      typename = std::enable_if_t<Random_access_iterator<Iter> &&
                                  Comparable<Iterator_value_type<Iter>>>>
    void mysort(Iter first, Iter last) {}

and we call "mysort" with "std::list<int>" iterators, we'll get a
diagnostic saying that the "Random_access_iterator<Iter>" requirement
failed. If we call "mysort" with
"std::vector<something_not_comparable>", we'll get a diagnostic saying
that the "Comparable<...>" requirement failed.

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

7 years agoAdd docs for -foptimization-record-file=
Brian Gesiak [Wed, 5 Jul 2017 19:55:51 +0000 (19:55 +0000)]
Add docs for -foptimization-record-file=

Summary: The Clang option was previously not included in the User's Manual.

Reviewers: anemet, davidxl, hfinkel

Reviewed By: hfinkel

Subscribers: cfe-commits

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

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

7 years ago[Sema] Don't allow -Wunguarded-availability to be silenced with redecls
Erik Pilkington [Wed, 5 Jul 2017 17:08:56 +0000 (17:08 +0000)]
[Sema] Don't allow -Wunguarded-availability to be silenced with redecls

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

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

7 years agoAddress comments that escaped D33333
Erich Keane [Wed, 5 Jul 2017 16:43:45 +0000 (16:43 +0000)]
Address comments that escaped D33333

Patch By: Jen Yu

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

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

7 years ago[SystemZ] Simplify handling of ISA revisions
Ulrich Weigand [Wed, 5 Jul 2017 13:19:47 +0000 (13:19 +0000)]
[SystemZ] Simplify handling of ISA revisions

This moves determination of the ISA revision from the CPU name to
one single place, removing a bunch of duplicated code.  It also
makes the supported ISA revisions available as feature strings.

No functional change.

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

7 years ago[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:37 +0000 (12:57 +0000)]
[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC

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

7 years ago[driver][mips] Remove redundant curly brackets. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:32 +0000 (12:57 +0000)]
[driver][mips] Remove redundant curly brackets. NFC

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

7 years ago[clang-format] Fix an uninitialized memory access
Krasimir Georgiev [Wed, 5 Jul 2017 12:24:01 +0000 (12:24 +0000)]
[clang-format] Fix an uninitialized memory access

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

7 years agoAdd const to reference arguments of Diagnostic ctor
Alexander Kornienko [Wed, 5 Jul 2017 11:45:09 +0000 (11:45 +0000)]
Add const to reference arguments of Diagnostic ctor

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

7 years agoFix invalid warnings for header guards in preambles
Erik Verbruggen [Wed, 5 Jul 2017 09:44:07 +0000 (09:44 +0000)]
Fix invalid warnings for header guards in preambles

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

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

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