]> granicus.if.org Git - clang/log
clang
8 years ago[Devirtualization] Decorate vfunction load with invariant.load
Piotr Padlewski [Sat, 29 Oct 2016 15:28:30 +0000 (15:28 +0000)]
[Devirtualization] Decorate vfunction load with invariant.load

Summary:
This patch was introduced one year ago, but because my google account
was disabled, I didn't get email with failing buildbot and I missed
revert of this commit. There was small but in test regex.
I am back.

Reviewers: rsmith, rengolin

Subscribers: nlewycky, rjmccall, cfe-commits

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

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

8 years agoNFC small format
Piotr Padlewski [Sat, 29 Oct 2016 15:28:25 +0000 (15:28 +0000)]
NFC small format

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

8 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics...
Michael Zuckerman [Sat, 29 Oct 2016 10:29:20 +0000 (10:29 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics to Clang .

After LGTM and Check-all

Vector-reduction arithmetic accepts vectors as inputs and produces
scalars as outputs.This class of vector operation forms the basis
of many scientific computations. In vector-reduction arithmetic,
the evaluation off is independent of the order of the input elements of V.

Reviewer: 1. craig.topper
          2. igorb

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

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

8 years agoMake a function static. NFC.
George Burgess IV [Fri, 28 Oct 2016 21:42:06 +0000 (21:42 +0000)]
Make a function static. NFC.

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

8 years ago[Sema] Delay partial availability diagnostics, just like deprecated
Erik Pilkington [Fri, 28 Oct 2016 21:39:27 +0000 (21:39 +0000)]
[Sema] Delay partial availability diagnostics, just like deprecated

This is done so that the following compiles with no warnings:
int fn(type_10_12) __attribute__((availability(macos, introduced=10.12)));

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

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

8 years agoFix handling of constructor inherited through multiple levels of virtual base class.
Richard Smith [Fri, 28 Oct 2016 20:20:58 +0000 (20:20 +0000)]
Fix handling of constructor inherited through multiple levels of virtual base class.

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

8 years ago[PPC] add float and double overloads for vec_orc and vec_nand in altivec.h
Nemanja Ivanovic [Fri, 28 Oct 2016 20:04:53 +0000 (20:04 +0000)]
[PPC] add float and double overloads for vec_orc and vec_nand in altivec.h

This patch corresponds to review https://reviews.llvm.org/D25950.
Committing on behalf of Sean Fertile.

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

8 years agoPR30831: Teach template type diffing to cope with TemplateSpecializationTypes
Richard Smith [Fri, 28 Oct 2016 19:54:43 +0000 (19:54 +0000)]
PR30831: Teach template type diffing to cope with TemplateSpecializationTypes
that desugar to non-TSTs (such as injected-class-names).

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

8 years agoImplement vector count leading/trailing bytes with zero lsb and vector parity
Nemanja Ivanovic [Fri, 28 Oct 2016 19:49:03 +0000 (19:49 +0000)]
Implement vector count leading/trailing bytes with zero lsb and vector parity
builtins - clang portion

This patch corresponds to review: https://reviews.llvm.org/D26002
Committing on behalf of Zaara Syeda.

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

8 years agoFix implementation of the likely resolution of core issue 253 to support class
Richard Smith [Fri, 28 Oct 2016 19:11:18 +0000 (19:11 +0000)]
Fix implementation of the likely resolution of core issue 253 to support class
based arrays. Patch by Ian Tessier!

Differential Review: https://reviews.llvm.org/D25974

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

8 years agoAdd missing newline at EOF to avoid -Wnewline-eof warnings.
Bob Wilson [Fri, 28 Oct 2016 18:55:50 +0000 (18:55 +0000)]
Add missing newline at EOF to avoid -Wnewline-eof warnings.

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

8 years agoFixing small problem with avx512-reduceIntrin.c test on some OS.
Michael Zuckerman [Fri, 28 Oct 2016 17:25:26 +0000 (17:25 +0000)]
Fixing small problem with avx512-reduceIntrin.c test on some OS.

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

8 years agoRevert "[Preprocessor] Support for '-dI' flag"
Bruno Cardoso Lopes [Fri, 28 Oct 2016 17:02:10 +0000 (17:02 +0000)]
Revert "[Preprocessor] Support for '-dI' flag"

This reverts r285411. Tests failing on
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/141

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

8 years agoRelax assertion in FunctionDecl::doesDeclarationForceExternallyVisibleDefinition.
Justin Lebar [Fri, 28 Oct 2016 16:46:39 +0000 (16:46 +0000)]
Relax assertion in FunctionDecl::doesDeclarationForceExternallyVisibleDefinition.

Previously we were asserting that this declaration doesn't have a body
*and* won't have a body after we continue parsing.  This is too strong
and breaks the go-bindings test during codegen.

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

8 years ago[Preprocessor] Support for '-dI' flag
Bruno Cardoso Lopes [Fri, 28 Oct 2016 16:32:10 +0000 (16:32 +0000)]
[Preprocessor] Support for '-dI' flag

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

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

Patch by Steve O'Brien!

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

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

8 years ago[CUDA] [AST] Allow isInlineDefinitionExternallyVisible to be called on functions...
Justin Lebar [Fri, 28 Oct 2016 16:26:26 +0000 (16:26 +0000)]
[CUDA] [AST] Allow isInlineDefinitionExternallyVisible to be called on functions without bodies.

Summary:
In CUDA compilation, we call isInlineDefinitionExternallyVisible (via
getGVALinkageForFunction) on functions while parsing their definitions.

At the point in time when we call getGVALinkageForFunction, we haven't
yet added the body to the function, so we trip this assert.  But as far
as I can tell, this is harmless.

To work around this, we add a new flag to FunctionDecl, "WillHaveBody".

There was other code that was working around the existing assert with a
really awful hack -- this change lets us get rid of that hack.

Reviewers: rsmith, tra

Subscribers: aemerson, cfe-commits

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

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

8 years agoDefine extra variable in OpenMP offloading driver tests.
Samuel Antao [Fri, 28 Oct 2016 15:42:38 +0000 (15:42 +0000)]
Define extra variable in OpenMP offloading driver tests.

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

8 years ago1. Fixing small types issue (PD|PS) (reduce) .
Michael Zuckerman [Fri, 28 Oct 2016 15:16:03 +0000 (15:16 +0000)]
1. Fixing small types issue (PD|PS) (reduce)  .
2. Cosmetic changes

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

8 years agoChange OpenMP offload driver tests so that it doesn't use the full file path during...
Samuel Antao [Fri, 28 Oct 2016 15:11:50 +0000 (15:11 +0000)]
Change OpenMP offload driver tests so that it doesn't use the full file path during tests.

This was causing failures on windows bots.

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

8 years ago[OpenCL] Diagnose variadic arguments
Anastasia Stulova [Fri, 28 Oct 2016 12:59:39 +0000 (12:59 +0000)]
[OpenCL] Diagnose variadic arguments

OpenCL disallows using variadic arguments (s6.9.e and s6.12.5 OpenCL v2.0)
apart from some exceptions:
- printf
- enqueue_kernel

This change adds error diagnostic for variadic functions but accepts printf
and any compiler internal function (which should cover __enqueue_kernel_XXX cases).

It also unifies diagnostic with block prototype and adds missing uncaught cases for blocks.

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

8 years ago[Objective-C] Add objc_subclassing_restricted attribute
Alex Lorenz [Fri, 28 Oct 2016 10:25:10 +0000 (10:25 +0000)]
[Objective-C] Add objc_subclassing_restricted attribute

This patch adds an objc_subclassing_restricted attribute into clang. This
attribute acts similarly to 'final' - Objective-C classes with this attribute
can't be subclassed. However, @interface declarations that have
objc_subclassing_restricted but don't have @implementation are allowed to
inherit other @interface declarations with objc_subclassing_restricted. This is
needed to describe the Swift class hierarchy in clang while making sure that
the Objective-C classes cannot subclass the Swift classes.

This attribute is already implemented in a fork of clang that's used for Swift
(https://github.com/apple/swift-clang) and this patch moves that code to the
upstream clang repository.

rdar://28937548

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

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

8 years agoFix MSVC "not all control paths return a value" warning
Simon Pilgrim [Fri, 28 Oct 2016 10:09:35 +0000 (10:09 +0000)]
Fix MSVC "not all control paths return a value" warning

Add unreachable after enum switch statement

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

8 years ago[openmp] Remove test assumption that canonical binary name contains "clang"
Benjamin Kramer [Fri, 28 Oct 2016 09:20:02 +0000 (09:20 +0000)]
[openmp] Remove test assumption that canonical binary name contains "clang"

Patch by Sam McCall!

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

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

8 years agoSema: do not warn about unused const vars if main file is a header
Erik Verbruggen [Fri, 28 Oct 2016 08:28:42 +0000 (08:28 +0000)]
Sema: do not warn about unused const vars if main file is a header

If we pass a header to libclang, e.g. because it's open in an editor in
an IDE, warnings about unused const vars are not useful: other files
that include the header might use those constants. So when -x *-header
is passed as command-line option, suppress this warning.

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

8 years ago[Modules] Make test from r285377 darwin specific
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:37:04 +0000 (02:37 +0000)]
[Modules] Make test from r285377 darwin specific

Appease buildbots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55876

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

8 years ago[Modules] Add testcase for builtins used in umbrella headers
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:30:45 +0000 (02:30 +0000)]
[Modules] Add testcase for builtins used in umbrella headers

This used to work before r284797 + r285152, which exposed something
interesting; some users include builtins from umbrella headers.

Clang should emit a warning to warn users this is not a good practice
and umbrella headers shouldn't get the
implicitly-add-the-builtin-version behavior for builtin header names.

While we're not there, add the testcase to represent the way it
currently works.

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

8 years agoFix a crash on invalid code.
Richard Trieu [Fri, 28 Oct 2016 00:15:24 +0000 (00:15 +0000)]
Fix a crash on invalid code.

The diagnostic was attempting to access the QualType of a TypeDecl by calling
TypeDecl::getTypeForDecl.  However, the Type pointer stored there is lazily
loaded by functions in ASTContext.  In most cases, the pointer is loaded and
this does not cause a problem.  However, when more that 50 or so unknown types
are seen beforehand, this causes the Type to not be loaded, passing a null
Type to the diagnostics, leading to the crash.  Using
ASTContext::getTypeDeclType will give a proper QualType for all cases.

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

8 years ago[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute
Anna Zaks [Thu, 27 Oct 2016 21:38:44 +0000 (21:38 +0000)]
[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute

TSan and MSan were the only remaining sanitizers referring to the deprecated
attribute for issue suppression. Update the docs to recommend
__attribute__((no_sanitize("..."))) instead.

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

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

8 years agoAdd documentation describing the components of a complete toolchain including Clang.
Richard Smith [Thu, 27 Oct 2016 20:55:56 +0000 (20:55 +0000)]
Add documentation describing the components of a complete toolchain including Clang.

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

8 years ago[coroutines] Add diagnostics for copy/move assignment operators and functions with...
Eric Fiselier [Thu, 27 Oct 2016 18:43:28 +0000 (18:43 +0000)]
[coroutines] Add diagnostics for copy/move assignment operators and functions with deduced return types.

Summary: The title says it all. Additionally this patch refactors the diagnostic code into a separate function.

Reviewers: GorNishanov, rsmith

Subscribers: majnemer, mehdi_amini, cfe-commits

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

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

8 years agoUse -fopenmp=libomp in all OpenMP offloading tests.
Samuel Antao [Thu, 27 Oct 2016 18:29:57 +0000 (18:29 +0000)]
Use -fopenmp=libomp in all OpenMP offloading tests.

This will make sure the right features are being tested even for machines that default to libgomp.

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

8 years ago[Driver][OpenMP] Add support to create jobs for unbundling actions.
Samuel Antao [Thu, 27 Oct 2016 18:14:55 +0000 (18:14 +0000)]
[Driver][OpenMP] Add support to create jobs for unbundling actions.

Summary:
This patch adds the support to create jobs for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool to unbundle input files.

Unlike other actions, unbundling actions have multiple outputs. Therefore, this patch adds the required changes to have a variant of `Tool::ConstructJob` with multiple outputs.

The way the naming of the results is implemented is also slightly modified so that the same action can use a different offloading prefix for each use by the different offloading actions.

With this patch, it is possible to compile a functional OpenMP binary with offloading support, even with separate compilation.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[Driver][OpenMP] Add support to create jobs for bundling actions.
Samuel Antao [Thu, 27 Oct 2016 18:04:42 +0000 (18:04 +0000)]
[Driver][OpenMP] Add support to create jobs for bundling actions.

Summary: This patch adds the support to create a job for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[Driver][OpenMP] Update actions builder to create unbundling action when necessary.
Samuel Antao [Thu, 27 Oct 2016 18:00:51 +0000 (18:00 +0000)]
[Driver][OpenMP] Update actions builder to create unbundling action when necessary.

Summary:
Each time that offloading support is requested by the user and the input file is not a source file, an action `OffloadUnbundlingAction` is created to signal that the input file may contain bundles, so that the proper tool is then invoked to attempt to extract the components of the bundle. This patch adds the logic to create that action in offload action builder.

The job creation for the new action will be proposed in a separate patch.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[Driver][OpenMP] Update actions builder to create bundling action when necessary.
Samuel Antao [Thu, 27 Oct 2016 17:50:43 +0000 (17:50 +0000)]
[Driver][OpenMP] Update actions builder to create bundling action when necessary.

Summary:
In order to save the user from dealing with multiple output files (for host and device) while using separate compilation, a new action `OffloadBundlingAction` is used when the last phase is not linking. This action will then result in a job that uses the proposed bundling tool to create a single preprocessed/IR/ASM/Object file from multiple ones.

The job creation for the new action will be proposed in a separate patch.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[Driver][OpenMP] Add logic for offloading-specific argument translation.
Samuel Antao [Thu, 27 Oct 2016 17:39:44 +0000 (17:39 +0000)]
[Driver][OpenMP] Add logic for offloading-specific argument translation.

Summary:
This patch includes support for argument translation that is specific of a given offloading kind. Additionally, it implements the translation for OpenMP device kinds in the gcc tool chain.

With this patch, it is possible to compile a functional OpenMP application with offloading capabilities with no separate compilation.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[Driver][OpenMP] Build jobs for OpenMP offloading actions for targets using gcc tool...
Samuel Antao [Thu, 27 Oct 2016 17:31:22 +0000 (17:31 +0000)]
[Driver][OpenMP] Build jobs for OpenMP offloading actions for targets using gcc tool chains.

Summary:
This patch adds logic to create jobs for OpenMP offloading actions by:
 - tuning the jobs result information to use the offloading prefix even for (device) linking actions.
 - replacing the device inputs of the host linking jobs by a linker script that embed them in the right sections.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[CodeGen] Provide an appropriate alignment for dynamic allocas
David Majnemer [Thu, 27 Oct 2016 17:18:24 +0000 (17:18 +0000)]
[CodeGen] Provide an appropriate alignment for dynamic allocas

GCC documents __builtin_alloca as aligning the storage to at least
__BIGGEST_ALIGNMENT__.

MSVC documents essentially the same for the x64 ABI:
https://msdn.microsoft.com/en-us/library/x9sx5da1.aspx

The 32-bit ABI follows the same rule: it emits a call to _alloca_probe_16

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

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

8 years ago[MS ABI] Reuse getVFPtrOffsets instead of using getClassAtVTableLocation
David Majnemer [Thu, 27 Oct 2016 17:11:51 +0000 (17:11 +0000)]
[MS ABI] Reuse getVFPtrOffsets instead of using getClassAtVTableLocation

getClassAtVTableLocation hunts through virtual bases without using the
MDC layout which is indicative of a bug.

Instead, reuse the getVFPtrOffsets machinery to calculate which
subobject within the MDC is responsible for the vfptr.

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

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

8 years ago[Driver][OpenMP] Add specialized action builder for OpenMP offloading actions.
Samuel Antao [Thu, 27 Oct 2016 17:08:03 +0000 (17:08 +0000)]
[Driver][OpenMP] Add specialized action builder for OpenMP offloading actions.

Summary:
This patch adds a new specialized action builder to create OpenMP offloading actions. The specialized builder is added to the action builder already containing the CUDA specialized builder.

OpenMP offloading dependences between host and device actions (expressed with OffloadActions) are different that what is used for CUDA:
 - Device compile action depends on the host compile action - the device frontend extracts the information about the declarations that have to be emitted by looking into the metadata produced by the host frontend.
 - The host link action depends on the device link actions - the device images are embedded in the host binary at link time.

Reviewers: echristo, tra, rsmith, jlebar, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[Driver][OpenMP] Create tool chains for OpenMP offloading kind.
Samuel Antao [Thu, 27 Oct 2016 16:38:05 +0000 (16:38 +0000)]
[Driver][OpenMP] Create tool chains for OpenMP offloading kind.

Summary: This patch adds new logic to create the necessary tool chains to support offloading for OpenMP. The OpenMP related options are checked and the tool chains created accordingly. Diagnostics are emitted in case the options are illegal or express unknown targets.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: whchung, mkuron, mehdi_amini, cfe-commits, Hahnfeld, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years agoExpand -Wlogical-not-parentheses to also fire on `!x & A`.
Nico Weber [Thu, 27 Oct 2016 16:32:06 +0000 (16:32 +0000)]
Expand -Wlogical-not-parentheses to also fire on `!x & A`.

This is a misspelling of the intended !(x & A) negated bit test that happens in
practice every now and then.

I ran this on Chromium and all its dependencies, and it fired 0 times -- no
false or true positives, but it would've caught a bug in an in-progress change
that had to be caught by a Visual Studio warning instead.

https://reviews.llvm.org/D26035

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

8 years ago[Driver][CUDA][OpenMP] Reimplement tool selection in the driver.
Samuel Antao [Thu, 27 Oct 2016 16:29:20 +0000 (16:29 +0000)]
[Driver][CUDA][OpenMP] Reimplement tool selection in the driver.

Summary:
This creates a tool selector in the driver that replaces the existing one. The goal is to better organize the code and make the selector easier to scale, in particular in the presence of offload actions that can be collapsed.

The current implementation became more confusing when the support for offloading actions was added. This concern was expressed by Eric in http://reviews.llvm.org/D9888.

This patch does not add new testing, it preserves the existing functionality.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: whchung, guansong, mkuron, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, caomhin, arpith-jacob, carlo.bertolli

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

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

8 years ago[coroutines] Add allocation and deallocation substatements.
Gor Nishanov [Thu, 27 Oct 2016 16:28:31 +0000 (16:28 +0000)]
[coroutines] Add allocation and deallocation substatements.

Summary:
SemaCoroutine: Add allocation / deallocation substatements.
CGCoroutine/Test: Emit allocation and deallocation + test.

Reviewers: rsmith

Subscribers: ABataev, EricWF, llvm-commits, mehdi_amini

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

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

8 years agoAttempt to make clang-format.py python 3 - compatible.
Alexander Kornienko [Thu, 27 Oct 2016 15:15:23 +0000 (15:15 +0000)]
Attempt to make clang-format.py python 3 - compatible.

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

8 years agoDo not print include_next/pragma once warnings when input is a header.
Erik Verbruggen [Thu, 27 Oct 2016 14:17:10 +0000 (14:17 +0000)]
Do not print include_next/pragma once warnings when input is a header.

r276653 suppressed the pragma once warning when generating a PCH file.
This patch extends that to any main file for which clang is told (with
the -x option) that it's a header file. It will also suppress the
warning "#include_next in primary source file".

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

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

8 years agoAdd documentation for the transparent_union attribute
Alex Lorenz [Thu, 27 Oct 2016 13:51:30 +0000 (13:51 +0000)]
Add documentation for the transparent_union attribute

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

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

8 years agoFix warnings from python difflib.
Alexander Kornienko [Thu, 27 Oct 2016 13:46:49 +0000 (13:46 +0000)]
Fix warnings from python difflib.

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

8 years ago[Sema] -Wunused-variable warning for array variables should behave
Alex Lorenz [Thu, 27 Oct 2016 13:30:51 +0000 (13:30 +0000)]
[Sema] -Wunused-variable warning for array variables should behave
similarly to scalar variables.

This commit makes the -Wunused-variable warning behaviour more consistent:
Now clang won't warn for array variables where it doesn't warn for scalar
variables.

rdar://24158862

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

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

8 years agoAdd const versions of Expr::getInits() and Expr::inits()
Erik Verbruggen [Thu, 27 Oct 2016 12:12:08 +0000 (12:12 +0000)]
Add const versions of Expr::getInits() and Expr::inits()

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

8 years agoFix MSVC warning about missing 'this' from lambda default capture mode
Simon Pilgrim [Thu, 27 Oct 2016 10:51:29 +0000 (10:51 +0000)]
Fix MSVC warning about missing 'this' from lambda default capture mode

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

8 years agoEmpty the CtorLists/DtorLists once emitted.
Vassil Vassilev [Thu, 27 Oct 2016 09:12:20 +0000 (09:12 +0000)]
Empty the CtorLists/DtorLists once emitted.

This is essential when clang is running in incremental processing mode because
we don't want to reemit the 'tors over and over again.

Patch by Axel Naumann!

Reviewed by Richard Smith and me. (https://reviews.llvm.org/D25605)

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

8 years ago[Xray] Don't generate output for xray tests
Benjamin Kramer [Thu, 27 Oct 2016 08:49:18 +0000 (08:49 +0000)]
[Xray] Don't generate output for xray tests

Patch by Sam McCall!

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

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

8 years agoMark invalid RecordDecls as completed.
Erik Verbruggen [Thu, 27 Oct 2016 08:37:14 +0000 (08:37 +0000)]
Mark invalid RecordDecls as completed.

Sema::ActOnTag creates TagDecls for records. However, if those record
declarations are invalid, and the parser is in C++ mode, it would
silently drop the TagDecl (and leave it as "beingDefined"). The problem
is that other code (e.g. the ASTWriter) will serialize all types, and
expects them to be complete. So, leaving them open would result in
failing asserts.

Fixes PR20320

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

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

8 years ago[coroutines] Build fallthrough and set_exception statements.
Eric Fiselier [Thu, 27 Oct 2016 07:30:31 +0000 (07:30 +0000)]
[coroutines] Build fallthrough and set_exception statements.

Summary:
This patch adds semantic checking and building of the fall-through `co_return;` statement as well as the `p.set_exception(std::current_exception())` call for handling uncaught exceptions.

The fall-through statement is built and checked according to:
> [dcl.fct.def.coroutine]/4
> The unqualified-ids return_void and return_value are looked up in the scope of class P. If
> both are found, the program is ill-formed. If the unqualified-id return_void is found, flowing
> off the end of a coroutine is equivalent to a co_return with no operand. Otherwise, flowing off
> the end of a coroutine results in undefined behavior.

Similarly the `set_exception` call is only built when that unqualified-id is found in the scope of class P.

Additionally this patch adds fall-through warnings for non-void returning coroutines. Since it's surprising undefined behavior I thought it would be important to add the warning right away.

Reviewers: majnemer, GorNishanov, rsmith

Subscribers: mehdi_amini, cfe-commits

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

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

8 years ago[PPC] add vector byte reverse functions to altivec.h
Nemanja Ivanovic [Thu, 27 Oct 2016 06:23:57 +0000 (06:23 +0000)]
[PPC] add vector byte reverse functions to altivec.h

This patch corresponds to review https://reviews.llvm.org/D25915.
Committing on behalf of Sean Fertile.

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

8 years ago[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is...
Dean Michael Berris [Thu, 27 Oct 2016 04:56:14 +0000 (04:56 +0000)]
[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed

Summary:
Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Reviewers: rsmith, aaron.ballman, rnk, dberris

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

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

8 years agoRemove check for -o option in offloading actions builder.
Samuel Antao [Thu, 27 Oct 2016 01:08:58 +0000 (01:08 +0000)]
Remove check for -o option in offloading actions builder.

This check is also present when jobs are built, so the offloading builder check is not needed anymore.

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

8 years agoFix bug when compiling CUDA code with -emit-llvm and -o.
Samuel Antao [Thu, 27 Oct 2016 00:53:34 +0000 (00:53 +0000)]
Fix bug when compiling CUDA code with -emit-llvm and -o.

In this case the device code is not injected into an host action and therefore the
user should get an error as -o can't be used when generating two outputs.

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

8 years agoRefactor call emission to package the function pointer together with
John McCall [Wed, 26 Oct 2016 23:46:34 +0000 (23:46 +0000)]
Refactor call emission to package the function pointer together with
abstract information about the callee.  NFC.

The goal here is to make it easier to recognize indirect calls and
trigger additional logic in certain cases.  That logic will come in
a later patch; in the meantime, I felt that this was a significant
improvement to the code.

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

8 years agoUnconditionally pass `-lto_library` to the linker on Darwin
Mehdi Amini [Wed, 26 Oct 2016 23:23:08 +0000 (23:23 +0000)]
Unconditionally pass `-lto_library` to the linker on Darwin

We're only doing it with -flto currently, however it never "hurt"
to pass it, and users that are linking without -flto can get in
trouble if one of the dependency (a static library for instance)
contains bitcode.

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

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

8 years ago[analyzer] Report CFNumberGetValue API misuse
Anna Zaks [Wed, 26 Oct 2016 22:51:47 +0000 (22:51 +0000)]
[analyzer] Report CFNumberGetValue API misuse

This patch contains 2 improvements to the CFNumber checker:
 - Checking of CFNumberGetValue misuse.
 - Treating all CFNumber API misuse errors as non-fatal. (Previously we treated errors that could cause uninitialized memory as syncs and the truncation errors as non-fatal.)

This implements a subset of functionality from https://reviews.llvm.org/D17954.

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

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

8 years ago[CUDA] Move device placement new definitions into a wrapper header.
Justin Lebar [Wed, 26 Oct 2016 22:13:26 +0000 (22:13 +0000)]
[CUDA] Move device placement new definitions into a wrapper header.

Previously, these were always included -- after this change, you have to
 #include <new>, which is consistent with how things ought to work.

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

8 years ago[CUDA] Switch cuda_wrappers/complex to use a proper include guard instead of #pragma...
Justin Lebar [Wed, 26 Oct 2016 22:13:20 +0000 (22:13 +0000)]
[CUDA] Switch cuda_wrappers/complex to use a proper include guard instead of #pragma once.

This is consistent with the rest of our internal headers.

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

8 years ago[RecursiveASTVisitor] Visit the implicit expression of a CXXDefaultArgExpr
Malcolm Parsons [Wed, 26 Oct 2016 20:39:54 +0000 (20:39 +0000)]
[RecursiveASTVisitor] Visit the implicit expression of a CXXDefaultArgExpr

Summary:
The matcher
varDecl(hasDescendant(
    callExpr(hasDeclaration(functionDecl(unless(isNoThrow()))))))
didn't match calls from default arguments because the expression
for a CXXDefaultArgExpr was not visited.

Reviewers: klimek, jdennett, alexfh, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

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

8 years ago[PowerPC] Implement vector_insert_exp builtins - clang portion
Nemanja Ivanovic [Wed, 26 Oct 2016 19:27:11 +0000 (19:27 +0000)]
[PowerPC] Implement vector_insert_exp builtins - clang portion

This patch corresponds to review https://reviews.llvm.org/D25956.
Committing on behalf of Zaara Syeda.

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

8 years ago[PPC] Implement vector reverse elements builtins (vec_reve)
Nemanja Ivanovic [Wed, 26 Oct 2016 18:25:45 +0000 (18:25 +0000)]
[PPC] Implement vector reverse elements builtins (vec_reve)

This patch corresponds to review https://reviews.llvm.org/D25906.
Committing on behalf of Tony Jiang.

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

8 years agoAMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.
Yaxun Liu [Wed, 26 Oct 2016 16:40:21 +0000 (16:40 +0000)]
AMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.

Patch by Laurent Morichetti.

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

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

8 years ago[CMake] Adding example distribution CMake cache files
Chris Bieneman [Wed, 26 Oct 2016 15:41:38 +0000 (15:41 +0000)]
[CMake] Adding example distribution CMake cache files

These cache file are provided as an example of how to set up simple multi-stage CMake builds. I have a batch of documentation updates for LLVM.org which reference these files.

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

8 years ago[PP] Replace some index based for loops with range based ones
Erik Verbruggen [Wed, 26 Oct 2016 13:06:13 +0000 (13:06 +0000)]
[PP] Replace some index based for loops with range based ones

While in the area, also change some unsigned variables to size_t, and
introduce an LLVM_FALLTHROUGH instead of a comment stating that.

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

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

8 years agoFix use-after-scope in ASTContext.
Benjamin Kramer [Wed, 26 Oct 2016 12:51:45 +0000 (12:51 +0000)]
Fix use-after-scope in ASTContext.

Extend lifetime of ExceptionTypeStorage, as it is referenced by
CanonicalEPI and used outside the block (ExceptionSpec.Exceptions is an
ArrayRef)

Patch by Sam McCall!

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

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

8 years ago[PP] Remove another unused parameter
Erik Verbruggen [Wed, 26 Oct 2016 11:46:10 +0000 (11:46 +0000)]
[PP] Remove another unused parameter

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

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

8 years ago[modules] PR28812: Modules can return duplicate field decls.
Vassil Vassilev [Wed, 26 Oct 2016 10:24:29 +0000 (10:24 +0000)]
[modules] PR28812: Modules can return duplicate field decls.

If two modules contain duplicate class definitions the lookup result can contain
more than 2 elements. Sift the lookup results until we find a field decl.

It is not necessary to do ODR checks in place as they done elsewhere.

This should fix issues when compiling with libstdc++ 5.2 and 6.2.

Patch developed in collaboration with Richard Smith!

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

8 years ago[PP] Replace some uses of unsigned with size_t
Erik Verbruggen [Wed, 26 Oct 2016 09:58:31 +0000 (09:58 +0000)]
[PP] Replace some uses of unsigned with size_t

All values are returned by a method as size_t, and subsequently passed
to functions taking a size_t, or used where a size_t is also valid.
Better still, two loops (which had an unsigned), can be replaced by
a range-based for loop.

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

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

8 years agoPP: Remove unused parameters from methods
Erik Verbruggen [Wed, 26 Oct 2016 08:52:41 +0000 (08:52 +0000)]
PP: Remove unused parameters from methods

NFC

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

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

8 years agoBug 28065 - clang-format incorrectly aligns backslash.
Andi-Bogdan Postelnicu [Wed, 26 Oct 2016 07:44:51 +0000 (07:44 +0000)]
Bug 28065 - clang-format incorrectly aligns backslash.

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

8 years ago[CodeGen] Don't emit lifetime intrinsics for some local variables
Vitaly Buka [Wed, 26 Oct 2016 05:42:30 +0000 (05:42 +0000)]
[CodeGen] Don't emit lifetime intrinsics for some local variables

Summary:
Current generation of lifetime intrinsics does not handle cases like:

```
  {
    char x;
  l1:
    bar(&x, 1);
  }
  goto l1;

```
We will get code like this:

```
  %x = alloca i8, align 1
  call void @llvm.lifetime.start(i64 1, i8* nonnull %x)
  br label %l1
l1:
  %call = call i32 @bar(i8* nonnull %x, i32 1)
  call void @llvm.lifetime.end(i64 1, i8* nonnull %x)
  br label %l1
```

So the second time bar was called for x which is marked as dead.
Lifetime markers here are misleading so it's better to remove them at all.
This type of bypasses are rare, e.g. code detects just 8 functions building
clang (2329 targets).

PR28267

Reviewers: eugenis

Subscribers: beanz, mgorny, cfe-commits

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

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

8 years ago[AVX-512] Fix the operand order for all calls to __builtin_ia32_vfmaddss3_mask.
Craig Topper [Wed, 26 Oct 2016 05:35:38 +0000 (05:35 +0000)]
[AVX-512] Fix the operand order for all calls to __builtin_ia32_vfmaddss3_mask.

Summary: The preserved input should be the first argument and the vector inputs should be in the same order as the intrinsics it is used to implement.

Reviewers: igorb, delena

Subscribers: cfe-commits

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

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

8 years agoUse printf instead of "echo -ne".
Rui Ueyama [Wed, 26 Oct 2016 03:38:48 +0000 (03:38 +0000)]
Use printf instead of "echo -ne".

Not all echo commands support "-e".

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

8 years ago[modules] Fix assert if multiple update records provide a definition for a
Richard Smith [Wed, 26 Oct 2016 02:31:56 +0000 (02:31 +0000)]
[modules] Fix assert if multiple update records provide a definition for a
class template specialization and that specialization has attributes.

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

8 years ago[Sema] Handle CaseStmt and DefaultStmt as SwitchCase
Vitaly Buka [Wed, 26 Oct 2016 02:00:00 +0000 (02:00 +0000)]
[Sema] Handle CaseStmt and DefaultStmt as SwitchCase

Summary: rsmith

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

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

8 years ago[CodeGen] Move shouldEmitLifetimeMarkers into more convenient place
Vitaly Buka [Wed, 26 Oct 2016 01:59:57 +0000 (01:59 +0000)]
[CodeGen] Move shouldEmitLifetimeMarkers into more convenient place

Summary: D24693 will need access to it from other places

Reviewers: eugenis

Subscribers: cfe-commits

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

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

8 years ago[cxx_status] update comment
Richard Smith [Wed, 26 Oct 2016 01:37:36 +0000 (01:37 +0000)]
[cxx_status] update comment

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

8 years agoTreat module headers wrapped by our builtin headers as implicitly being textual
Richard Smith [Wed, 26 Oct 2016 01:08:55 +0000 (01:08 +0000)]
Treat module headers wrapped by our builtin headers as implicitly being textual
headers. We previously got this check backwards and treated the wrapper header
as being textual.

This is important because our wrapper headers sometimes inject macros into the
system headers that they #include_next, and sometimes replace them entirely.

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

8 years agoImplement name mangling proposal for exception specifications from cxx-abi-dev 2016...
Richard Smith [Wed, 26 Oct 2016 01:05:54 +0000 (01:05 +0000)]
Implement name mangling proposal for exception specifications from cxx-abi-dev 2016-10-11.

This has the following ABI impact:

 1) Functions whose parameter or return types are non-throwing function pointer
    types have different manglings in c++1z mode from prior modes. This is
    necessary because c++1z permits overloading on the noexceptness of function
    pointer parameter types. A warning is issued for cases that will change
    manglings in c++1z mode.

 2) Functions whose parameter or return types contain instantiation-dependent
    exception specifications change manglings in all modes. This is necessary
    to support overloading on / SFINAE in these exception specifications, which
    a careful reading of the standard indicates has essentially always been
    permitted.

Note that, in order to be affected by these changes, the code in question must
specify an exception specification on a function pointer/reference type that is
written syntactically within the declaration of another function. Such
declarations are very rare, and I have so far been unable to find any code
that would be affected by this. (Note that such things will probably become
more common in C++17, since it's a lot easier to get a noexcept function type
as a function parameter / return type there.)

This change does not affect the set of symbols produced by a build of clang,
libc++, or libc++abi.

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

8 years ago[Myriad] add empty file to simulated bin dir
Douglas Katzman [Tue, 25 Oct 2016 23:59:11 +0000 (23:59 +0000)]
[Myriad] add empty file to simulated bin dir

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

8 years ago[Myriad] Find libc++ adjacent to libstdc++
Douglas Katzman [Tue, 25 Oct 2016 23:02:30 +0000 (23:02 +0000)]
[Myriad] Find libc++ adjacent to libstdc++

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

8 years ago[codeview] emit debug info for indirect virtual base classes
Bob Haarman [Tue, 25 Oct 2016 22:19:32 +0000 (22:19 +0000)]
[codeview] emit debug info for indirect virtual base classes

Summary:
Fixes PR28281.

MSVC lists indirect virtual base classes in the field list of a class.
This change makes Clang emit the information necessary for LLVM to
emit such records.

Reviewers: rnk, ruiu, zturner

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

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

8 years agoUse linker flag --fix-cortex-a53-843419 on Android ARM64 compilation.
Stephen Hines [Tue, 25 Oct 2016 21:44:35 +0000 (21:44 +0000)]
Use linker flag --fix-cortex-a53-843419 on Android ARM64 compilation.

Summary:
This is only forced on if there is no non-Cortex-A53 CPU specified as
well. Android's platform and NDK builds need to assume that the code can
be run on Cortex-A53 devices, so we always enable the fix unless we know
specifically that the code is only running on a different kind of CPU.

Reviewers: cfe-commits

Subscribers: aemerson, rengolin, tberghammer, pirama, danalbert

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

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

8 years agoCodeGen: be more conservative about setting section
Saleem Abdulrasool [Tue, 25 Oct 2016 21:43:28 +0000 (21:43 +0000)]
CodeGen: be more conservative about setting section

The section names currently are MachO specific.  Only set the section on the
variables if the file format is MachO.

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

8 years ago[OpenCL] Add missing atom_xor for 64 bit to opencl-c.h
Yaxun Liu [Tue, 25 Oct 2016 21:37:05 +0000 (21:37 +0000)]
[OpenCL] Add missing atom_xor for 64 bit to opencl-c.h

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

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

8 years ago[index] Fixes for locations and relations in Objective C categories and getters/setters
Argyrios Kyrtzidis [Tue, 25 Oct 2016 21:11:22 +0000 (21:11 +0000)]
[index] Fixes for locations and relations in Objective C categories and getters/setters

- Add entries for protocols on categories
- Add relation between categories and class they extend
- Add relation between getters/setters and their corresponding property
- Use category name location as the location of category decls/defs if it has one

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

8 years agoReapply r284265: "[Sema] Refactor context checking for availability diagnostics"
Erik Pilkington [Tue, 25 Oct 2016 19:05:50 +0000 (19:05 +0000)]
Reapply r284265: "[Sema] Refactor context checking for availability diagnostics"

The problem with the original commit was that some of Apple's headers depended
on an incorrect behaviour, this commit adds a temporary workaround until those
headers are fixed.

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

8 years ago[Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10 and older
Michal Gorny [Tue, 25 Oct 2016 15:33:32 +0000 (15:33 +0000)]
[Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10 and older

Disable the OpenSUSE rules for OpenSUSE versions older than 11 as they
are incompatible with the old binutils on that distribution.

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

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

8 years ago[Driver] Support obtaining active toolchain from gcc-config on Gentoo
Michal Gorny [Tue, 25 Oct 2016 15:07:41 +0000 (15:07 +0000)]
[Driver] Support obtaining active toolchain from gcc-config on Gentoo

Support using gcc-config to determine the correct GCC toolchain location
on Gentoo. In order to do that, attempt to read gcc-config configuration
form [[sysroot]]/etc/env.d/gcc, if no custom toolchain location is
provided.

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

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

8 years agoCodeGen: mark protocols as common data
Saleem Abdulrasool [Tue, 25 Oct 2016 14:50:44 +0000 (14:50 +0000)]
CodeGen: mark protocols as common data

This allows for the coalescing of the protocol declarations.  When the protocols
are declared in headers, multiple definitions of the protocol would be emitted.
Marking them as common data indicates that any one can be selected.

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

8 years agoFix MSVC unused variable warning.
Simon Pilgrim [Tue, 25 Oct 2016 12:59:15 +0000 (12:59 +0000)]
Fix MSVC unused variable warning.

LLVM_ATTRIBUTE_UNUSED doesn't work for non-gcc style compilers.

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

8 years agoRe-apply patch r279045.
Kelvin Li [Tue, 25 Oct 2016 12:50:55 +0000 (12:50 +0000)]
Re-apply patch r279045.

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

8 years agoFix diagnostic format string for err_os_log_argument_to_big
Benjamin Kramer [Tue, 25 Oct 2016 12:39:28 +0000 (12:39 +0000)]
Fix diagnostic format string for err_os_log_argument_to_big

Patch by Sam McCall, test case by me.

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

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

8 years agoInclude full filename range for missing includes
Erik Verbruggen [Tue, 25 Oct 2016 10:13:10 +0000 (10:13 +0000)]
Include full filename range for missing includes

For the purpose of highlighting in an IDE.

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