]> granicus.if.org Git - clang/log
clang
7 years agoReapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCom...
David Blaikie [Fri, 6 Jan 2017 19:49:01 +0000 (19:49 +0000)]
Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer"

Aleksey Shlypanikov pointed out my mistake in migrating an explicit
unique_ptr to auto - I was expecting the function returned a unique_ptr,
but instead it returned a raw pointer - introducing a leak.

Thanks Aleksey!

This reapplies r291184, reverted in r291249.

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

7 years agoClean up redundant isa<T> before getAs<T>. NFC.
George Burgess IV [Fri, 6 Jan 2017 19:10:48 +0000 (19:10 +0000)]
Clean up redundant isa<T> before getAs<T>. NFC.

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

7 years ago[OpenMP] fix typo - the standalone 'distribute' pragma should be 'teams distribute...
Kelvin Li [Fri, 6 Jan 2017 18:49:49 +0000 (18:49 +0000)]
[OpenMP] fix typo - the standalone 'distribute' pragma should be 'teams distribute' pragma

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

7 years ago[CUDA] Add a host target triple to cuda-version-check.cu
Reid Kleckner [Fri, 6 Jan 2017 18:16:03 +0000 (18:16 +0000)]
[CUDA] Add a host target triple to cuda-version-check.cu

It passes --sysroot for the Linux CUDA installation. To make this test
pass when targetting Windows, you would need to pass
--sysroot=Inputs/CUDA-windows.

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

7 years agoMake ASTContext::getDeclAlign return the correct alignment for
Akira Hatanaka [Fri, 6 Jan 2017 17:56:15 +0000 (17:56 +0000)]
Make ASTContext::getDeclAlign return the correct alignment for
FunctionDecls.

This commit silences an incorrect warning that is issued when a function
pointer is cast to another function pointer type. The warning gets
issued because alignments of the source and destination do not match in
Sema::CheckCastAlign, which happens because ASTContext::getTypeInfoImpl
and ASTContext::getDeclAlign return different values for functions (the
former returns 4 while the latter returns 1).

This should fix PR31558.

rdar://problem/29533528

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

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

7 years agoRevert "Fix examples for recent shared_ptrification"
David Blaikie [Fri, 6 Jan 2017 17:50:34 +0000 (17:50 +0000)]
Revert "Fix examples for recent shared_ptrification"

(should've rolled in to this revert of the CompilerInstance change in
the first place... anyway)

This reverts commit r291185.

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

7 years agoRevert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeComp...
David Blaikie [Fri, 6 Jan 2017 17:47:10 +0000 (17:47 +0000)]
Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer"

Caused a memory leak reported by asan. Reverting while I investigate.

This reverts commit r291184.

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

7 years ago[OpenCL] Re-enable supported core extensions based on opencl version when disabling...
Konstantin Zhuravlyov [Fri, 6 Jan 2017 16:14:41 +0000 (16:14 +0000)]
[OpenCL] Re-enable supported core extensions based on opencl version when disabling all extensions using pragma

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

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

7 years ago[ubsan] Minimize size of data for type_mismatch (Redo of D19667)
Filipe Cabecinhas [Fri, 6 Jan 2017 14:40:12 +0000 (14:40 +0000)]
[ubsan] Minimize size of data for type_mismatch (Redo of D19667)

Summary:
This patch makes the type_mismatch static data 7 bytes smaller (and it
ends up being 16 bytes smaller due to alignment restrictions, at least
on some x86-64 environments).

It revs up the type_mismatch handler version since we're breaking binary
compatibility. I will soon post a patch for the compiler-rt side.

Reviewers: rsmith, kcc, vitalybuka, pgousseau, gbedwell

Subscribers: llvm-commits

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

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

7 years ago[CodeCompletion] Block property setters: Use dynamic priority heuristic
Alex Lorenz [Fri, 6 Jan 2017 12:00:44 +0000 (12:00 +0000)]
[CodeCompletion] Block property setters: Use dynamic priority heuristic

Now when completing blocks properties that return void the block call completion
result shows up before the setter, otherwise the setter completion shows up
before the block call completion. We normally want to use the result of the
block call, so one typically wouldn't call a block that returns a non-void type
in a standalone statement.

rdar://28846153

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

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

7 years ago[ObjC] The declarator for a block literal should be a definition
Alex Lorenz [Fri, 6 Jan 2017 11:31:12 +0000 (11:31 +0000)]
[ObjC] The declarator for a block literal should be a definition

This change avoids the -Wstrict-prototypes warning for block literals with an
empty argument list or without argument lists.

rdar://15060615

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

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

7 years agoConstify UsingPackDecl::getInstantiatedFromUsingDecl(), NFC.
Yaron Keren [Fri, 6 Jan 2017 11:15:57 +0000 (11:15 +0000)]
Constify UsingPackDecl::getInstantiatedFromUsingDecl(), NFC.

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

7 years agoCodeGen: address post commit review comments for r291123
Saleem Abdulrasool [Fri, 6 Jan 2017 02:27:40 +0000 (02:27 +0000)]
CodeGen: address post commit review comments for r291123

This test would force the execution of the backend.  However, the
backend already has a test for this.  Effectively, this was trying to
test that an API call was made properly.  We do not have a good way to
really test this.  The test itself tested very little.

Addresses post-commit review comments from Eric Christopher.

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

7 years agoshared_ptrify (from InclusiveRefCntPtr) HeaderSearchOptions
David Blaikie [Fri, 6 Jan 2017 01:04:46 +0000 (01:04 +0000)]
shared_ptrify (from InclusiveRefCntPtr) HeaderSearchOptions

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

7 years agoFix bug where types other than 'cv auto', 'cv auto &', and 'cv auto &&' could
Richard Smith [Thu, 5 Jan 2017 23:12:16 +0000 (23:12 +0000)]
Fix bug where types other than 'cv auto', 'cv auto &', and 'cv auto &&' could
incorrectly be deduced from an initializer list in pathological cases.

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

7 years agoAdd missing "original call argument has same type as deduced parameter type"
Richard Smith [Thu, 5 Jan 2017 23:02:44 +0000 (23:02 +0000)]
Add missing "original call argument has same type as deduced parameter type"
check for deductions from elements of a braced-init-list.

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

7 years agoRemove the ppc insertword/extractword expected fail tests.
Sean Fertile [Thu, 5 Jan 2017 22:54:34 +0000 (22:54 +0000)]
Remove the ppc insertword/extractword expected fail tests.

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

7 years agoFix examples for recent shared_ptrification
David Blaikie [Thu, 5 Jan 2017 22:36:44 +0000 (22:36 +0000)]
Fix examples for recent shared_ptrification

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

7 years agoIntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer
David Blaikie [Thu, 5 Jan 2017 22:19:11 +0000 (22:19 +0000)]
IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer

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

7 years agoAdd vec_insert4b and vec_extract4b functions to altivec.h
Sean Fertile [Thu, 5 Jan 2017 21:43:30 +0000 (21:43 +0000)]
Add vec_insert4b and vec_extract4b functions to altivec.h

Add builtins for the functions and custom codegen mapping the builtins to their
corresponding intrinsics and handling the endian related swapping.

https://reviews.llvm.org/D26546

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

7 years agoIf an explicitly-specified pack might have been extended by template argument
Richard Smith [Thu, 5 Jan 2017 20:27:28 +0000 (20:27 +0000)]
If an explicitly-specified pack might have been extended by template argument
deduction, don't forget to check the argument is valid.

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

7 years agoMove SerializedDiagnosticPrinter's SharedState to std::shared_ptr rather than Intrusi...
David Blaikie [Thu, 5 Jan 2017 19:48:10 +0000 (19:48 +0000)]
Move SerializedDiagnosticPrinter's SharedState to std::shared_ptr rather than IntrusiveRefCntPtr

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

7 years agoMove Preprocessor over to std::shared_ptr rather than IntrusiveRefCntPtr
David Blaikie [Thu, 5 Jan 2017 19:48:07 +0000 (19:48 +0000)]
Move Preprocessor over to std::shared_ptr rather than IntrusiveRefCntPtr

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

7 years agoMove PreprocessorOptions to std::shared_ptr from IntrusiveRefCntPtr
David Blaikie [Thu, 5 Jan 2017 19:11:36 +0000 (19:11 +0000)]
Move PreprocessorOptions to std::shared_ptr from IntrusiveRefCntPtr

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

7 years agoMove FailedModulesSet over to shared_ptr from IntrusiveRefCntPtr
David Blaikie [Thu, 5 Jan 2017 19:11:31 +0000 (19:11 +0000)]
Move FailedModulesSet over to shared_ptr from IntrusiveRefCntPtr

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

7 years agoMove VariantMatcher's Payload to std::shared_ptr rather than IntrusiveRefCntPtr
David Blaikie [Thu, 5 Jan 2017 18:51:54 +0000 (18:51 +0000)]
Move VariantMatcher's Payload to std::shared_ptr rather than IntrusiveRefCntPtr

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

7 years agoSimplify ASTReader ctor by using in-class initializers for many member variables
David Blaikie [Thu, 5 Jan 2017 18:45:45 +0000 (18:45 +0000)]
Simplify ASTReader ctor by using in-class initializers for many member variables

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

7 years agoSimplify ASTReader ctor by using in-class initializers (NSDMIs to the rest of you...
David Blaikie [Thu, 5 Jan 2017 18:45:43 +0000 (18:45 +0000)]
Simplify ASTReader ctor by using in-class initializers (NSDMIs to the rest of you) for many member variables

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

7 years agoUse shared_ptr instead of IntrusiveRefCntPtr for ModuleFileExtension
David Blaikie [Thu, 5 Jan 2017 18:23:18 +0000 (18:23 +0000)]
Use shared_ptr instead of IntrusiveRefCntPtr for ModuleFileExtension

The intrusiveness wasn't needed here, so this simplifies/clarifies the
ownership model.

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

7 years agoTypo
Joerg Sonnenberger [Thu, 5 Jan 2017 17:59:44 +0000 (17:59 +0000)]
Typo

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

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