]> granicus.if.org Git - clang/log
clang
7 years agogetObjCEncodingForMethodDecl cannot fail. Simplify. NFC.
John McCall [Tue, 29 Nov 2016 21:57:00 +0000 (21:57 +0000)]
getObjCEncodingForMethodDecl cannot fail.  Simplify.  NFC.

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

7 years agoDon't declare IsEnumDeclComplete as extern
Reid Kleckner [Tue, 29 Nov 2016 20:46:24 +0000 (20:46 +0000)]
Don't declare IsEnumDeclComplete as extern

Otherwise MSVC and clang-cl will see "extern inline" after merging
redeclarations and emit it in all TUs that include Type.h and Decl.h.

Noticed by inspection, since it's always the first thing to get emitted.

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

7 years agoSupport constant expression evaluation for wchar_t versions of simple string
Richard Smith [Tue, 29 Nov 2016 19:45:17 +0000 (19:45 +0000)]
Support constant expression evaluation for wchar_t versions of simple string
functions, in order to support constexpr std::char_traits<wchar_t>.

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

7 years ago[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.
Anastasia Stulova [Tue, 29 Nov 2016 17:01:19 +0000 (17:01 +0000)]
[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.

Avoid using shortcut for const qualified non-constant address space
aggregate variables while generating them on the stack such that
the alloca object is used instead of a global variable containing
initializer.

Review: https://reviews.llvm.org/D27109

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

7 years ago[AST] Use static_assert to verify types instead of undefined classes.
Benjamin Kramer [Tue, 29 Nov 2016 12:41:21 +0000 (12:41 +0000)]
[AST] Use static_assert to verify types instead of undefined classes.

No functionliaty change intended.

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

7 years ago[OpenCL] Prohibit using reserve_id_t in program scope.
Alexey Bader [Tue, 29 Nov 2016 10:21:40 +0000 (10:21 +0000)]
[OpenCL] Prohibit using reserve_id_t in program scope.

Patch by Egor Churaev (echuraev).

Reviewers: Anastasia

Subscribers: cfe-commits, yaxunl, bader

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

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

7 years agoRemoved DEBUG_TYPE from TokenAnalyzer.h
Krasimir Georgiev [Tue, 29 Nov 2016 10:21:28 +0000 (10:21 +0000)]
Removed DEBUG_TYPE from TokenAnalyzer.h

Summary:
Defining DEBUG_TYPE in a header file doesn't make sense.
It is already defined in the corresponding source file.

Reviewers: klimek, ioeric

Subscribers: klimek

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

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

7 years agoCorrect comment: we are creating a canonicla decltypetype.
Yaron Keren [Tue, 29 Nov 2016 10:08:20 +0000 (10:08 +0000)]
Correct comment: we are creating a canonicla decltypetype.

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

7 years agoclang-format: [JS] Properly format dict literals that skip labels.
Daniel Jasper [Tue, 29 Nov 2016 09:40:36 +0000 (09:40 +0000)]
clang-format: [JS] Properly format dict literals that skip labels.

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

7 years agoclang-format: Wrap complex binary expressions on the RHS of a comma.
Daniel Jasper [Tue, 29 Nov 2016 09:40:32 +0000 (09:40 +0000)]
clang-format: Wrap complex binary expressions on the RHS of a comma.

Specifically, if the RHS of a comma is a complex binary expression and
spans multiple lines, insert a line break before it. This usually is
often more readable compared to producing a hanging indent. See changes
in FormatTest.cpp for examples.

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

7 years agoclang-format: Fix unnnecessary line break.
Daniel Jasper [Tue, 29 Nov 2016 09:40:01 +0000 (09:40 +0000)]
clang-format: Fix unnnecessary line break.

Before:
  aaaaaaaaaa(aaaa(aaaa,
  aaaa), //
     aaaa,
             aaaaa);

After:
  aaaaaaaaaa(aaaa(aaaa,
  aaaa), //
     aaaa, aaaaa);

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

7 years agoAdd a warning for 'main' returning 'true' or 'false'.
Richard Smith [Tue, 29 Nov 2016 01:35:17 +0000 (01:35 +0000)]
Add a warning for 'main' returning 'true' or 'false'.

Patch by Joshua Hurwitz!

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

7 years agoUse ${:uid} to generate unique MS asm labels, not {:uid}
Reid Kleckner [Tue, 29 Nov 2016 00:39:37 +0000 (00:39 +0000)]
Use ${:uid} to generate unique MS asm labels, not {:uid}

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

7 years agoAvoid lambdas in default member initializers to work around clang bug
Reid Kleckner [Mon, 28 Nov 2016 23:58:04 +0000 (23:58 +0000)]
Avoid lambdas in default member initializers to work around clang bug

On Windows, Clang is mangling lambdas in default member initializers
incorrectly. See PR31197.

This is causing redness on the self-host bots. Work around the problem
locally so we aren't blind to further issues.

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

7 years agoIRGen: Remove all uses of CreateDefaultAlignedLoad.
Peter Collingbourne [Mon, 28 Nov 2016 22:30:21 +0000 (22:30 +0000)]
IRGen: Remove all uses of CreateDefaultAlignedLoad.

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

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

7 years agoMake CGVTables use ConstantInitBuilder. NFC.
John McCall [Mon, 28 Nov 2016 22:18:33 +0000 (22:18 +0000)]
Make CGVTables use ConstantInitBuilder.  NFC.

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

7 years agoHide the result of building a constant initializer. NFC.
John McCall [Mon, 28 Nov 2016 22:18:30 +0000 (22:18 +0000)]
Hide the result of building a constant initializer.  NFC.

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

7 years agoConstantBuilder -> ConstantInitBuilder for clarity, and
John McCall [Mon, 28 Nov 2016 22:18:27 +0000 (22:18 +0000)]
ConstantBuilder -> ConstantInitBuilder for clarity, and
move the member classes up to top level to allow forward
declarations to name them.  NFC.

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

7 years ago[Driver] Add unit tests for Distro detection
Michal Gorny [Mon, 28 Nov 2016 21:11:22 +0000 (21:11 +0000)]
[Driver] Add unit tests for Distro detection

Add a set of unit tests for the distro detection code. The tests use an
in-memory virtual filesystems resembling release files for various
distributions supported. All release files are provided (not only the
ones directly used) in order to guarantee that one of the rules will not
mistakenly recognize the distribution incorrectly due to the additional
files (e.g. Ubuntu as Debian).

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

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

7 years ago[Driver] Fix recognizing newer OpenSUSE versions
Michal Gorny [Mon, 28 Nov 2016 21:11:18 +0000 (21:11 +0000)]
[Driver] Fix recognizing newer OpenSUSE versions

Fix recognizing newer OpenSUSE versions that combine the two version
components into 'VERSION = x.y'. The check was written against an older
version that kept those two split as VERSION and PATCHLEVEL.

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

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

7 years ago[Driver] Refactor distro detection & classification as a separate API
Michal Gorny [Mon, 28 Nov 2016 21:11:14 +0000 (21:11 +0000)]
[Driver] Refactor distro detection & classification as a separate API

Refactor the Distro enum along with helper functions into a full-fledged
Distro class, inspired by llvm::Triple, and make it a public API.
The new class wraps the enum with necessary comparison operators, adding
the convenience Is*() methods and a constructor performing
the detection. The public API is needed to run the unit tests (D25869).

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

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

7 years ago[MS] Mangle a unique ID into all MS inline asm labels
Reid Kleckner [Mon, 28 Nov 2016 20:52:19 +0000 (20:52 +0000)]
[MS] Mangle a unique ID into all MS inline asm labels

This solves PR23715 in a way that is compatible with LTO.

MSVC supports jumping to source-level labels and between inline asm
blocks, but we don't.

Also revert the old solution, r255201, which was to mark these calls as
noduplicate.

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

7 years ago[OPENMP] Fix for PR31137: Wrong DSA for members in struct.
Alexey Bataev [Mon, 28 Nov 2016 15:55:15 +0000 (15:55 +0000)]
[OPENMP] Fix for PR31137: Wrong DSA for members in struct.

If member expression is used in the task region and the base expression
is a DeclRefExp and the variable used in this ref expression is private,
it should be marked as implicitly firstprivate inside this region. Patch
fixes this issue.

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

7 years ago[Sema] Set range end of constructors and destructors in template instantiations
Malcolm Parsons [Mon, 28 Nov 2016 11:11:34 +0000 (11:11 +0000)]
[Sema] Set range end of constructors and destructors in template instantiations

Summary:
clang-tidy checks frequently use source ranges of functions.
The source range of constructors and destructors in template instantiations
is currently a single token.
The factory method for constructors and destructors does not allow the
end source location to be specified.
Set end location manually after creating instantiation.

Reviewers: aaron.ballman, rsmith, arphaman

Subscribers: arphaman, cfe-commits

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

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

7 years agoAdjust type-trait evaluation to properly handle Using(Shadow)Decls
Hal Finkel [Sun, 27 Nov 2016 16:26:14 +0000 (16:26 +0000)]
Adjust type-trait evaluation to properly handle Using(Shadow)Decls

Since r274049, for an inheriting constructor declaration, the name of the using
declaration (and using shadow declaration comes from the using declaration) is
the name of a derived class, not the base class (line 8225-8232 of
lib/Sema/SemaDeclCXX.cpp in https://reviews.llvm.org/rL274049). Because of
this, name-based lookup performed inside Sema::LookupConstructors returns not
only CXXConstructorDecls but also Using(Shadow)Decls, which results assertion
failure reported in PR29087.

Patch by Taewook Oh, thanks!

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

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

7 years ago[DOXYGEN] Updated instruction names corresponding to avxintrin.h intrinsics.
Ekaterina Romanova [Sat, 26 Nov 2016 19:38:19 +0000 (19:38 +0000)]
[DOXYGEN] Updated instruction names corresponding to avxintrin.h intrinsics.

Documentation for some of the avxintrin.h's intrinsics errorneously said that
non VEX-prefixed instructions could be generated. This was fixed.

I tried several different solutions to achieve pretty printing of unordered lists (nested and non-nested) in param sections in doxygen.

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

7 years agoTypo.
Joerg Sonnenberger [Fri, 25 Nov 2016 20:15:57 +0000 (20:15 +0000)]
Typo.

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

7 years agoDo not do raw name replacement when FromDecl is a class forward-declaration.
Eric Liu [Fri, 25 Nov 2016 16:02:49 +0000 (16:02 +0000)]
Do not do raw name replacement when FromDecl is a class forward-declaration.

Summary:
If the `FromDecl` is a class forward declaration, the reference is
still considered as referring to the original definition given the nature
of forward-declarations, so we can't do a raw name replacement in this case.

Reviewers: bkramer

Subscribers: cfe-commits, klimek

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

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

7 years agoDocument the arguments form of commands.
Joerg Sonnenberger [Fri, 25 Nov 2016 14:14:43 +0000 (14:14 +0000)]
Document the arguments form of commands.

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

7 years agoConsider nested namespaces in the canonical namespace as canonical as well.
Eric Liu [Fri, 25 Nov 2016 12:39:03 +0000 (12:39 +0000)]
Consider nested namespaces in the canonical namespace as canonical as well.

Summary:
For example, this case was missed when looking for different but canonical
namespaces. UseContext in this case should be considered as in the canonical
namespace.
```
namespace a { namespace b { <FromContext> } }
namespace a { namespace b { namespace c { <UseContext> } } }
```
Added some commenting.

Reviewers: bkramer

Subscribers: klimek, cfe-commits

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

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

7 years ago[CodeGen] Pass objects that are expensive to copy by const ref.
Benjamin Kramer [Thu, 24 Nov 2016 16:01:20 +0000 (16:01 +0000)]
[CodeGen] Pass objects that are expensive to copy by const ref.

No functionality change. Found by clang-tidy's
performance-unnecessary-value-param.

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

7 years ago[Format] Avoid copying std::sets and simplify code a bit.
Benjamin Kramer [Thu, 24 Nov 2016 15:42:29 +0000 (15:42 +0000)]
[Format] Avoid copying std::sets and simplify code a bit.

No functional change.

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

7 years ago[Sema] Pass APSInts by const ref, avoiding copies.
Benjamin Kramer [Thu, 24 Nov 2016 15:36:17 +0000 (15:36 +0000)]
[Sema] Pass APSInts by const ref, avoiding copies.

No functionality change intended. Fix by clang-tidy's
performance-unnecessary-value-param check.

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

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Thu, 24 Nov 2016 12:40:04 +0000 (12:40 +0000)]
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

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

7 years ago[ASTDumper] Add some more character escapes for convenience.
Benjamin Kramer [Thu, 24 Nov 2016 09:41:33 +0000 (09:41 +0000)]
[ASTDumper] Add some more character escapes for convenience.

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

7 years agoRemove comments (NFC)
Kelvin Li [Thu, 24 Nov 2016 03:18:07 +0000 (03:18 +0000)]
Remove comments (NFC)

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

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

7 years agoMake these tests work more reliably with Release builds.
Douglas Yung [Thu, 24 Nov 2016 01:53:38 +0000 (01:53 +0000)]
Make these tests work more reliably with Release builds.

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

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

7 years agoSpelling.
Joerg Sonnenberger [Thu, 24 Nov 2016 01:24:38 +0000 (01:24 +0000)]
Spelling.

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

7 years ago[PPC] revert r287795
Ehsan Amiri [Wed, 23 Nov 2016 18:55:17 +0000 (18:55 +0000)]
[PPC] revert r287795

A test that passed locally is failing on one of the build bots.

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

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 18:36:29 +0000 (18:36 +0000)]
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

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

7 years agoAdd dllexport default ctor closure PCH regression test for PR31121
Reid Kleckner [Wed, 23 Nov 2016 18:33:54 +0000 (18:33 +0000)]
Add dllexport default ctor closure PCH regression test for PR31121

Follow up to r287774

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

7 years ago[Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull
Alex Lorenz [Wed, 23 Nov 2016 16:57:03 +0000 (16:57 +0000)]
[Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull

This commit teaches clang that is has to emit a warning when NULL is passed
as the 'expected' pointer parameter into an atomic compare exchange call.

rdar://18926650

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

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

7 years ago[PPC] Reverting r287772
Ehsan Amiri [Wed, 23 Nov 2016 16:56:03 +0000 (16:56 +0000)]
[PPC] Reverting r287772

Due to buildbot failure, I revert. Will recommit after investigation.

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

7 years agoRemove C++ default arg side table for MS ABI ctor closures
Reid Kleckner [Wed, 23 Nov 2016 16:51:30 +0000 (16:51 +0000)]
Remove C++ default arg side table for MS ABI ctor closures

Summary:
We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The
important part of building the CXXDefaultArgExprs was to ODR use the
default argument expressions, not to make AST nodes. Refactor the code
to only check the default argument, and remove the side table in
ASTContext which wasn't being serialized.

Fixes PR31121

Reviewers: thakis, rsmith, majnemer

Subscribers: cfe-commits

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

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

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 16:32:05 +0000 (16:32 +0000)]
[PPC] support for arithmetic builtins in the FE

This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

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

7 years ago[CodeCompletion] Fix incorrect Objective-C block parameter formatting
Alex Lorenz [Wed, 23 Nov 2016 16:28:34 +0000 (16:28 +0000)]
[CodeCompletion] Fix incorrect Objective-C block parameter formatting

This commit fixes an incorrectly formatted Objective-C block parameter
placeholder in a code completion result. The incorrect parameter had a
redundant leading parenthesis.

rdar://25224416

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

7 years ago[ASTImporter] Added ability to import AtomicType nodes
Gabor Horvath [Wed, 23 Nov 2016 15:24:23 +0000 (15:24 +0000)]
[ASTImporter] Added ability to import AtomicType nodes

Patch by: Kareem Khazem

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

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

7 years ago[X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check
Simon Pilgrim [Wed, 23 Nov 2016 11:38:52 +0000 (11:38 +0000)]
[X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check

Missed in rL287733

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

7 years ago[CodeGen] Simplify code. No functionality change intended.
Benjamin Kramer [Wed, 23 Nov 2016 11:20:27 +0000 (11:20 +0000)]
[CodeGen] Simplify code. No functionality change intended.

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

7 years ago[X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.
Craig Topper [Wed, 23 Nov 2016 01:47:12 +0000 (01:47 +0000)]
[X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.

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

7 years agoMake diagnostic for use of default member initializer before enclosing class is
Richard Smith [Tue, 22 Nov 2016 22:55:12 +0000 (22:55 +0000)]
Make diagnostic for use of default member initializer before enclosing class is
complete a little more general; it is produced in other cases than the one that
it previously talked about.

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

7 years agoRemove variable only used in an assertion.
John McCall [Tue, 22 Nov 2016 20:12:32 +0000 (20:12 +0000)]
Remove variable only used in an assertion.

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

7 years agoAdd test for D21736.
Marcin Koscielnicki [Tue, 22 Nov 2016 20:03:40 +0000 (20:03 +0000)]
Add test for D21736.

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

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

7 years ago[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.
Marcin Koscielnicki [Tue, 22 Nov 2016 20:03:35 +0000 (20:03 +0000)]
[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder.
However, some passes are inserted manually before the PMBuilder
ones - if any of them happens to use TargetLibraryInfoWrapperPass,
it'll get a default-constructed one, with an unknown target triple.
This happens to InstrProfiling in D21736, breaking it.

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

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

7 years agodarwin: Unconditionally pass -lto_library, remove -Wliblto warning.
Nico Weber [Tue, 22 Nov 2016 19:38:07 +0000 (19:38 +0000)]
darwin: Unconditionally pass -lto_library, remove -Wliblto warning.

https://reviews.llvm.org/D25932 made it so that clang always checks if
libLTO.dylib is present on disk, even if -flto is not being used. The
motivation for that change was that if a dependency happens to contain bitcode,
ld64 will try to load libLTO without -flto explicitly being enabled. However,
the change had the undesirable side effect of warning if libLTO.dylib doesn't
exist even if it isn't needed.

Change things so that -lto_library is always passes, independent of if it
exists or not. ld64 only looks at this flag if it uses LTO. If the dylib
exists, all is well. If it doesn't, and LTO is not being used, all is well too.
If ld64 does end up using LTO and the dylib does not exist, ld64 will print
something like

    ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64

https://reviews.llvm.org/D26984

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

7 years agoMake llvm::Error generated from replacement interfaces more specific.
Eric Liu [Tue, 22 Nov 2016 13:46:42 +0000 (13:46 +0000)]
Make llvm::Error generated from replacement interfaces more specific.

Summary:
The new error information contains the type of error (e.g. overlap or bad file path)
and the replacement(s) that is causing the error. This enables us to resolve some errors.
For example, for insertion at the same location conflict, we need to know the
existing replacement which conflicts with the new replacement in order to calculate
the new position to be insert before/after the existing replacement (for merging).

Reviewers: klimek, bkramer

Subscribers: djasper, cfe-commits

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

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

7 years agoMissing initializer.
Axel Naumann [Tue, 22 Nov 2016 10:00:23 +0000 (10:00 +0000)]
Missing initializer.

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

7 years agoRename option to -lto-pass-remarks-output
Adam Nemet [Tue, 22 Nov 2016 07:35:19 +0000 (07:35 +0000)]
Rename option to -lto-pass-remarks-output

The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because
of the duplicate option name with opt.

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

7 years ago[analyzer] Fix a crash on accessing a field within a literal-initialized union.
Artem Dergachev [Tue, 22 Nov 2016 04:29:23 +0000 (04:29 +0000)]
[analyzer] Fix a crash on accessing a field within a literal-initialized union.

Because in case of unions we currently default-bind compound values in the
store, this quick fix avoids the crash for this case.

Patch by Ilya Palachev and independently by Alexander Shaposhnikov!

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

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

7 years agoFix -Asserts build, and add some more test cases.
Peter Collingbourne [Tue, 22 Nov 2016 00:43:30 +0000 (00:43 +0000)]
Fix -Asserts build, and add some more test cases.

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

7 years agoSema, CodeGen: Ensure that an implicit copy ctor is available more often under the...
Peter Collingbourne [Tue, 22 Nov 2016 00:21:43 +0000 (00:21 +0000)]
Sema, CodeGen: Ensure that an implicit copy ctor is available more often under the Microsoft C++ ABI.

This is needed because whether the constructor is deleted can control whether
we pass structs by value directly.

To fix this properly we probably want a more direct way for CodeGen to ask
whether the constructor was deleted.

Fixes PR31049.

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

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

7 years agoIndicate in AST dump whether special member functions are defaulted and trivial.
Richard Smith [Mon, 21 Nov 2016 23:43:54 +0000 (23:43 +0000)]
Indicate in AST dump whether special member functions are defaulted and trivial.

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

7 years ago[ObjC] Prevent infinite loops when iterating over redeclaration
Alex Lorenz [Mon, 21 Nov 2016 11:16:30 +0000 (11:16 +0000)]
[ObjC] Prevent infinite loops when iterating over redeclaration
of a method that was declared in an invalid interface

This commit fixes an infinite loop that occurs when clang tries to iterate over
redeclaration of a method that was declared in an invalid @interface. The
existing validity checks don't catch this as that @interface is a duplicate of
a previously declared valid @interface declaration, so we have to verify that
the found redeclaration is in a valid declaration context.

rdar://29220965

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

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

7 years ago[Frontend] Add a predefined macro that describes the Objective-C bool type
Alex Lorenz [Mon, 21 Nov 2016 11:05:15 +0000 (11:05 +0000)]
[Frontend] Add a predefined macro that describes the Objective-C bool type

This commit adds a new predefined macro named __OBJC_BOOL_IS_BOOL that describes
the Objective-C boolean type: its value is zero if the Objective-C boolean uses
the signed character type, otherwise its value is one as the Objective-C boolean
uses the builtin boolean type.

rdar://21170440

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

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

7 years ago[XRay] Support AArch64 in Clang
Dean Michael Berris [Mon, 21 Nov 2016 03:24:59 +0000 (03:24 +0000)]
[XRay] Support AArch64 in Clang

This patch adds XRay support in Clang for AArch64 target.
This patch is one of a series:

LLVM: https://reviews.llvm.org/D26412
compiler-rt: https://reviews.llvm.org/D26413

Author: rSerge

Reviewers: rengolin, dberris

Subscribers: aemerson, cfe-commits, iid_iunknown

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

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

7 years agoAdd doxygen comments to immintrin.h's intrinsics.
Ekaterina Romanova [Sun, 20 Nov 2016 08:35:05 +0000 (08:35 +0000)]
Add doxygen comments to immintrin.h's intrinsics.

The doxygen comments are automatically generated based on Sony's intrinsics docu
ment.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Charles Li.

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

7 years ago[CMake] Fixing clang standalone build
Chris Bieneman [Sat, 19 Nov 2016 21:14:59 +0000 (21:14 +0000)]
[CMake] Fixing clang standalone build

I broke this in r287406 and r287407.

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

7 years agoRemove alignment from ctors/dtors lists in an attempt to placate LTO.
John McCall [Sat, 19 Nov 2016 20:12:25 +0000 (20:12 +0000)]
Remove alignment from ctors/dtors lists in an attempt to placate LTO.

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

7 years agoChange setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)
Mehdi Amini [Sat, 19 Nov 2016 18:19:41 +0000 (18:19 +0000)]
Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)

Summary:
This makes it explicit that ownership is taken. Also replace all `new`
with make_unique<> at call sites.

Reviewers: anemet

Subscribers: llvm-commits

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

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

7 years agoIntroduce a helper class for building complex constant initializers. NFC.
John McCall [Sat, 19 Nov 2016 08:17:24 +0000 (08:17 +0000)]
Introduce a helper class for building complex constant initializers.  NFC.

I've adopted this in most of the places it makes sense, but v-tables
and CGObjCMac will need a second pass.

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

7 years agoDoxygen comments for avxintrin.h.
Ekaterina Romanova [Sat, 19 Nov 2016 04:59:08 +0000 (04:59 +0000)]
Doxygen comments for avxintrin.h.

Added doxygen comments to avxintrin.h's intrinsics. As of now, all the intrinsics in this file that were documented by Sony's intrinsics guide should have corresponding doxygen comments.

Note: The doxygen comments are automatically generated based on Sony's intrinsic
s document.

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

Reviewed by Wolfgang Pieb.

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

7 years agoSema: As of MSVC 2015, a user-declared move operation causes the deletion of both...
Peter Collingbourne [Sat, 19 Nov 2016 00:30:56 +0000 (00:30 +0000)]
Sema: As of MSVC 2015, a user-declared move operation causes the deletion of both copy operations.

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

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

7 years ago[Sema] Don't allow applying address-of operator to a call to a function
Akira Hatanaka [Sat, 19 Nov 2016 00:13:03 +0000 (00:13 +0000)]
[Sema] Don't allow applying address-of operator to a call to a function
with __unknown_anytype return type.

When the following code is compiled, Sema infers that the type of
__unknown_anytype is double:

extern __unknown_anytype func();
double *d = (double*)&func();

This triggers an assert in CodeGenFunction::EmitCallExprLValue because
it doesn't expect to see a call to a function with a non-reference
scalar return type.

This commit prevents the assert by making VisitUnaryAddrOf error out if
the address-of operator is applied to a call to a function with
__unknown_anytype return type.

rdar://problem/20287610

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

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

7 years ago[CMake] clang depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:31:16 +0000 (23:31 +0000)]
[CMake] clang depends on intrinsics_gen

cc1_main.cpp has the following include chain:

llvm/LinkAllPasses.h
llvm/Analysis/AliasSetTracker.h
llvm/Analysis/AliasAnalysis.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means clang needs to depend on intrinsics_gen.

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

7 years ago[CMake] clang-offload-bundler depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:31:14 +0000 (23:31 +0000)]
[CMake] clang-offload-bundler depends on intrinsics_gen

ClangOffloadBundler.cpp has the following include chain:

llvm/Bitcode/BitcodeWriter.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means clang-offload-bundler needs to depend on intrinsics_gen.

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

7 years ago[AMDGPU] Change frexp.exp builtin to return i16 for f16 input
Konstantin Zhuravlyov [Fri, 18 Nov 2016 22:31:51 +0000 (22:31 +0000)]
[AMDGPU] Change frexp.exp builtin to return i16 for f16 input

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

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

7 years ago[analyzer] Refactor recursive symbol reachability check to use symbol_iterator
Dominic Chen [Fri, 18 Nov 2016 21:07:03 +0000 (21:07 +0000)]
[analyzer] Refactor recursive symbol reachability check to use symbol_iterator

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

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

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

7 years ago[ARM] Fix sema check of ARM special register names
Oleg Ranevskyy [Fri, 18 Nov 2016 21:00:08 +0000 (21:00 +0000)]
[ARM] Fix sema check of ARM special register names

Summary:
This is a simple sema check patch for arguments of `__builtin_arm_rsr` and the related builtins, which currently do not allow special registers with indexes >7.

Some of the possible register name formats these builtins accept are:
```
{c}p<coprocessor>:<op1>:c<CRn>:c<CRm>:<op2>
```
```
o0:op1:CRn:CRm:op2
```
where `op1` / `op2` are integers in the range [0, 7] and `CRn` / `CRm` are integers in the range [0, 15].

The current sema check does not allow `CRn` > 7 and accepts `op2` up to 15.

Reviewers: LukeCheeseman, rengolin

Subscribers: asl, aemerson, rengolin, cfe-commits

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

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

7 years agoAdapt to llvm NamedRegionTimer changes
Matthias Braun [Fri, 18 Nov 2016 19:43:25 +0000 (19:43 +0000)]
Adapt to llvm NamedRegionTimer changes

We have to specify a name and description for the timers and groups now.

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

7 years ago[CMake] Fixing variable names that were mistyped
Chris Bieneman [Fri, 18 Nov 2016 19:20:39 +0000 (19:20 +0000)]
[CMake] Fixing variable names that were mistyped

This is a silly bug that I'm sure I caused...

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

7 years agoLTO support for -fsave-optimization-record on Darwin
Adam Nemet [Fri, 18 Nov 2016 18:17:36 +0000 (18:17 +0000)]
LTO support for -fsave-optimization-record on Darwin

I guess this would have to be added for each linker.

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

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

7 years agoFix a comment for -fsave-optimization-record
Adam Nemet [Fri, 18 Nov 2016 18:17:33 +0000 (18:17 +0000)]
Fix a comment for -fsave-optimization-record

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

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

7 years ago[OpenCL] Introduce ReadPipeType and WritePipeType.
Joey Gouly [Fri, 18 Nov 2016 14:10:54 +0000 (14:10 +0000)]
[OpenCL] Introduce ReadPipeType and WritePipeType.

This allows Sema to diagnose passing a read_only pipe to a
write_only pipe argument.

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

7 years agoWdocumentation fix
Simon Pilgrim [Fri, 18 Nov 2016 11:18:28 +0000 (11:18 +0000)]
Wdocumentation fix

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

7 years agoAdd doxygen comments for lzcntintrin.h's intrinsics.
Ekaterina Romanova [Fri, 18 Nov 2016 06:26:01 +0000 (06:26 +0000)]
Add doxygen comments for lzcntintrin.h's intrinsics.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Charles Li.

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

7 years ago[AVX-512] Replace masked 16-bit element variable shift builtins with new unmasked...
Craig Topper [Fri, 18 Nov 2016 05:04:51 +0000 (05:04 +0000)]
[AVX-512] Replace masked 16-bit element variable shift builtins with new unmasked versions and selects.

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

7 years agoAdd doxygen comments to fxsrintrin.h's intrinsics.
Ekaterina Romanova [Fri, 18 Nov 2016 01:42:01 +0000 (01:42 +0000)]
Add doxygen comments to fxsrintrin.h's intrinsics.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Paul Robinson and Charles Li.

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

7 years ago[CUDA] Attempt to fix test failures in cuda-macos-includes.cu.
Justin Lebar [Fri, 18 Nov 2016 01:11:32 +0000 (01:11 +0000)]
[CUDA] Attempt to fix test failures in cuda-macos-includes.cu.

Run clang -cc1 -E instead of -S, in an attempt to make this test work
cross-platform.

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

7 years agoForward ns_consumed delegate arguments with a move.
John McCall [Fri, 18 Nov 2016 01:08:24 +0000 (01:08 +0000)]
Forward ns_consumed delegate arguments with a move.

StartFunction enters a release cleanup for ns_consumed arguments in
ARC, so we need to balance that somehow.  We could teach StartFunction
that it's emitting a delegating function, so that the cleanup is
unnecessary, but that would be invasive and somewhat fraught.  We could
balance the consumed argument with an extra retain, but clearing the
original variable should be easier to optimize and avoid some extra work
at -O0.  And there shouldn't be any difference as long as nothing else
uses the argument, which should always be true for the places we emit
delegate arguments.

Fixes PR 27887.

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

7 years ago[CUDA] Wrapper header changes necessary to support MacOS.
Justin Lebar [Fri, 18 Nov 2016 00:41:35 +0000 (00:41 +0000)]
[CUDA] Wrapper header changes necessary to support MacOS.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Use the right section and constant names for fatbins when compiling for macos.
Justin Lebar [Fri, 18 Nov 2016 00:41:31 +0000 (00:41 +0000)]
[CUDA] Use the right section and constant names for fatbins when compiling for macos.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Initialize our header search using the host triple.
Justin Lebar [Fri, 18 Nov 2016 00:41:27 +0000 (00:41 +0000)]
[CUDA] Initialize our header search using the host triple.

Summary:
This used to work because system headers are found in a (somewhat)
predictable set of locations on Linux.  But this is not the case on
MacOS; without this change, we don't look in the right places for our
headers when doing device-side compilation on Mac.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Driver changes to support CUDA compilation on MacOS.
Justin Lebar [Fri, 18 Nov 2016 00:41:22 +0000 (00:41 +0000)]
[CUDA] Driver changes to support CUDA compilation on MacOS.

Summary:
Compiling CUDA device code requires us to know the host toolchain,
because CUDA device-side compiles pull in e.g. host headers.

When we only supported Linux compilation, this worked because
CudaToolChain, which is responsible for device-side CUDA compilation,
inherited from the Linux toolchain.  But in order to support MacOS,
CudaToolChain needs to take a HostToolChain pointer.

Because a CUDA toolchain now requires a host TC, we no longer will
create a CUDA toolchain from Driver::getToolChain -- you have to go
through CreateOffloadingDeviceToolChains.  I am *pretty* sure this is
correct, and that previously any attempt to create a CUDA toolchain
through getToolChain() would eventually have resulted in us throwing
"error: unsupported use of NVPTX for host compilation".

In any case hacking getToolChain to create a CUDA+host toolchain would
be wrong, because a Driver can be reused for multiple compilations,
potentially with different host TCs, and getToolChain will cache the
result, causing us to potentially use a stale host TC.

So that's the main change in this patch.

In addition, we have to pull CudaInstallationDetector out of Generic_GCC
and into a top-level class.  It's now used by the Generic_GCC and MachO
toolchains.

Reviewers: tra

Subscribers: rryan, hfinkel, sfantao

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

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

7 years agoMinor changes in x86 intrinsics headers; NFC
Ekaterina Romanova [Thu, 17 Nov 2016 23:02:00 +0000 (23:02 +0000)]
Minor changes in x86 intrinsics headers; NFC

I made several changes for consistency with the rest of x86 instrinsics header files. Some of these changes help to render doxygen comments better.

1. avxintrin.h –  Moved the opening bracket on a separate line for several
                  intrinsics (for consistency with the rest of the intrinsics).

2. emmintrin.h -  Moved the doxygen comment next to the body of the function;
               -  Added braces after extern "C"  even though there is only
                  one declaration each time

3. xmmintrin.h -  Moved the doxygen comment next to the body of the function;
               -  Added intrinsic prototypes for a couple of macro definitions
                  into the doxygen comment;
               -  Added braces after extern "C"  even though there is only one
                  declaration each time

4. ammintrin.h –  Removed extra line between the doxygen comment and the body
                  of the functions (for consistency with the rest of the files).

Desk reviewed by Paul Robinson.

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

7 years ago[Preprocessor] Support for '-dI' flag
Bruno Cardoso Lopes [Thu, 17 Nov 2016 22:45:31 +0000 (22:45 +0000)]
[Preprocessor] Support for '-dI' flag

Re-introduce r285411.

Implement the -dI as supported by GCC: Output ‘#include’ directives in addition
to the result of preprocessing.

This change aims to add this option, pass it through to the preprocessor via
the options class, and when inclusions occur we output some information (+ test
cases).

Patch by Steve O'Brien!

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

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

7 years ago[CrashReproducer][Darwin] Suggest attaching .crash diagnostic file
Bruno Cardoso Lopes [Thu, 17 Nov 2016 21:41:22 +0000 (21:41 +0000)]
[CrashReproducer][Darwin] Suggest attaching .crash diagnostic file

In addition to the preprocessed sources file and reproducer script, also
point to the .crash diagnostic files on Darwin. Example:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cpp
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cache
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.sh
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.crash

When no match is found for the .crash, point the user to a directory
where those can be found. Example:

clang-4.0: note: diagnostic msg: Crash backtrace is located in
clang-4.0: note: diagnostic msg: /Users/bruno/Library/Logs/DiagnosticReports/clang-4.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-4.0: note: diagnostic msg: (choose the .crash file that corresponds to your crash)

rdar://problem/27286266

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

7 years agoFixes for r287241. Use placement new. Apply clang-format.
Malcolm Parsons [Thu, 17 Nov 2016 21:00:09 +0000 (21:00 +0000)]
Fixes for r287241. Use placement new. Apply clang-format.

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

7 years agoObjC Module: try to make objc module deterministic.
Manman Ren [Thu, 17 Nov 2016 18:41:18 +0000 (18:41 +0000)]
ObjC Module: try to make objc module deterministic.

Make sure that comparing selectors in DeclarationName does its job.
rdar://problem/28988750

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

7 years agoUse unique_ptr for cached tokens for default arguments in C++.
Malcolm Parsons [Thu, 17 Nov 2016 17:52:58 +0000 (17:52 +0000)]
Use unique_ptr for cached tokens for default arguments in C++.

Summary:
This changes pointers to cached tokens for default arguments in C++ from raw pointers to unique_ptrs.  There was a fixme in the code where the cached tokens are created  about using a smart pointer.

The change is straightforward, though I did have to track down and fix a memory corruption caused by the change.  memcpy was being used to copy parameter information.  This duplicated the unique_ptr, which led to the cached token buffer being deleted prematurely.

Patch by David Tarditi!

Reviewers: malcolm.parsons

Subscribers: arphaman, malcolm.parsons, cfe-commits

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

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

7 years agoSema: correct typo correction for ivars in @implementation
Saleem Abdulrasool [Thu, 17 Nov 2016 17:10:54 +0000 (17:10 +0000)]
Sema: correct typo correction for ivars in @implementation

The previous typo correction handling assumed that ivars are only declared in
the interface declaration rather than as a private ivar in the implementation.
Adjust the handling to permit both interfaces.  Assert earlier that the
interface has been acquired to ensure that we can identify when both possible
casts have failed.

Addresses PR31040!

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