]> granicus.if.org Git - clang/log
clang
7 years agoMigrate PathDiagnosticPiece to std::shared_ptr
David Blaikie [Thu, 5 Jan 2017 17:26:53 +0000 (17:26 +0000)]
Migrate PathDiagnosticPiece to std::shared_ptr

Simplifies and makes explicit the memory ownership model rather than
implicitly passing/acquiring ownership.

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

7 years agotest: add a requires registered target
Saleem Abdulrasool [Thu, 5 Jan 2017 17:09:20 +0000 (17:09 +0000)]
test: add a requires registered target

It seems that the ARM buildbots do not include x86 support.  However,
other x86 targets do not support the ARM target.  Use a x86 triple and
require the registered target.

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

7 years ago[CUDA] Rename keywords used in macro so they don't conflict with MSVC.
Justin Lebar [Thu, 5 Jan 2017 16:54:11 +0000 (16:54 +0000)]
[CUDA] Rename keywords used in macro so they don't conflict with MSVC.

Summary:
MSVC seems to use "__in" and "__out" for its own purposes, so we have to
pick different names in this macro.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Don't define functions that the CUDA headers themselves define on Windows.
Justin Lebar [Thu, 5 Jan 2017 16:53:55 +0000 (16:53 +0000)]
[CUDA] Don't define functions that the CUDA headers themselves define on Windows.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Let NVPTX inherit the host's calling conventions.
Justin Lebar [Thu, 5 Jan 2017 16:53:38 +0000 (16:53 +0000)]
[CUDA] Let NVPTX inherit the host's calling conventions.

Summary:
When compiling device code, we may still see host code with explicit
calling conventions.  NVPTX needs to claim that it supports these CCs,
so that (a) we don't raise noisy warnings, and (b) we don't break
existing code which relies on the existence of these CCs when
specializing templates.  (If a CC doesn't exist, clang ignores it, so
two template specializations which are different only insofar as one
specifies a CC are considered identical and therefore are an error if
that CC is not supported.)

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] More correctly inherit primitive types from the host during device compilation.
Justin Lebar [Thu, 5 Jan 2017 16:53:21 +0000 (16:53 +0000)]
[CUDA] More correctly inherit primitive types from the host during device compilation.

Summary:
CUDA lets users share structs between the host and device, so for that
and other reasons, primitive types such as ptrdiff_t should be the same
on both sides of the compilation.

Our code to do this wasn't entirely successful.  In particular, we did a
bunch of work during the NVPTXTargetInfo constructor, only to override
it in the NVPTX{32,64}TargetInfo constructors.  It worked well enough on
Linux and Mac, but Windows is LLP64, which is different enough to break
it.

This patch removes the NVPTX{32,64}TargetInfo classes entirely and fixes
the bug described above.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Add __declspec spellings for CUDA attributes.
Justin Lebar [Thu, 5 Jan 2017 16:53:04 +0000 (16:53 +0000)]
[CUDA] Add __declspec spellings for CUDA attributes.

Summary: CUDA attributes are spelled __declspec(__foo__) on Windows.

Reviewers: tra

Subscribers: cfe-commits, rnk

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

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

7 years ago[ToolChains] Use "static" instead of an anonymous namespace for a function. NFC
Justin Lebar [Thu, 5 Jan 2017 16:52:47 +0000 (16:52 +0000)]
[ToolChains] Use "static" instead of an anonymous namespace for a function.  NFC

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

7 years ago[Driver] Driver changes to support CUDA compilation on Windows.
Justin Lebar [Thu, 5 Jan 2017 16:52:29 +0000 (16:52 +0000)]
[Driver] Driver changes to support CUDA compilation on Windows.

Summary:
For the most part this is straightforward: Just add a CudaInstallation
object to the MSVC and MinGW toolchains.

CudaToolChain has to override computeMSVCVersion so that
Clang::constructJob passes the right version flag to cc1.  We have to
modify IsWindowsMSVC and friends in Clang::constructJob to be true when
compiling CUDA device code on Windows for the same reason.

Depends on: D28319

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Make CUDAInstallationDetector take the host triple in its constructor.
Justin Lebar [Thu, 5 Jan 2017 16:52:11 +0000 (16:52 +0000)]
[CUDA] Make CUDAInstallationDetector take the host triple in its constructor.

Summary:
Previously it was taking the true target triple, which is not really
what it needs: The location of the CUDA installation depends on the host
OS.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[TableGen] Only normalize the spelling of GNU-style attributes.
Justin Lebar [Thu, 5 Jan 2017 16:51:54 +0000 (16:51 +0000)]
[TableGen] Only normalize the spelling of GNU-style attributes.

Summary:
When Sema looks up an attribute name, it strips off leading and trailing
"__" if the attribute is GNU-style.  That is, __attribute__((foo)) and
__attribute__((__foo__)) are equivalent.

This is only true for GNU-style attributes.  In particular,
__declspec(__foo__) is not equivalent to __declspec(foo), and Sema
respects this difference.

This patch fixes TableGen to match Sema's behavior.  The spelling
'GNU<"__foo__">' should be normalized to 'GNU<"foo">', but
'Declspec<"__foo__">' should not be changed.

This is necessary to make CUDA compilation work on Windows, because e.g.
the __device__ attribute is spelled __declspec(__device__).

Attr.td does not contain any Declspec spellings that start or end with
"__", so this change should not affect any other attributes.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years ago[Windows] Remove functions in intrin.h that are defined in Builtin.def.
Justin Lebar [Thu, 5 Jan 2017 16:51:37 +0000 (16:51 +0000)]
[Windows] Remove functions in intrin.h that are defined in Builtin.def.

Summary:
These duplicate declarations cause a problem for CUDA compiles on
Windows.  All implicitly-defined functions are host+device, and this
applies to the declarations in Builtin.def.  But then when we see the
declarations in intrin.h, they have no attributes, so are host-only
functions.  This is an error.

(A better fix might be to make these builtins host-only, but that is a
much bigger change.)

Reviewers: rnk

Subscribers: cfe-commits, echristo

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

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

7 years agotest: add an explicit triple
Saleem Abdulrasool [Thu, 5 Jan 2017 16:36:15 +0000 (16:36 +0000)]
test: add an explicit triple

Not all targets use the integrated assembler.  Specify a triple to
ensure we use the integrated as for this.

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

7 years ago[OpenMP] Add fields for flags in the offload entry descriptor.
Samuel Antao [Thu, 5 Jan 2017 16:02:49 +0000 (16:02 +0000)]
[OpenMP] Add fields for flags in the offload entry descriptor.

Summary:
This patch adds two fields to the offload entry descriptor. One field is meant to signal Ctors/Dtors and `link` global variables, and the other is reserved for runtime library use.

 Currently, these fields are only filled with zeros in the current code generation, but that will change when `declare target` is added.

The reason, we are adding these fields now is to make the code generation consistent with the runtime library proposal under review in https://reviews.llvm.org/D14031.

Reviewers: ABataev, hfinkel, carlo.bertolli, kkwli0, arpith-jacob, Hahnfeld

Subscribers: cfe-commits, caomhin, jholewinski

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

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

7 years agoCodeGen: plumb header search down to the IAS
Saleem Abdulrasool [Thu, 5 Jan 2017 16:02:32 +0000 (16:02 +0000)]
CodeGen: plumb header search down to the IAS

inline assembly may use the `.include` directive to include other
content into the file.  Without the integrated assembler, the `-I` group
gets passed to the assembler.  Emulate this by collecting the header
search paths and passing them to the IAS.

Resolves PR24811!

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

7 years ago[OpenMP] Update target codegen for NVPTX device.
Arpith Chacko Jacob [Thu, 5 Jan 2017 15:24:05 +0000 (15:24 +0000)]
[OpenMP] Update target codegen for NVPTX device.

This patch includes updates for codegen of the target region for the NVPTX
device. It moves initializers from the compiler to the runtime and updates
the worker loop to assume parallel work is retrieved from the runtime. A
subsequent patch will update the codegen to retrieve the parallel work using
calls to the runtime. It includes the removal of the inline attribute
for the worker loop and disabling debug info in it.

This allows codegen for a target directive and serial execution on the
NVPTX device.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28125

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

7 years agoNo canonical-prefixes match in avr-toolchain.c.
Haojian Wu [Thu, 5 Jan 2017 10:06:58 +0000 (10:06 +0000)]
No canonical-prefixes match in avr-toolchain.c.

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

7 years ago[AVR] Revert the functional part of r291083
Dylan McKay [Thu, 5 Jan 2017 07:17:46 +0000 (07:17 +0000)]
[AVR] Revert the functional part of r291083

As Senthil points out, this is unnecessary as we already have these
registers in AddlRegNames.

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

7 years ago[AVR] Support r26 through r31 in inline assembly
Dylan McKay [Thu, 5 Jan 2017 05:31:12 +0000 (05:31 +0000)]
[AVR] Support r26 through r31 in inline assembly

These are synonyms for the X,Y, and Z registers.

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

7 years agoAdd AVR target and toolchain to Clang
Dylan McKay [Thu, 5 Jan 2017 05:20:27 +0000 (05:20 +0000)]
Add AVR target and toolchain to Clang

Summary:
Authored by Senthil Kumar Selvaraj

This patch adds barebones support in Clang for the (experimental) AVR target. It uses the integrated assembler for assembly, and the GNU linker for linking, as lld doesn't know about the target yet.

The DataLayout string is the same as the one in AVRTargetMachine.cpp. The alignment specs look wrong to me, as it's an 8 bit target and all types only need 8 bit alignment. Clang failed with a datalayout mismatch error when I tried to change it, so I left it that way for now.

Reviewers: rsmith, dylanmckay, cfe-commits, rengolin

Subscribers: rengolin, jroelofs, wdng

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

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

7 years agoPer [temp.deduct.call], do not deduce an array bound of 0 from an empty initializer...
Richard Smith [Thu, 5 Jan 2017 04:16:30 +0000 (04:16 +0000)]
Per [temp.deduct.call], do not deduce an array bound of 0 from an empty initializer list.

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

7 years agoFactor out more common logic in template argument deduction from function call arguments.
Richard Smith [Thu, 5 Jan 2017 04:08:31 +0000 (04:08 +0000)]
Factor out more common logic in template argument deduction from function call arguments.

No functionality change intended.

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

7 years agoFix assertion failure on deduction failure due to too short template argument list.
Richard Smith [Thu, 5 Jan 2017 02:31:32 +0000 (02:31 +0000)]
Fix assertion failure on deduction failure due to too short template argument list.

We were previously incorrectly using TDK_TooFewArguments to report a template
argument list that's too short, but it actually means that the number of
arguments in a top-level function call was insufficient. When diagnosing the
problem, SemaOverload would (rightly) assert that the failure kind didn't make
any sense.

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

7 years ago[Sema] Mark undefined ctors as deleted. NFC.
George Burgess IV [Thu, 5 Jan 2017 01:21:21 +0000 (01:21 +0000)]
[Sema] Mark undefined ctors as deleted. NFC.

Looks like these functions exist just to prevent bad implicit
conversions. Rather than waiting for the linker to complain about
undefined references to them, we can mark them as deleted.

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

7 years ago[MS] Instantiate default args during instantiation of exported default ctors
Reid Kleckner [Thu, 5 Jan 2017 01:08:22 +0000 (01:08 +0000)]
[MS] Instantiate default args during instantiation of exported default ctors

Summary:
Replace some old code that probably pre-dated the change to delay
emission of dllexported code until after the closing brace of the
outermost record type. Only uninstantiated default argument expressions
need to be handled now. It is enough to instantiate default argument
expressions when instantiating dllexported default ctors. This also
fixes some double-diagnostic issues in this area.

Fixes PR31500

Reviewers: rsmith

Subscribers: cfe-commits

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

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

7 years agoCorrect Vectorcall Register passing and HVA Behavior
Erich Keane [Thu, 5 Jan 2017 00:20:51 +0000 (00:20 +0000)]
Correct Vectorcall Register passing and HVA Behavior

Front end component (back end changes are D27392).  The vectorcall
calling convention was broken subtly in two cases.  First,
it didn't properly handle homogeneous vector aggregates (HVAs).
Second, the vectorcall specification requires that only the
first 6 parameters be eligible for register assignment.
This patch fixes both issues.

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

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

7 years ago[gtest] The way EXPECT_TEST now works after upgrading gtest triggers an
Chandler Carruth [Wed, 4 Jan 2017 23:57:25 +0000 (23:57 +0000)]
[gtest] The way EXPECT_TEST now works after upgrading gtest triggers an
ODR use. These traits don't have a definition as they're intended to be
used strictly at compile time. Change the tests to use static_assert to
move the entire thing into compile-time.

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

7 years agoOnly instantiate members of nested classes in local classes once, rather than once...
Richard Smith [Wed, 4 Jan 2017 23:45:01 +0000 (23:45 +0000)]
Only instantiate members of nested classes in local classes once, rather than once per enclosing class.

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

7 years agoBail out if we try to build a DeclRefExpr naming an invalid declaration.
Richard Smith [Wed, 4 Jan 2017 23:14:16 +0000 (23:14 +0000)]
Bail out if we try to build a DeclRefExpr naming an invalid declaration.

Most code paths would already bail out in this case, but certain paths,
particularly overload resolution and typo correction, would not. Carrying on
with an invalid declaration could in some cases result in crashes due to
downstream code relying on declaration invariants that are not necessarily
met for invalid declarations, and in other cases just resulted in undesirable
follow-on diagnostics.

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

7 years ago[Parse] Don't ignore attributes after a late-parsed attr.
George Burgess IV [Wed, 4 Jan 2017 22:43:01 +0000 (22:43 +0000)]
[Parse] Don't ignore attributes after a late-parsed attr.

Without this, we drop everything after the first late-parsed attribute
in a single __attribute__. (Where "drop" means "stuff everything into
LA->Toks.")

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

7 years agoFix for LLVM Bitcode API change (to use std::shared_ptr)
David Blaikie [Wed, 4 Jan 2017 22:36:43 +0000 (22:36 +0000)]
Fix for LLVM Bitcode API change (to use std::shared_ptr)

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

7 years agoRemove use of intrusive ref count ownership acquisition
David Blaikie [Wed, 4 Jan 2017 22:36:39 +0000 (22:36 +0000)]
Remove use of intrusive ref count ownership acquisition

The one use of CheckerManager (AnalysisConsumer, calling
createCheckerManager) keeps a strong reference to the AnalysisOptions
anyway, so this ownership wasn't necessary.

(I'm not even sure AnalysisOptions needs ref counting at all - but
that's more involved)

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

7 years agoFix failure to treat overloaded function in braced-init-list as a non-deduced context.
Richard Smith [Wed, 4 Jan 2017 22:03:59 +0000 (22:03 +0000)]
Fix failure to treat overloaded function in braced-init-list as a non-deduced context.

Previously, if an overloaded function in a braced-init-list was encountered in
template argument deduction, and the overload set couldn't be resolved to a
particular function, we'd immediately produce a deduction failure. That's not
correct; this situation is supposed to result in that particular P/A pair being
treated as a non-deduced context, and deduction can still succeed if the type
can be deduced from elsewhere.

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

7 years agoRevert accidentally-committed file.
Richard Smith [Wed, 4 Jan 2017 19:48:07 +0000 (19:48 +0000)]
Revert accidentally-committed file.

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

7 years agoFactor out duplicated code and simplify.
Richard Smith [Wed, 4 Jan 2017 19:47:19 +0000 (19:47 +0000)]
Factor out duplicated code and simplify.

No functionality change intended.

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

7 years ago[Sema] Replace remove_if+erase with erase_if. NFC.
George Burgess IV [Wed, 4 Jan 2017 19:16:29 +0000 (19:16 +0000)]
[Sema] Replace remove_if+erase with erase_if. NFC.

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

7 years agoSupport -fno-delayed-template-parsing in clang-cl.exe
Reid Kleckner [Wed, 4 Jan 2017 19:15:53 +0000 (19:15 +0000)]
Support -fno-delayed-template-parsing in clang-cl.exe

Summary:
This change adds support for the -fno-delayed-template-parsing option in
clang-cl.exe. This allows developers using clang-cl.exe to opt out of
emulation of MSVC's non-conformant template instantiation implementation
while continuing to use clang-cl.exe for its emulation of cl.exe
command-line options. The default behavior of clang-cl.exe
(-fdelayed-template-parsing) is unchanged.

The MSVC Standard Library implementation uses clang-cl.exe with this
switch in its tests to ensure that the library headers work on compilers
with the conformant two-phase-lookup behavior.

Reviewers: majnemer, cfe-commits, DaveBartolomeo

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

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

7 years agoReverting commit r290983 while debugging test failure on windows.
Arpith Chacko Jacob [Wed, 4 Jan 2017 19:14:43 +0000 (19:14 +0000)]
Reverting commit r290983 while debugging test failure on windows.

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

7 years agoUse -### so the mbig-obj.c test passes when there is no registered x86 target
Reid Kleckner [Wed, 4 Jan 2017 18:50:51 +0000 (18:50 +0000)]
Use -### so the mbig-obj.c test passes when there is no registered x86 target

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

7 years ago[OpenMP] Update target codegen for NVPTX device.
Arpith Chacko Jacob [Wed, 4 Jan 2017 18:44:50 +0000 (18:44 +0000)]
[OpenMP] Update target codegen for NVPTX device.

This patch includes updates for codegen of the target region for the NVPTX
device. It moves initializers from the compiler to the runtime and updates
the worker loop to assume parallel work is retrieved from the runtime. A
subsequent patch will update the codegen to retrieve the parallel work using
calls to the runtime. It includes the removal of the inline attribute
for the worker loop and disabling debug info in it.

This allows codegen for a target directive and serial execution on the
NVPTX device.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28125

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

7 years ago[CUDA] Pre-include sm_60 and sm_61 headers.
Artem Belevich [Wed, 4 Jan 2017 18:39:29 +0000 (18:39 +0000)]
[CUDA] Pre-include sm_60 and sm_61 headers.

CUDA-8.0 comes with new headers which nvcc pre-includes via cuda_runtime.h
Clang now makes them available as well.

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

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

7 years agoAccept and ignore -Wa,-mbig-obj on COFF targets for gas compatibility
Reid Kleckner [Wed, 4 Jan 2017 18:16:32 +0000 (18:16 +0000)]
Accept and ignore -Wa,-mbig-obj on COFF targets for gas compatibility

LLVM's integrated assembler will automatically switch to big objects
when there are more than 2**16 sections.

Patch by Kyra!

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

7 years agoFix a buildbot failure introduced by r290960.
Alex Lorenz [Wed, 4 Jan 2017 15:07:13 +0000 (15:07 +0000)]
Fix a buildbot failure introduced by r290960.

The commit r290960 checked the the basic block label name which isn't there
when clang is compiled in release mode.

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

7 years agoAdd -f[no-]strict-return flag that can be used to avoid undefined behaviour
Alex Lorenz [Wed, 4 Jan 2017 13:40:34 +0000 (13:40 +0000)]
Add -f[no-]strict-return flag that can be used to avoid undefined behaviour
in non-void functions that fall off at the end without returning a value when
compiling C++.

Clang uses the new compiler flag to determine when it should treat control flow
paths that fall off the end of a non-void function as unreachable. If
-fno-strict-return is on, the code generator emits the ureachable and trap
IR only when the function returns either a record type with a non-trivial
destructor or another non-trivially copyable type.

The primary goal of this flag is to avoid treating falling off the end of a
non-void function as undefined behaviour. The burden of undefined behaviour
is placed on the caller instead: if the caller ignores the returned value then
the undefined behaviour is avoided. This kind of behaviour is useful in
several cases, e.g. when compiling C code in C++ mode.

rdar://13102603

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

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

7 years agoclang-format: [JS] avoid indent after ambient function declarations.
Martin Probst [Wed, 4 Jan 2017 13:36:43 +0000 (13:36 +0000)]
clang-format: [JS] avoid indent after ambient function declarations.

Summary:
Before:
  declare function foo();
    let x = 1;

After:
  declare function foo();
  let x = 1;

The problem was that clang-format would unconditionally try to parse a child block, even though ambient function declarations do not have a body (similar to forward declarations).

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[clang] Update lit config in utils/perf-training
Alexander Shaposhnikov [Wed, 4 Jan 2017 04:33:28 +0000 (04:33 +0000)]
[clang] Update lit config in utils/perf-training

This diff replaces --driver-mode=cpp in
utils/perf-training/order-files.lit.cfg and
utils/perf-training/lit.cfg with --driver-mode=g++.
clang --driver-mode=cpp will call the preprocessor and will not
trigger compilation.

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

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

7 years agoFix deduction of pack elements after a braced-init-list.
Richard Smith [Wed, 4 Jan 2017 02:59:16 +0000 (02:59 +0000)]
Fix deduction of pack elements after a braced-init-list.

Previously, if the arguments for a parameter pack contained a braced-init-list,
we would abort deduction (keeping the pack deductions from prior arguments) at
the point when we reached the braced-init-list, resulting in wrong deductions
and rejects-valids. We now just leave a "hole" in the pack for such an argument,
which needs to be filled by another deduction of the same pack.

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

7 years agoChange clang-format's Chromium JavaScript defaults
Nico Weber [Wed, 4 Jan 2017 02:33:36 +0000 (02:33 +0000)]
Change clang-format's Chromium JavaScript defaults

Chromium is starting to use clang-format on more JavaScript.

In doing this, we discovered that our defaults were not doing a good job
differentiating between JS and C++.

This change moves some defaults to only apply to C++.
https://reviews.llvm.org/D28165

Patch from Dan Beam <dbeam@chromium.org>!

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

7 years agoRemove accidentally-added lines in r290923 test, and add another testcase.
Richard Smith [Wed, 4 Jan 2017 02:03:39 +0000 (02:03 +0000)]
Remove accidentally-added lines in r290923 test, and add another testcase.

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

7 years agoFix template argument deduction when only some of a parameter pack is a non-deduced...
Richard Smith [Wed, 4 Jan 2017 01:48:55 +0000 (01:48 +0000)]
Fix template argument deduction when only some of a parameter pack is a non-deduced context.

When a parameter pack has multiple corresponding arguments, and some subset of
them are overloaded functions, it's possible that some subset of the parameters
are non-deduced contexts. In such a case, keep deducing from the remainder of
the arguments, and resolve the incomplete pack against whatever other
deductions we've performed for the pack.

GCC, MSVC, and ICC give three different bad behaviors for this case; what we do
now (and what we did before) don't exactly match any of them, sadly :( I'm
getting a core issue opened to specify more precisely how this should be
handled.

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

7 years agoExtend -Wtautological-overlap-compare to more cases.
Richard Trieu [Wed, 4 Jan 2017 00:46:30 +0000 (00:46 +0000)]
Extend -Wtautological-overlap-compare to more cases.

Previously, -Wtautological-overlap-compare did not warn on cases where the
boolean expression was in an assignment or return statement.  This patch
should cause all boolean statements to be passed to the tautological compare
checks in the CFG analysis.

This is one of the issues from PR13101

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

7 years agoAdd -plugin-opt=sample-profile for thinLTO build.
Dehao Chen [Wed, 4 Jan 2017 00:33:23 +0000 (00:33 +0000)]
Add -plugin-opt=sample-profile for thinLTO build.

Summary: ThinLTO needs to pass down the sample profile file path to linker.

Reviewers: tejohnson, davidxl, mehdi_amini

Subscribers: bruno, cfe-commits

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

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

7 years agoRe-add objectsize function/incomplete type checks.
George Burgess IV [Tue, 3 Jan 2017 23:35:19 +0000 (23:35 +0000)]
Re-add objectsize function/incomplete type checks.

I accidentally omitted these when refactoring this code. This caused
problems when building parts of the test-suite on MacOS.

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

7 years agoRelax CHECK line from r290906
Reid Kleckner [Tue, 3 Jan 2017 21:29:51 +0000 (21:29 +0000)]
Relax CHECK line from r290906

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

7 years ago[Win64] Don't widen integer literal zero arguments to unprototyped function calls
Reid Kleckner [Tue, 3 Jan 2017 21:23:35 +0000 (21:23 +0000)]
[Win64] Don't widen integer literal zero arguments to unprototyped function calls

The special case to widen the integer literal zero when passed to
variadic function calls should only apply to variadic functions, not
unprototyped functions. This is consistent with what MSVC does. In this
test case, MSVC uses a 4-byte store to pass the 5th argument to 'kr' and
an 8-byte store to pass the zero to 'v':

  void v(int, ...);
  void kr();
  void f(void) {
    v(1, 2, 3, 4, 0);
    kr(1, 2, 3, 4, 0);
  }

Aaron Ballman discovered this issue in https://reviews.llvm.org/D28166

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

7 years ago[OpenMP] Code cleanup for NVPTX OpenMP codegen
Arpith Chacko Jacob [Tue, 3 Jan 2017 20:19:56 +0000 (20:19 +0000)]
[OpenMP] Code cleanup for NVPTX OpenMP codegen

This patch cleans up private methods for NVPTX OpenMP codegen. It converts private
members to static functions to follow the coding style of CGOpenMPRuntime.cpp and
declutter the header file.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28124

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

7 years ago[OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host code...
Carlo Bertolli [Tue, 3 Jan 2017 18:24:42 +0000 (18:24 +0000)]
[OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host code generation

https://reviews.llvm.org/D17840

This patch enables private, firstprivate, and lastprivate clauses for the OpenMP distribute directive.
Regression tests differ from the similar case of the same clauses on the for directive, by removing a reference to two global variables g and g1. This is necessary because: 1. a distribute pragma is only allowed inside a target region; 2. referring a global variable (e.g. g and g1) in a target region requires the program to enclose the variable in a "declare target" region; 3. declare target pragmas, which are used to define a declare target region, are currently unavailable in clang (patch being prepared).
For this reason, I moved the global declarations into local variables.

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

7 years ago[clang-tidy] Add check name to YAML export
Alexander Kornienko [Tue, 3 Jan 2017 14:35:47 +0000 (14:35 +0000)]
[clang-tidy] Add check name to YAML export

Add a field indicating the associated check for every replacement to the YAML
report generated with the '-export-fixes' option.  Update
clang-apply-replacements to handle the new format.

Patch by Alpha Abdoulaye!

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

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

7 years agoHandle StaticAssertDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:16:02 +0000 (12:16 +0000)]
Handle StaticAssertDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle VarTemplateDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:14:59 +0000 (12:14 +0000)]
Handle VarTemplateDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle AccessSpecDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:12:36 +0000 (12:12 +0000)]
Handle AccessSpecDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle ClassTemplateSpecializationDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:11:17 +0000 (12:11 +0000)]
Handle ClassTemplateSpecializationDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle EmptyDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:09:39 +0000 (12:09 +0000)]
Handle EmptyDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle UsingDecl and UsingShadowDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:08:40 +0000 (12:08 +0000)]
Handle UsingDecl and UsingShadowDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle FriendDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:07:20 +0000 (12:07 +0000)]
Handle FriendDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years ago[CodeCompletion] Autocomplete NS_DESIGNATED_INITIALIZER in initializers
Alex Lorenz [Tue, 3 Jan 2017 11:56:40 +0000 (11:56 +0000)]
[CodeCompletion] Autocomplete NS_DESIGNATED_INITIALIZER in initializers
with arguments

rdar://21014571

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

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ pragma
Kelvin Li [Tue, 3 Jan 2017 05:23:48 +0000 (05:23 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ pragma

This patch is to implement sema and parsing for 'target teams distribute parallel for simd’ pragma.

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

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

7 years agoAdd testcase for the regression introduced in r290808.
Richard Smith [Mon, 2 Jan 2017 23:00:32 +0000 (23:00 +0000)]
Add testcase for the regression introduced in r290808.

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

7 years agoRemove isIgnored()-test that is more expensive than the analysis behind it
Daniel Jasper [Mon, 2 Jan 2017 22:55:45 +0000 (22:55 +0000)]
Remove isIgnored()-test that is more expensive than the analysis behind it

In many translation units I have tried, the calls to isIgnored() removed
in this patch are more expensive than doing the analysis that is behind
it. The speed-up in translation units I have tried is between 10 and
20%.

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

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

7 years ago[OpenMP] Add test cases for the proc_bind and schedule clauses with 'teams distribute...
Kelvin Li [Mon, 2 Jan 2017 16:42:11 +0000 (16:42 +0000)]
[OpenMP] Add test cases for the proc_bind and schedule clauses with 'teams distribute parallel for' pragma.

https://reviews.llvm.org/D28205

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

7 years agoRevert "DR1391: Check for implicit conversion sequences for non-dependent function...
Renato Golin [Mon, 2 Jan 2017 11:15:42 +0000 (11:15 +0000)]
Revert "DR1391: Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation."

This reverts commit r290808, as it broken all ARM and AArch64 test-suite
test: MultiSource/UnitTests/C++11/frame_layout

Also, please, next time, try to write a commit message in according to
our guidelines:

http://llvm.org/docs/DeveloperPolicy.html#commit-messages

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

7 years agoDR1391: Check for implicit conversion sequences for non-dependent function
Richard Smith [Mon, 2 Jan 2017 02:42:17 +0000 (02:42 +0000)]
DR1391: Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside
the immediate context is much more common during substitution than during
implicit conversion sequence formation.

This does not implement the partial ordering portion of DR1391, which so
far appears to be misguided.

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

7 years agoAddress post-commit review comments.
Richard Smith [Mon, 2 Jan 2017 02:38:22 +0000 (02:38 +0000)]
Address post-commit review comments.

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

7 years agoCodeGen: update comment about RTTI field
Saleem Abdulrasool [Sun, 1 Jan 2017 19:16:02 +0000 (19:16 +0000)]
CodeGen: update comment about RTTI field

The MS ABI RTTI has a reserved field which is used as a cache for the
demangled name.  It must be zero-initialized, which is used as a hint by
the runtime to say that the cache has not been populated.  Since this
field is populated at runtime, the RTTI structures must be placed in the
.data section rather than .rdata.  NFC

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

7 years agoFix typo in test case. NFC
Kelvin Li [Sat, 31 Dec 2016 23:36:47 +0000 (23:36 +0000)]
Fix typo in test case.  NFC

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

7 years ago[c++17] Implement P0522R0 as written. This allows a template template argument
Richard Smith [Sat, 31 Dec 2016 21:41:23 +0000 (21:41 +0000)]
[c++17] Implement P0522R0 as written. This allows a template template argument
to be specified for a template template parameter whenever the parameter is at
least as specialized as the argument (when there's an obvious and correct
mapping from uses of the parameter to uses of the argument). For example, a
template with more parameters can be passed to a template template parameter
with fewer, if those trailing parameters have default arguments.

This is disabled by default, despite being a DR resolution, as it's fairly
broken in its current state: there are no partial ordering rules to cope with
template template parameters that have different parameter lists, meaning that
code that attempts to decompose template-ids based on arity can hit unavoidable
ambiguity issues.

The diagnostics produced on a non-matching argument are also pretty bad right
now, but I aim to improve them in a subsequent commit.

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

7 years ago[clang] Fix clean build of generate-order-file
Alexander Shaposhnikov [Sat, 31 Dec 2016 05:25:52 +0000 (05:25 +0000)]
[clang] Fix clean build of generate-order-file

This diff fixes the clean build of the target generate-order-file.
In llvm/tools/clang/CMakeLists.txt
add_subdirectory(utils/perf-training) should go after the block where
the value of the variable CLANG_ORDER_FILE is set - otherwise
(tested with cmake's version 3.6.2) the arguments of perf-helper.py gen-order-file
will be ill-formed (CLANG_ORDER_FILE will be empty).

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

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

7 years agoRemove redundant assertion.
Richard Smith [Sat, 31 Dec 2016 03:33:42 +0000 (03:33 +0000)]
Remove redundant assertion.

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

7 years agoTypo fix in AST matcher documentation: s/aribtrary/arbitrary/
James Dennett [Sat, 31 Dec 2016 01:04:02 +0000 (01:04 +0000)]
Typo fix in AST matcher documentation: s/aribtrary/arbitrary/

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

7 years agoWdocumentation fix
Simon Pilgrim [Fri, 30 Dec 2016 22:55:33 +0000 (22:55 +0000)]
Wdocumentation fix

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

7 years ago[clang] Minor fix to libASTMatcherTutorial
Mads Ravn [Fri, 30 Dec 2016 20:49:44 +0000 (20:49 +0000)]
[clang] Minor fix to libASTMatcherTutorial

There was a small error in the code in the tutorial. The tutorial contains a few errors which results in code not being able to compile.

One error was described here: https://llvm.org/bugs/show_bug.cgi?id=25583 .

I found and fixed the error and one additional error.

Reviewers: aaron.ballman, malcolm.parsons

Subscribers: cfe-commits

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

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

7 years agoCodeGen: use a StringSwitch instead of cascasding ifs
Saleem Abdulrasool [Fri, 30 Dec 2016 18:45:03 +0000 (18:45 +0000)]
CodeGen: use a StringSwitch instead of cascasding ifs

Change the cascading ifs to a StringSwitch to simplify the conversion of
the relocation model.  NFC

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

7 years agoAllow lexer to handle string_view literals. Patch from Anton Bikineev.
Eric Fiselier [Fri, 30 Dec 2016 04:51:10 +0000 (04:51 +0000)]
Allow lexer to handle string_view literals. Patch from Anton Bikineev.

This implements the compiler side of p0403r0. This patch was reviewed as
https://reviews.llvm.org/D26829.

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

7 years agoRemove bogus assertion and add testcase that triggers it.
Richard Smith [Fri, 30 Dec 2016 04:32:02 +0000 (04:32 +0000)]
Remove bogus assertion and add testcase that triggers it.

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragma
Kelvin Li [Thu, 29 Dec 2016 22:16:30 +0000 (22:16 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragma

This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma.

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

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

7 years ago[ADT] Delete RefCountedBaseVPTR.
Justin Lebar [Thu, 29 Dec 2016 19:59:26 +0000 (19:59 +0000)]
[ADT] Delete RefCountedBaseVPTR.

Summary:
This class is unnecessary.

Its comment indicated that it was a compile error to allocate an
instance of a class that inherits from RefCountedBaseVPTR on the stack.
This may have been true at one point, but it's not today.

Moreover you really do not want to allocate *any* refcounted object on
the stack, vptrs or not, so if we did have a way to prevent these
objects from being stack-allocated, we'd want to apply it to regular
RefCountedBase too, obviating the need for a separate RefCountedBaseVPTR
class.

It seems that the main way RefCountedBaseVPTR provides safety is by
making its subclass's destructor virtual.  This may have been helpful at
one point, but these days clang will emit an error if you define a class
with virtual functions that inherits from RefCountedBase but doesn't
have a virtual destructor.

Reviewers: compnerd, dblaikie

Subscribers: cfe-commits, klimek, llvm-commits, mgorny

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

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

7 years ago[ItaniumABI] NFC changes
Piotr Padlewski [Wed, 28 Dec 2016 18:26:08 +0000 (18:26 +0000)]
[ItaniumABI] NFC changes

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

7 years agoRevert "Mention devirtualization in release notes"
Piotr Padlewski [Wed, 28 Dec 2016 18:25:30 +0000 (18:25 +0000)]
Revert "Mention devirtualization in release notes"

Accidental commit. LLVM changes have not been pushed yet
This reverts commit 592453413690a2d16784667d1644758b9af700c1.

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

7 years agoMention devirtualization in release notes
Piotr Padlewski [Wed, 28 Dec 2016 18:23:23 +0000 (18:23 +0000)]
Mention devirtualization in release notes

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

7 years ago[ThinLTO] No need to rediscover imports in distributed backend
Teresa Johnson [Wed, 28 Dec 2016 18:00:08 +0000 (18:00 +0000)]
[ThinLTO] No need to rediscover imports in distributed backend

Summary:
We can simply import all external values with summaries included in
the individual index file created for the distributed backend job,
as only those are added to the individual index file created by the
WriteIndexesThinBackend (in addition to summaries for the original
module, which are skipped here).

While computing the cross module imports on this index would come to
the same conclusion as the original thin link import logic, it is
unnecessary work. And when tuning, it avoids the need to pass the
same function importing parameters (e.g. -import-instr-limit) to
both the thin link and the backends (otherwise they won't make the
same decisions).

Reviewers: mehdi_amini, pcc

Subscribers: cfe-commits

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

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

7 years agoFix format. NFC
Kelvin Li [Wed, 28 Dec 2016 17:57:07 +0000 (17:57 +0000)]
Fix format. NFC

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

7 years agoRevert "Driver: switch Windows to static RelocModel"
Reid Kleckner [Wed, 28 Dec 2016 17:41:36 +0000 (17:41 +0000)]
Revert "Driver: switch Windows to static RelocModel"

This reverts commit r290569. It caused unforeseen codegen changes for
switch jump tables described in PR31488.

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

7 years ago[ThinLTO] Add missing FileCheck invocation
Teresa Johnson [Wed, 28 Dec 2016 16:45:37 +0000 (16:45 +0000)]
[ThinLTO] Add missing FileCheck invocation

One of the intended checks was not being performed.

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

7 years ago[CodeGen] Unique constant CompoundLiterals.
George Burgess IV [Wed, 28 Dec 2016 07:27:40 +0000 (07:27 +0000)]
[CodeGen] Unique constant CompoundLiterals.

Our newly aggressive constant folding logic makes it possible for
CGExprConstant to see the same CompoundLiteralExpr more than once. So,
emitting a new GlobalVariable every time we see a CompoundLiteral is no
longer correct.

We had a similar issue with BlockExprs that was caught while testing
said aggressive folding, so I applied the same style of fix (see D26410)
here. If we find yet another case where this needs to happen, we should
probably refactor this so we don't have a third DenseMap+getter+setter.

As a design note: getAddrOfConstantCompoundLiteralIfEmitted is really
only intended to be called by ConstExprEmitter::EmitLValue. So,
returning a GlobalVariable* instead of a ConstantAddress costs us
effectively nothing, and saves us either a few bytes per entry in our
map or a bit of code duplication.

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

7 years agoMark 'auto' as dependent when instantiating the type of a non-type template
Richard Smith [Wed, 28 Dec 2016 06:27:18 +0000 (06:27 +0000)]
Mark 'auto' as dependent when instantiating the type of a non-type template
parameter. Fixes failed deduction for 'auto' non-type template parameters
nested within templates.

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

7 years agoDR1315: a non-type template argument in a partial specialization is permitted
Richard Smith [Wed, 28 Dec 2016 02:37:25 +0000 (02:37 +0000)]
DR1315: a non-type template argument in a partial specialization is permitted
to make reference to template parameters. This is only a partial
implementation; we retain the restriction that the argument must not be
type-dependent, since it's unclear how that would work given the existence of
other language rules requiring an exact type match in this context, even for
type-dependent cases (a question has been raised on the core reflector).

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

7 years agoUpdate test that relies on the optimizer to match new output.
Michael Kuperstein [Wed, 28 Dec 2016 00:30:43 +0000 (00:30 +0000)]
Update test that relies on the optimizer to match new output.

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

7 years agoDebugInfo: Don't include size/alignment on class declarations
David Blaikie [Tue, 27 Dec 2016 22:05:35 +0000 (22:05 +0000)]
DebugInfo: Don't include size/alignment on class declarations

This seems like it must've been a leftover by accident - no tests were
backing it up & it doesn't make much sense to include size/alignment on
class declarations (it'd only be on those declarations for which the
definition was available - otherwise the size/alignment would not be
known).

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

7 years agoAdd warning flag for "partial specialization is not more specialized than primary...
Richard Smith [Tue, 27 Dec 2016 20:03:09 +0000 (20:03 +0000)]
Add warning flag for "partial specialization is not more specialized than primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specialization is not usable because one or more of its parameters cannot be deduced" warning.

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

7 years ago[DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.
Ekaterina Romanova [Tue, 27 Dec 2016 18:53:29 +0000 (18:53 +0000)]
[DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.

Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable.
Formatted comments to fit into 80 chars.
In some cases added \a command in front of the parameter names to display them in italics.

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