Commit Graph

65753 Commits

Author SHA1 Message Date
Justin Lebar 44f547aa3f [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

llvm-svn: 284145
2016-10-13 18:45:17 +00:00
Justin Lebar aa370bd0d7 [CUDA] Disallow __shared__ variables in host functions.
Reviewers: tra, rnk

Subscribers: cfe-commits

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

llvm-svn: 284144
2016-10-13 18:45:13 +00:00
Justin Lebar 179bdce72a [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

llvm-svn: 284143
2016-10-13 18:45:08 +00:00
Manman Ren aa0178e57a 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

llvm-svn: 284142
2016-10-13 18:42:14 +00:00
Teresa Johnson 9c6e5566dd 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

llvm-svn: 284140
2016-10-13 18:05:53 +00:00
Davide Italiano 02c3e8cb7d [ThinLTO] Update doc to include lld (now supported).
Differential Revision:  https://reviews.llvm.org/D25537

llvm-svn: 284137
2016-10-13 17:42:38 +00:00
Arnold Schwaighofer 2d556f2d06 Add more 64bit swiftcall convention tests
llvm-svn: 284133
2016-10-13 17:17:36 +00:00
Albert Gutowski 397d81bb9a Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsics
Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

llvm-svn: 284131
2016-10-13 16:03:42 +00:00
Sjoerd Meijer ee3c7e0d42 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

llvm-svn: 284121
2016-10-13 13:22:01 +00:00
Artem Dergachev bb51662d8d [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

llvm-svn: 284112
2016-10-13 11:41:12 +00:00
Alexey Bataev 2f5ed34279 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

llvm-svn: 284110
2016-10-13 09:52:46 +00:00
Devin Coughlin 0bd37a1a36 [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

llvm-svn: 284084
2016-10-12 23:57:05 +00:00
Albert Gutowski 1255c19656 fix ms-intrinsics labels code to work with builds with assertions
llvm-svn: 284083
2016-10-12 23:52:38 +00:00
Richard Smith 88d10b68e0 Revert r284008. This is us to fail to instantiate static data members in some
cases. I'm working on reducing a testcase.

llvm-svn: 284081
2016-10-12 23:29:02 +00:00
Yunzhong Gao d9fa56a4fb [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.

llvm-svn: 284080
2016-10-12 23:27:27 +00:00
Albert Gutowski 85d54d6bcb fix regexes for label names in ms-intrinsics test
llvm-svn: 284062
2016-10-12 22:22:34 +00:00
Albert Gutowski 2a0621e58a 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

llvm-svn: 284060
2016-10-12 22:01:05 +00:00
Arnold Schwaighofer b574b07564 Remove basic block label in test case
Another attempt to make a bot happy

llvm-svn: 284055
2016-10-12 21:36:15 +00:00
Arnold Schwaighofer bcb927a2ad Specify a target cpu in test case
Hopefully, this makes the bots happy

llvm-svn: 284048
2016-10-12 20:30:24 +00:00
Yunzhong Gao c37e2231ad [NFC] Trial change to remove a redundant blank line.
llvm-svn: 284033
2016-10-12 19:33:33 +00:00
Arnold Schwaighofer 4fc955e669 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

llvm-svn: 284032
2016-10-12 18:59:24 +00:00
Kostya Serebryany d2775ec8de 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

llvm-svn: 284029
2016-10-12 18:33:54 +00:00
Albert Gutowski 0fd6e9608e 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

llvm-svn: 284026
2016-10-12 17:28:44 +00:00
Alex Lorenz 84ebbdaf40 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.

llvm-svn: 284019
2016-10-12 15:33:35 +00:00
Javed Absar c7d16f4e05 [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

llvm-svn: 284009
2016-10-12 12:13:55 +00:00
Vassil Vassilev bb8fe3175a 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!"

llvm-svn: 284008
2016-10-12 11:57:08 +00:00
Alex Lorenz 06cfa99268 [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

llvm-svn: 284007
2016-10-12 11:40:15 +00:00
Alex Lorenz 757a69b760 [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

llvm-svn: 283995
2016-10-12 09:36:35 +00:00
Artem Belevich 89997ecd8f Added REQUIRED triples to the test that fails on some ARM buildbots.
llvm-svn: 283964
2016-10-12 02:08:08 +00:00
Justin Lebar 0254c46300 [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.

llvm-svn: 283963
2016-10-12 01:30:08 +00:00
Mike Edwards f4bab7eb66 Revert - When optimizing for size, enable loop rerolling by default
This reverts r283685 as it is causing test failures on Green Dragon.

llvm-svn: 283950
2016-10-11 22:09:13 +00:00
Vedant Kumar f1ccf72d38 [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

llvm-svn: 283949
2016-10-11 21:56:05 +00:00
Manman Ren a58f92f09d 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

llvm-svn: 283943
2016-10-11 21:18:20 +00:00
Arnold Schwaighofer 5bb08d8f5a 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

llvm-svn: 283933
2016-10-11 20:34:06 +00:00
Arnold Schwaighofer 5d2c510cf6 Pass the end of a component to SwiftAggLowering's enumerateComponents callback
This is usefull for determining whether components overlap.

llvm-svn: 283932
2016-10-11 20:34:03 +00:00
Mehdi Amini 7186a4323e 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.

llvm-svn: 283920
2016-10-11 19:04:24 +00:00
Bruno Cardoso Lopes c9fb1ff192 [Driver] Use -fsyntax-only in test/Driver/show-option-names.c
Make the test less expensive, follow up from r283915.

llvm-svn: 283917
2016-10-11 18:38:33 +00:00
Bruno Cardoso Lopes b81cf735c3 [Driver] Fix test from r283913 to unbreak bots
Followup from r283913 & r283827

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

llvm-svn: 283915
2016-10-11 18:31:45 +00:00
Bruno Cardoso Lopes 76952a76e5 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

llvm-svn: 283913
2016-10-11 18:21:26 +00:00
Justin Lebar 49ec14692a [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.

llvm-svn: 283907
2016-10-11 17:36:03 +00:00
Reid Kleckner 25717350e5 Fix the build with MSVC 2013 after r283856
llvm-svn: 283906
2016-10-11 17:24:09 +00:00
Zachary Turner 3c8609278b 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

llvm-svn: 283895
2016-10-11 16:06:32 +00:00
Yaxun Liu a91da4ba47 [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

llvm-svn: 283891
2016-10-11 15:53:28 +00:00
Vassil Vassilev f6b491041f Revert r283887 and r283882, until the issue is understood and fixed.
llvm-svn: 283890
2016-10-11 15:51:06 +00:00
Mehdi Amini 1c9ff96668 Use StringRef instead of raw pointer in SourceManagerInternals LineTableInfo API (NFC)
llvm-svn: 283888
2016-10-11 15:15:32 +00:00
Vassil Vassilev a9903747e8 r283882 followup. Don't demote ParmVarDecls. This should fix our module builds.
llvm-svn: 283887
2016-10-11 15:09:26 +00:00
Vassil Vassilev 4b3e7388d1 [modules] PR28752: Do not instantiate variable declarations which are not visible.
https://reviews.llvm.org/D24508

Patch developed in collaboration with Richard Smith!

llvm-svn: 283882
2016-10-11 13:57:36 +00:00
Renato Golin 93d683fc2e Revert "[Driver][Diagnostics] Make 'show option names' default for driver warnings"
This reverts commit r283827, as it's breaking all ARM/AARch64 bots.

llvm-svn: 283868
2016-10-11 10:26:33 +00:00
Manuel Klimek a5cf51f2dc 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.

llvm-svn: 283864
2016-10-11 09:25:34 +00:00
Mehdi Amini 0df59d8c02 Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
llvm-svn: 283856
2016-10-11 07:31:29 +00:00