]> granicus.if.org Git - clang/log
clang
7 years ago[CUDA] Emit deferred diagnostics during Sema rather than during codegen.
Justin Lebar [Thu, 13 Oct 2016 20:52:12 +0000 (20:52 +0000)]
[CUDA] Emit deferred diagnostics during Sema rather than during codegen.

Summary:
Emitting deferred diagnostics during codegen was a hack.  It did work,
but usability was poor, both for us as compiler devs and for users.  We
don't codegen if there are any sema errors, so for users this meant that
they wouldn't see deferred errors if there were any non-deferred errors.
For devs, this meant that we had to carefully split up our tests so that
when we tested deferred errors, we didn't emit any non-deferred errors.

This change moves checking for deferred errors into Sema.  See the big
comment in SemaCUDA.cpp for an overview of the idea.

This checking adds overhead to compilation, because we have to maintain
a partial call graph.  As a result, this change makes deferred errors a
CUDA-only concept (whereas before they were a general concept).  If
anyone else wants to use this framework for something other than CUDA,
we can generalize at that time.

This patch makes the minimal set of test changes -- after this lands,
I'll go back through and do a cleanup of the tests that we no longer
have to split up.

Reviewers: rnk

Subscribers: cfe-commits, rsmith, tra

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

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

7 years agotest: attempt to repair SCEI buildbots
Saleem Abdulrasool [Thu, 13 Oct 2016 20:10:22 +0000 (20:10 +0000)]
test: attempt to repair SCEI buildbots

The tests target ARM, ensure that the ARM target is registered.

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

7 years agoCodeGen: ensure that the runtime calling convention matches
Saleem Abdulrasool [Thu, 13 Oct 2016 19:45:08 +0000 (19:45 +0000)]
CodeGen: ensure that the runtime calling convention matches

Incorrect specification of the calling convention results in UB which can cause
the code path to be eliminated.  Simplify the existing code by using the
RuntimeCall constructor in `CodeGenFunction`.

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

7 years agoSwift Calling Convention: Fix out of bounds access
Arnold Schwaighofer [Thu, 13 Oct 2016 19:19:37 +0000 (19:19 +0000)]
Swift Calling Convention: Fix out of bounds access

Use iterator instead of address of element in vector

It is not valid to access one after the last element.

rdar://28759508

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

7 years ago[CUDA] Allow static variables in __host__ __device__ functions, so long as they're...
Justin Lebar [Thu, 13 Oct 2016 18:45:17 +0000 (18:45 +0000)]
[CUDA] Allow static variables in __host__ __device__ functions, so long as they're never codegen'ed for device.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Disallow __shared__ variables in host functions.
Justin Lebar [Thu, 13 Oct 2016 18:45:13 +0000 (18:45 +0000)]
[CUDA] Disallow __shared__ variables in host functions.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIf{Device,Host}Code().
Justin Lebar [Thu, 13 Oct 2016 18:45:08 +0000 (18:45 +0000)]
[CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIf{Device,Host}Code().

Summary:
Together these let you easily create diagnostics that

 - are never emitted for host code
 - are always emitted for __device__ and __global__ functions, and
 - are emitted for __host__ __device__ functions iff these functions are
   codegen'ed.

At the moment there are only three diagnostics that need this treatment,
but I have more to add, and it's not sustainable to write code for emitting
every such diagnostic twice, and from a special wrapper in SemaCUDA.cpp.

While we're at it, don't emit the function name in
err_cuda_device_exceptions: It's not necessary to print it, and making
this work in the new framework in the face of a null value for
dyn_cast<FunctionDecl>(CurContext) isn't worth the effort.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years agoModule: emit initializers for C/ObjC after r276159.
Manman Ren [Thu, 13 Oct 2016 18:42:14 +0000 (18:42 +0000)]
Module: emit initializers for C/ObjC after r276159.

In r276159, we started to defer emitting initializers for VarDecls, but
forgot to add the initializers for non-C++ language.

rdar://28740482

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

7 years agoPass -ffunction-sections/-fdata-sections along to gold-plugin
Teresa Johnson [Thu, 13 Oct 2016 18:05:53 +0000 (18:05 +0000)]
Pass -ffunction-sections/-fdata-sections along to gold-plugin

Summary:
These options need to be passed to the plugin in order to have
an effect on LTO/ThinLTO compiles.

Reviewers: mehdi_amini, pcc

Subscribers: jfb, dschuff, mehdi_amini, cfe-commits

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

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

7 years ago[ThinLTO] Update doc to include lld (now supported).
Davide Italiano [Thu, 13 Oct 2016 17:42:38 +0000 (17:42 +0000)]
[ThinLTO] Update doc to include lld (now supported).

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

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

7 years agoAdd more 64bit swiftcall convention tests
Arnold Schwaighofer [Thu, 13 Oct 2016 17:17:36 +0000 (17:17 +0000)]
Add more 64bit swiftcall convention tests

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

7 years agoImplement MS _ReturnAddress and _AddressOfReturnAddress intrinsics
Albert Gutowski [Thu, 13 Oct 2016 16:03:42 +0000 (16:03 +0000)]
Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsics

Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

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

7 years agoGuard flag –fdenormal-fp-math with –fno-fast-math.
Sjoerd Meijer [Thu, 13 Oct 2016 13:22:01 +0000 (13:22 +0000)]
Guard flag –fdenormal-fp-math with –fno-fast-math.
This allows disabling the FP options with just one flag (-fno-fast-math).

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

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

7 years ago[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.
Artem Dergachev [Thu, 13 Oct 2016 11:41:12 +0000 (11:41 +0000)]
[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.

AST matchers are useful for the analyzer's checkers.
More patches on particular checkers shall follow.

This is the first time clang binary gets linked to ASTMatchers.
The binary size increase for the clang executable would be
+0.5% in release mode, +2% in debug mode.

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

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

7 years agoFix for PR30639: CGDebugInfo Null dereference with OpenMP array
Alexey Bataev [Thu, 13 Oct 2016 09:52:46 +0000 (09:52 +0000)]
Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
access, by Erich Keane

OpenMP creates a variable array type with a a null size-expr. The Debug
generation failed to due to this. This patch corrects the openmp
implementation, updates the tests, and adds a new one for this
condition.

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

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

7 years ago[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS
Devin Coughlin [Wed, 12 Oct 2016 23:57:05 +0000 (23:57 +0000)]
[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS

On macOS (but not iOS), if an ObjC property has no setter, the nib-loading code
for an IBOutlet is documented as directly setting the backing ivar without
retaining the value -- even if the property is 'retain'.

This resulted in false positives from the DeallocChecker for code that did not
release such ivars in -dealloc.

To avoid these false positives, treat IBOutlet ivars that back a property
without a setter as having an unknown release requirement in macOS.

rdar://problem/28507353

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

7 years agofix ms-intrinsics labels code to work with builds with assertions
Albert Gutowski [Wed, 12 Oct 2016 23:52:38 +0000 (23:52 +0000)]
fix ms-intrinsics labels code to work with builds with assertions

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

7 years agoRevert r284008. This is us to fail to instantiate static data members in some
Richard Smith [Wed, 12 Oct 2016 23:29:02 +0000 (23:29 +0000)]
Revert r284008. This is us to fail to instantiate static data members in some
cases. I'm working on reducing a testcase.

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

7 years ago[NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.
Yunzhong Gao [Wed, 12 Oct 2016 23:27:27 +0000 (23:27 +0000)]
[NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.

It seems that the doxygen description of these two intrinsics were swapped by
mistake.

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

7 years agofix regexes for label names in ms-intrinsics test
Albert Gutowski [Wed, 12 Oct 2016 22:22:34 +0000 (22:22 +0000)]
fix regexes for label names in ms-intrinsics test

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

7 years agoImplement MS _BitScan intrinsics
Albert Gutowski [Wed, 12 Oct 2016 22:01:05 +0000 (22:01 +0000)]
Implement MS _BitScan intrinsics

Summary: _BitScan intrinsics (and some others, for example _Interlocked and _bittest) are supposed to work on both ARM and x86. This is an attempt to isolate them, avoiding repeating their code or writing separate function for each builtin.

Reviewers: hans, thakis, rnk, majnemer

Subscribers: RKSimon, cfe-commits, aemerson

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

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

7 years agoRemove basic block label in test case
Arnold Schwaighofer [Wed, 12 Oct 2016 21:36:15 +0000 (21:36 +0000)]
Remove basic block label in test case

Another attempt to make a bot happy

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

7 years agoSpecify a target cpu in test case
Arnold Schwaighofer [Wed, 12 Oct 2016 20:30:24 +0000 (20:30 +0000)]
Specify a target cpu in test case

Hopefully, this makes the bots happy

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

7 years ago[NFC] Trial change to remove a redundant blank line.
Yunzhong Gao [Wed, 12 Oct 2016 19:33:33 +0000 (19:33 +0000)]
[NFC] Trial change to remove a redundant blank line.

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

7 years agoDeclare WinX86_64ABIInfo to satisfy SwiftABI info
Arnold Schwaighofer [Wed, 12 Oct 2016 18:59:24 +0000 (18:59 +0000)]
Declare WinX86_64ABIInfo to satisfy SwiftABI info

This is minimal support that allows swift's test cases on non windows platforms
to pass.

rdar://28738985

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

7 years agoDocument potential implementation of CFI in hardware.
Kostya Serebryany [Wed, 12 Oct 2016 18:33:54 +0000 (18:33 +0000)]
Document potential implementation of CFI in hardware.

Summary: Document potential implementation of CFI in hardware.

Reviewers: eugenis, pcc

Subscribers: llvm-commits

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

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

7 years agoMove x86-64 builtins from SemaChecking.cpp to BuiltinsX86_64.def
Albert Gutowski [Wed, 12 Oct 2016 17:28:44 +0000 (17:28 +0000)]
Move x86-64 builtins from SemaChecking.cpp to BuiltinsX86_64.def

Summary: Follow-up to https://reviews.llvm.org/D24598 (separating builtins for x84-64 and i386).

Reviewers: hans, thakis, rnk

Subscribers: cfe-commits

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

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

7 years agoNFC: CodeCompletionResult's constructor should take const NamedDecl
Alex Lorenz [Wed, 12 Oct 2016 15:33:35 +0000 (15:33 +0000)]
NFC: CodeCompletionResult's constructor should take const NamedDecl

CodeCompletionResult's Declaration field is a const pointer to the
NamedDecl, and thus the constructor should take a const pointer as well.

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

7 years ago[ARM] Fix - missing target-cpu in test
Javed Absar [Wed, 12 Oct 2016 12:13:55 +0000 (12:13 +0000)]
[ARM] Fix - missing target-cpu in test

Fixes an incomplete test, wherein the target-cpu name (cortex-r52) was missing.

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

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

7 years agoReinstate r283887 and r283882.
Vassil Vassilev [Wed, 12 Oct 2016 11:57:08 +0000 (11:57 +0000)]
Reinstate r283887 and r283882.

Original message:
"[modules] PR28752: Do not instantiate variable declarations which are not visible.

https://reviews.llvm.org/D24508

Patch developed in collaboration with Richard Smith!"

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

7 years ago[CodeCompletion] Show protocol properties that are accessed through qualified id
Alex Lorenz [Wed, 12 Oct 2016 11:40:15 +0000 (11:40 +0000)]
[CodeCompletion] Show protocol properties that are accessed through qualified id

This commit improves code completion for properties that are declared in
Objective-C protocols by making sure that properties show up in completions
when they are accessed through a qualified id.

rdar://24426041

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

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

7 years ago[Sema] Handle transparent_union attributes in C mode only
Alex Lorenz [Wed, 12 Oct 2016 09:36:35 +0000 (09:36 +0000)]
[Sema] Handle transparent_union attributes in C mode only

This commit marks the transparent_union attributes as C only because clang
doesn't support them in C++ mode. Prior to this commit, clang still tried to
verify these attributes in C++, leading to crashes when analyzing templated
transparent_union unions that have dependent field types. This commit ensures
that such crashes won't happen again.

As a result of this commit clang now displays a warning every time it encounters
a transparent_union attribute in C++ mode.

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

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

7 years agoAdded REQUIRED triples to the test that fails on some ARM buildbots.
Artem Belevich [Wed, 12 Oct 2016 02:08:08 +0000 (02:08 +0000)]
Added REQUIRED triples to the test that fails on some ARM buildbots.

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

7 years ago[CUDA] Make touching a kernel from a __host__ __device__ function a deferred error.
Justin Lebar [Wed, 12 Oct 2016 01:30:08 +0000 (01:30 +0000)]
[CUDA] Make touching a kernel from a __host__ __device__ function a deferred error.

Previously, this was an immediate, don't pass go, don't collect $200
error.  But this precludes us from writing code like

  __host__ __device__ void launch_kernel() {
    kernel<<<...>>>();
  }

Such code isn't wrong, following our notions of right and wrong in CUDA,
unless it's codegen'ed.

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

7 years agoRevert - When optimizing for size, enable loop rerolling by default
Mike Edwards [Tue, 11 Oct 2016 22:09:13 +0000 (22:09 +0000)]
Revert - When optimizing for size, enable loop rerolling by default

This reverts r283685 as it is causing test failures on Green Dragon.

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

7 years ago[Profile] Update testcase for r283948 (NFC)
Vedant Kumar [Tue, 11 Oct 2016 21:56:05 +0000 (21:56 +0000)]
[Profile] Update testcase for r283948 (NFC)

Old: "__DATA,__llvm_prf_data"
New: "__DATA,__llvm_prf_data,regular,live_support"

This should fix the following bot failure:

  http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55158

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

7 years agoModule: for ObjectiveC, be consistent when checking hidden decls.
Manman Ren [Tue, 11 Oct 2016 21:18:20 +0000 (21:18 +0000)]
Module: for ObjectiveC, be consistent when checking hidden decls.

In MatchAllMethodDeclarations, when checking a hidden decl, be sure
to allow hidden when searching for methods.

rdar://28699972

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

7 years agoSwift Calling Convention: Parameters are allowed after the
Arnold Schwaighofer [Tue, 11 Oct 2016 20:34:06 +0000 (20:34 +0000)]
Swift Calling Convention: Parameters are allowed after the
swift_error/swift_context parameter

We need to be able to decelare witness functions which append the self type and
the self witness tables at the end of the parameter list.

rdar://28720996

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

7 years agoPass the end of a component to SwiftAggLowering's enumerateComponents callback
Arnold Schwaighofer [Tue, 11 Oct 2016 20:34:03 +0000 (20:34 +0000)]
Pass the end of a component to SwiftAggLowering's enumerateComponents callback

This is usefull for determining whether components overlap.

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

7 years agoRevert "Change Builtins name to be stored as StringRef instead of raw pointers (NFC)"
Mehdi Amini [Tue, 11 Oct 2016 19:04:24 +0000 (19:04 +0000)]
Revert "Change Builtins name to be stored as StringRef instead of raw pointers (NFC)"

This reverts commit r283802. It introduces temporarily static
initializers, because StringRef ctor isn't (yet) constexpr for
string literals.
I plan to get there this week, but apparently GCC is so terrible
with these static initializer right now (10 min+ extra codegen
time was reported) that I'll hold on to this patch till the
constexpr one is ready, and land these at the same time.

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

7 years ago[Driver] Use -fsyntax-only in test/Driver/show-option-names.c
Bruno Cardoso Lopes [Tue, 11 Oct 2016 18:38:33 +0000 (18:38 +0000)]
[Driver] Use -fsyntax-only in test/Driver/show-option-names.c

Make the test less expensive, follow up from r283915.

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

7 years ago[Driver] Fix test from r283913 to unbreak bots
Bruno Cardoso Lopes [Tue, 11 Oct 2016 18:31:45 +0000 (18:31 +0000)]
[Driver] Fix test from r283913 to unbreak bots

Followup from r283913 & r283827

http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55135

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

7 years agoReapply [Driver][Diagnostics] Make 'show option names' default for driver warnings
Bruno Cardoso Lopes [Tue, 11 Oct 2016 18:21:26 +0000 (18:21 +0000)]
Reapply [Driver][Diagnostics] Make 'show option names' default for driver warnings

Reapply r283827 by fixing the tests to not be target specific

Currently, driver level warnings do not show option names (e.g. warning:
complain about foo [-Woption-name]) in a diagnostic unless
-fdiagnostics-show-option is explictly specified. OTOH, the driver by
default turn this option on for CC1. Change the logic to show option
names by default in the driver as well.

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

rdar://problem/27300909

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

7 years ago[CUDA] Re-land support for <complex> (r283683 and r283680).
Justin Lebar [Tue, 11 Oct 2016 17:36:03 +0000 (17:36 +0000)]
[CUDA] Re-land support for <complex> (r283683 and r283680).

These were reverted in r283753 and r283747.

The first patch added a header to the root 'Headers' install directory,
instead of into 'Headers/cuda_wrappers'.  This was fixed in the second
patch, but by then the damage was done: The bad header stayed in the
'Headers' directory, continuing to break the build.

We reverted both patches in an attempt to fix things, but that still
didn't get rid of the header, so the Windows boostrap build remained
broken.

It's probably worth fixing up our cmake logic to remove things from the
install dirs, but in the meantime, re-land these patches, since we
believe they no longer have this bug.

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

7 years agoFix the build with MSVC 2013 after r283856
Reid Kleckner [Tue, 11 Oct 2016 17:24:09 +0000 (17:24 +0000)]
Fix the build with MSVC 2013 after r283856

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

7 years agoFix clang-offload-bundler test.
Zachary Turner [Tue, 11 Oct 2016 16:06:32 +0000 (16:06 +0000)]
Fix clang-offload-bundler test.

A recent change to llvm::cl slightly changed the format of
the help output, and it broke this test.  NFC

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

7 years ago[OpenCL] Allow partial initializer for array and struct
Yaxun Liu [Tue, 11 Oct 2016 15:53:28 +0000 (15:53 +0000)]
[OpenCL] Allow partial initializer for array and struct

Currently Clang allows partial initializer for C99 but not for OpenCL, e.g.

float a[16][16] = {1.0f, 2.0f};

is allowed in C99 but not allowed in OpenCL.

This patch fixes that.

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

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

7 years agoRevert r283887 and r283882, until the issue is understood and fixed.
Vassil Vassilev [Tue, 11 Oct 2016 15:51:06 +0000 (15:51 +0000)]
Revert r283887 and r283882, until the issue is understood and fixed.

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

7 years agoUse StringRef instead of raw pointer in SourceManagerInternals LineTableInfo API...
Mehdi Amini [Tue, 11 Oct 2016 15:15:32 +0000 (15:15 +0000)]
Use StringRef instead of raw pointer in SourceManagerInternals LineTableInfo API (NFC)

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

7 years agor283882 followup. Don't demote ParmVarDecls. This should fix our module builds.
Vassil Vassilev [Tue, 11 Oct 2016 15:09:26 +0000 (15:09 +0000)]
r283882 followup. Don't demote ParmVarDecls. This should fix our module builds.

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

7 years ago[modules] PR28752: Do not instantiate variable declarations which are not visible.
Vassil Vassilev [Tue, 11 Oct 2016 13:57:36 +0000 (13:57 +0000)]
[modules] PR28752: Do not instantiate variable declarations which are not visible.

https://reviews.llvm.org/D24508

Patch developed in collaboration with Richard Smith!

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

7 years agoRevert "[Driver][Diagnostics] Make 'show option names' default for driver warnings"
Renato Golin [Tue, 11 Oct 2016 10:26:33 +0000 (10:26 +0000)]
Revert "[Driver][Diagnostics] Make 'show option names' default for driver warnings"

This reverts commit r283827, as it's breaking all ARM/AARch64 bots.

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

7 years agoDelete clang-completion-mode.el.
Manuel Klimek [Tue, 11 Oct 2016 09:25:34 +0000 (09:25 +0000)]
Delete clang-completion-mode.el.

It has been unmaintained for a while (last change was more than four
years ago), and it appears not widely used.
By now there are multiple well-maintained alternatives (emacs-ycmd,
atuo-complete-clang), and if users try to make this work they'll likely
have a bad user experience.

Reasoning and problems pointed out by Philipp Stephani.

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

7 years agoTurn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
Mehdi Amini [Tue, 11 Oct 2016 07:31:29 +0000 (07:31 +0000)]
Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)

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

7 years agoExplicitly ignore return code in test for test systems that use pipefail
Daniel Jasper [Tue, 11 Oct 2016 06:13:18 +0000 (06:13 +0000)]
Explicitly ignore return code in test for test systems that use pipefail

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

7 years agoFixup test/Driver/opt-record.c for nvptx pointer size
Hal Finkel [Tue, 11 Oct 2016 01:05:45 +0000 (01:05 +0000)]
Fixup test/Driver/opt-record.c for nvptx pointer size

On some systems, it looks like nvptx is used instead of nvptx64.

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

7 years agoAdd an option to save the backend-produced YAML optimization record to a file
Hal Finkel [Tue, 11 Oct 2016 00:26:09 +0000 (00:26 +0000)]
Add an option to save the backend-produced YAML optimization record to a file

The backend now has the capability to save information from optimizations, the
same information that can be used to generate optimization diagnostics but in
machine-consumable form, into an output file. This can be enabled when using
opt (see r282539), and this change enables it when using clang. The idea is
that other tools will be able to consume these files, and perhaps in
combination with the original source code, produce various kinds of
optimization reports for users (and for compiler developers).

We now have at-least two tools that can consume these files:
  * tools/llvm-opt-report
  * utils/opt-viewer

Using the flag -fsave-optimization-record will cause the YAML file to be
generated; the file name will be based on the output file name (if we're using
-c or -S and have an output name), or the input file name. When we're using
CUDA, or some other offloading mechanism, separate files are generated for each
backend target. The output file name can be specified by the user using
-foptimization-record-file=filename.

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

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

7 years ago[Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.
Justin Lebar [Tue, 11 Oct 2016 00:23:53 +0000 (00:23 +0000)]
[Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.

This is needed to keep MSVC 2013 happy.

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

7 years agoAligned allocation versus CUDA: make deallocation function preference order
Richard Smith [Tue, 11 Oct 2016 00:21:10 +0000 (00:21 +0000)]
Aligned allocation versus CUDA: make deallocation function preference order
match other CUDA preference orders, per discussion with jlebar. We now model
this in an attempt to match overload resolution as closely as possible:

- First, we throw out all non-callable (due to CUDA host/device mismatch)
  operator delete functions.
- Then we apply sizedness / alignedness preferences based on whether the type
  is overaligned and whether the deallocation function is a member.
- Finally, we use the CUDA callability preference as a tiebreaker.

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

7 years ago[Driver][Diagnostics] Make 'show option names' default for driver warnings
Bruno Cardoso Lopes [Tue, 11 Oct 2016 00:01:22 +0000 (00:01 +0000)]
[Driver][Diagnostics] Make 'show option names' default for driver warnings

Currently, driver level warnings do not show option names (e.g. warning:
complain about foo [-Woption-name]) in a diagnostic unless
-fdiagnostics-show-option is explictly specified. OTOH, the driver by
default turn this option on for CC1. Change the logic to show option
names by default in the driver as well.

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

rdar://problem/27300909

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

7 years agoStore FileEntry::Filename as a StringRef instead of raw pointer (NFC)
Mehdi Amini [Mon, 10 Oct 2016 22:52:47 +0000 (22:52 +0000)]
Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)

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

7 years ago[Driver] Let -gline-tables-only win when it comes after -gmodules.
Adrian Prantl [Mon, 10 Oct 2016 21:56:20 +0000 (21:56 +0000)]
[Driver] Let -gline-tables-only win when it comes after -gmodules.
The -gmodules option is all about putting debug type info into clang
modules and for line tables the type information is irrelevant, so
combining these two options makes no sense.
This commmit fixes the behavior to match the one  documented on the
clang man page: the last -g... option wins.

<rdar://problem/27059770>

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

7 years agoChange Builtins name to be stored as StringRef instead of raw pointers (NFC)
Mehdi Amini [Mon, 10 Oct 2016 21:34:29 +0000 (21:34 +0000)]
Change Builtins name to be stored as StringRef instead of raw pointers (NFC)

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

7 years agoAdd -fno-sanitize-address-use-after-scope flag
Vitaly Buka [Mon, 10 Oct 2016 21:31:50 +0000 (21:31 +0000)]
Add -fno-sanitize-address-use-after-scope flag

Reviewers: eugenis

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

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

7 years agoMake the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the...
Nick Lewycky [Mon, 10 Oct 2016 20:07:13 +0000 (20:07 +0000)]
Make the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the LValue as the QualType in the LValue. No functionality change intended.

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

7 years agoImplement MS read/write barriers and __faststorefence intrinsic
Albert Gutowski [Mon, 10 Oct 2016 19:40:51 +0000 (19:40 +0000)]
Implement MS read/write barriers and __faststorefence intrinsic

Reviewers: hans, rnk, majnemer

Subscribers: cfe-commits

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

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

7 years ago[AST] Don't use make_pointee_iterator in VTableBuilder.
Justin Lebar [Mon, 10 Oct 2016 19:26:22 +0000 (19:26 +0000)]
[AST] Don't use make_pointee_iterator in VTableBuilder.

Our implementation of make_pointee_iterator seems to be causing MSVC
2015 to crash, so I'm going to remove it.

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

7 years agoRe-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of
Richard Smith [Mon, 10 Oct 2016 18:54:32 +0000 (18:54 +0000)]
Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of
past-the-end iterator.

Original commit message:

P0035R4: Semantic analysis and code generation for C++17 overaligned
allocation.

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

7 years agoImplement __emul, __emulu, _mul128 and _umul128 MS intrinsics
Albert Gutowski [Mon, 10 Oct 2016 18:09:27 +0000 (18:09 +0000)]
Implement __emul, __emulu, _mul128 and _umul128 MS intrinsics

Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

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

7 years ago[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.
Justin Lebar [Mon, 10 Oct 2016 16:41:00 +0000 (16:41 +0000)]
[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.

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

7 years agoUse StringRef in LangOptions::isNoBuiltinFunc API (NFC)
Mehdi Amini [Mon, 10 Oct 2016 16:34:07 +0000 (16:34 +0000)]
Use StringRef in LangOptions::isNoBuiltinFunc API (NFC)

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

7 years ago[Analysis] Use unique_ptr for CallGraph::FunctionMap.
Justin Lebar [Mon, 10 Oct 2016 16:26:48 +0000 (16:26 +0000)]
[Analysis] Use unique_ptr for CallGraph::FunctionMap.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years ago[Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.
Justin Lebar [Mon, 10 Oct 2016 16:26:44 +0000 (16:26 +0000)]
[Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years ago[AST] Convert Marshallers to use unique_ptr.
Justin Lebar [Mon, 10 Oct 2016 16:26:40 +0000 (16:26 +0000)]
[AST] Convert Marshallers to use unique_ptr.

Reviewers: timshen

Subscribers: cfe-commits, klimek

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

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

7 years agoUse unique_ptr for VTableBuilder::VBaseInfo map.
Justin Lebar [Mon, 10 Oct 2016 16:26:36 +0000 (16:26 +0000)]
Use unique_ptr for VTableBuilder::VBaseInfo map.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years agoUse unique_ptr for VTableBuilder::VFTableLayouts map.
Justin Lebar [Mon, 10 Oct 2016 16:26:33 +0000 (16:26 +0000)]
Use unique_ptr for VTableBuilder::VFTableLayouts map.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years agoUse unique_ptr for VPtrLocationsMap and VPtrInfoVector.
Justin Lebar [Mon, 10 Oct 2016 16:26:29 +0000 (16:26 +0000)]
Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years ago[AST] Use unique_ptr for VTableLayout.
Justin Lebar [Mon, 10 Oct 2016 16:26:24 +0000 (16:26 +0000)]
[AST] Use unique_ptr for VTableLayout.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years ago[AST] Convert MangleNumberingContext to a unique_ptr.
Justin Lebar [Mon, 10 Oct 2016 16:26:19 +0000 (16:26 +0000)]
[AST] Convert MangleNumberingContext to a unique_ptr.

Summary: It doesn't need to be refcounted anymore, either.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years ago[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.
Justin Lebar [Mon, 10 Oct 2016 16:26:08 +0000 (16:26 +0000)]
[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.

Summary:
This is possible now that MapVector supports move-only values.

Depends on D25404.

Reviewers: timshen

Subscribers: cfe-commits

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

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

7 years ago[Sema] Prevent using member declaration diagnostic if the base class is invalid.
Eric Fiselier [Mon, 10 Oct 2016 14:26:40 +0000 (14:26 +0000)]
[Sema] Prevent using member declaration diagnostic if the base class is invalid.

Summary:
Once a base class has been made invalid (by a static_assert for example) all using-member declarations in the derived classes will result in a "not a base class" diagnostic. This diagnostic is very misleading and should not be emitted.

This change is needed to help libc++ produce reasonable diagnostics in `std::optional` and `std::variant`.

Reviewers: rsmith, majnemer, aaron.ballman

Subscribers: cfe-commits

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

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

7 years agoRevert r283683 because r283680 got reverted.
Nico Weber [Mon, 10 Oct 2016 14:20:35 +0000 (14:20 +0000)]
Revert r283683 because r283680 got reverted.

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

7 years agoRevert "P0035R4: Semantic analysis and code generation for C++17 overaligned allocation."
Daniel Jasper [Mon, 10 Oct 2016 14:13:55 +0000 (14:13 +0000)]
Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned allocation."

This reverts commit r283722. Breaks:
  Clang.SemaCUDA.device-var-init.cu
  Clang.CodeGenCUDA.device-var-init.cu

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/

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

7 years agoRevert r283680.
Nico Weber [Mon, 10 Oct 2016 14:10:00 +0000 (14:10 +0000)]
Revert r283680.

Breaks bootstrap builds on (at least) Windows:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\lib\Support\Allocator.cpp:14:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/Allocator.h:24:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/ADT/SmallVector.h:20:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/MathExtras.h:19:
D:\buildslave\clang-x64-ninja-win7\stage1.install\bin\..\lib\clang\4.0.0\include\algorithm(63,8) :
    error: unknown type name '__device__'
    inline __device__ const __T &

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

7 years ago[Driver] Make -print-libgcc-file-name print compiler-rt lib when used
Michal Gorny [Mon, 10 Oct 2016 12:23:40 +0000 (12:23 +0000)]
[Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.

The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:

  clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)

in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.

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

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

7 years agoRevert "[x86][inline-asm][clang] accept 'v' constraint"
Daniel Jasper [Mon, 10 Oct 2016 11:40:28 +0000 (11:40 +0000)]
Revert "[x86][inline-asm][clang] accept 'v' constraint"

This reverts commit r283716.

Breaks buildbot:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/9155/testReport/junit/Clang/CodeGen/x86_inline_asm_v_constraint_c/

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

7 years agoFix style issue. Spaces in argument list.
Daniel Marjamaki [Mon, 10 Oct 2016 07:39:39 +0000 (07:39 +0000)]
Fix style issue. Spaces in argument list.

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

7 years agoMark aligned allocation as done.
Richard Smith [Mon, 10 Oct 2016 06:55:42 +0000 (06:55 +0000)]
Mark aligned allocation as done.

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

7 years agoP0035R4: Semantic analysis and code generation for C++17 overaligned
Richard Smith [Mon, 10 Oct 2016 06:42:31 +0000 (06:42 +0000)]
P0035R4: Semantic analysis and code generation for C++17 overaligned
allocation.

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

7 years ago[x86][inline-asm][clang] accept 'v' constraint
Michael Zuckerman [Mon, 10 Oct 2016 05:45:54 +0000 (05:45 +0000)]
[x86][inline-asm][clang] accept 'v' constraint

Commit in the name of: Coby Tayree

1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64).
2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent)

This patch applies the needed changes to clang
 LLVM patch: https://reviews.llvm.org/D25005

Differential Revision: D25004

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

7 years agoWhen optimizing for size, enable loop rerolling by default
Hal Finkel [Sun, 9 Oct 2016 03:06:31 +0000 (03:06 +0000)]
When optimizing for size, enable loop rerolling by default

We have a loop-rerolling optimization which can be enabled by using
-freroll-loops. While sometimes loops are hand-unrolled for performance
reasons, when optimizing for size, we should always undo this manual
optimization to produce smaller code (our optimizer's unroller will still
unroll the rerolled loops if it thinks that is a good idea).

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

7 years ago[CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir.
Justin Lebar [Sun, 9 Oct 2016 00:27:39 +0000 (00:27 +0000)]
[CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir.

This is obviously wrong -- if we do this, then all compiles will pick up
these wrappers, which is not what we want.

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

7 years ago[CUDA] Support <complex> and std::min/max on the device.
Justin Lebar [Sat, 8 Oct 2016 22:16:12 +0000 (22:16 +0000)]
[CUDA] Support <complex> and std::min/max on the device.

Summary:
We do this by wrapping <complex> and <algorithm>.

Tests are in the test-suite.

Reviewers: tra

Subscribers: jhen, beanz, cfe-commits, mgorny

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

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

7 years ago[CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.
Justin Lebar [Sat, 8 Oct 2016 22:16:08 +0000 (22:16 +0000)]
[CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

Summary: This matches the idiom we use for our other CUDA wrapper headers.

Reviewers: tra

Subscribers: beanz, mgorny, cfe-commits

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

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

7 years ago[CUDA] Declare our __device__ math functions in the same inline namespace as our...
Justin Lebar [Sat, 8 Oct 2016 22:16:03 +0000 (22:16 +0000)]
[CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

Summary:
Currently we declare our inline __device__ math functions in namespace
std.  But libstdc++ and libc++ declare these functions in an inline
namespace inside namespace std.  We need to match this because, in a
later patch, we want to get e.g. <complex> to use our device overloads,
and it only will if those overloads are in the right inline namespace.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

7 years ago[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.
Justin Lebar [Sat, 8 Oct 2016 22:15:58 +0000 (22:15 +0000)]
[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.

Summary:
These cause us to consider all functions in-between to be __host__
__device__.

You can nest these pragmas; you just can't have more 'end's than
'begin's.

Reviewers: rsmith

Subscribers: tra, jhen, cfe-commits

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

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

7 years agoTurn cl::values() (for enum) from a vararg function to using C++ variadic template
Mehdi Amini [Sat, 8 Oct 2016 19:41:06 +0000 (19:41 +0000)]
Turn cl::values() (for enum) from a vararg function to using C++ variadic template

The core of the change is supposed to be NFC, however it also fixes
what I believe was an undefined behavior when calling:

 va_start(ValueArgs, Desc);

with Desc being a StringRef.

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

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

7 years ago[analyzer] Fix build error after r283660 - remove constexpr strings.
Artem Dergachev [Sat, 8 Oct 2016 11:07:21 +0000 (11:07 +0000)]
[analyzer] Fix build error after r283660 - remove constexpr strings.

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

7 years ago[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"
Artem Dergachev [Sat, 8 Oct 2016 10:54:30 +0000 (10:54 +0000)]
[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"

The parent commit (r283092) was reverted before and now finally landed.

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

7 years ago[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"
Artem Dergachev [Sat, 8 Oct 2016 10:53:00 +0000 (10:53 +0000)]
[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"

The parent commit (r283092) was reverted before and now finally landed.

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