Commit Graph

26833 Commits

Author SHA1 Message Date
Richard Smith 71d403effb [coroutines] Check for overload sets in co_yield / co_return operands being resolved by a call to yield_value / return_value before rejecting them.
llvm-svn: 253817
2015-11-22 07:33:28 +00:00
Richard Smith 4ba66602bd [coroutines] Build implicit return_value / return_void calls for co_return.
llvm-svn: 253816
2015-11-22 07:05:16 +00:00
Martell Malone 605cdb5c9c Test: Update mingw-useld.c to reflect r253813
llvm-svn: 253815
2015-11-22 05:45:03 +00:00
Richard Smith d7bed4d660 [coroutines] Factor out co_await representation into common base class for co_await and co_yield, and use it to hold await_* calls.
llvm-svn: 253811
2015-11-22 02:57:17 +00:00
Matthias Braun 5961fef32e Let's try to fix this test again with a fixed target triple
llvm-svn: 253760
2015-11-21 02:28:42 +00:00
Matthias Braun 84055ecb7d Fix c-unicode.c testcase again.
Specifying a fixed triple is not possible because that target may not
even be compiler. Go for a simpler fix by using a _? regex for the
prefix.

llvm-svn: 253758
2015-11-21 02:13:29 +00:00
Matthias Braun 5c3fccc313 Fix testcase when building on darwin
Explicitely specify a target to avoid "_" prefixes on the names.

llvm-svn: 253741
2015-11-21 00:56:41 +00:00
Vinicius Tinti 92e68c2766 [clang] Disable Unicode in asm files
Clang should not convert tokens to Unicode when preprocessing assembly
files.

Fixes PR25558.

llvm-svn: 253738
2015-11-20 23:42:39 +00:00
Richard Smith 10610f7f2f [coroutines] Better handling of placeholder types.
llvm-svn: 253731
2015-11-20 22:57:24 +00:00
Richard Smith ae3d147c91 [coroutines] Support braced-init-list as operand of co_yield expression.
llvm-svn: 253726
2015-11-20 22:47:10 +00:00
Richard Smith 23da82c5ea [coroutines] Synthesize yield_value call for co_yield.
llvm-svn: 253725
2015-11-20 22:40:06 +00:00
Peter Collingbourne 39719a77d1 Driver: Defer computation of linker path until it is needed.
This allows us to construct Linux toolchains without a valid linker. This
is needed for example to build a CUDA device toolchain after r253385.

llvm-svn: 253707
2015-11-20 20:49:39 +00:00
Bill Seurer 0d7f89d1ac Fix test case function name checks
This is similar to the earlier fix I did, r253702, expect that here it
is function names that are being searched for.  If the function name
matches part of the directory name it can cause an apparent test
case failure.

llvm-svn: 253706
2015-11-20 20:47:34 +00:00
Dehao Chen f735b8d10e Add -disable-llvm-passes for frontend debug info tests.
Summary: The frontend debuginfo tests should not invoke llvm passes which includes add-discriminators that will change the debug info generated by FE.

Reviewers: dblaikie

Subscribers: cfe-commits

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

llvm-svn: 253686
2015-11-20 18:29:01 +00:00
Reid Kleckner 43ecd7c71d [DebugInfo] Look through type sugar on union types when casting
Fixes PR25584.

llvm-svn: 253680
2015-11-20 17:41:12 +00:00
Hans Wennborg 543cb4c333 Revert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"
The patch expanded the flag *at the end*, breaking invocations like:

  clang-cl /W4 -Wno-unused-parameter

Reverting for now.

llvm-svn: 253678
2015-11-20 16:51:56 +00:00
Artyom Skrobov 1311d29527 Handle ARMv6-J as an alias, instead of fake architecture
Summary: Clang-side update, corresponding to D14755

Reviewers: rengolin, bogden, compnerd

Subscribers: aemerson, rengolin, cfe-commits

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

llvm-svn: 253677
2015-11-20 16:47:05 +00:00
Alexey Bataev 3d42f340cd [MS] Fix for bug 25013 - #pragma vtordisp is unknown inside functions, by Denis Zobnin.
This patch adds support of #pragma vtordisp inside functions in attempt to improve compatibility. Microsoft compiler appears to save the stack of vtordisp modes on entry of struct methods' bodies and restore it on exit (method-local vtordisp).
Differential Revision: http://reviews.llvm.org/D14467

llvm-svn: 253650
2015-11-20 07:02:57 +00:00
Douglas Katzman 9dc4c62681 [Myriad]: handle Preprocess job action (-E)
llvm-svn: 253647
2015-11-20 04:58:12 +00:00
Argyrios Kyrtzidis a3e2ff19e5 [libclang] Make sure to use the raw module format for libclang parsing.
Fixes crash when passing '-gmodules' in the compiler options.
rdar://23588717

llvm-svn: 253645
2015-11-20 03:36:21 +00:00
Richard Smith 744b224bb5 [coroutines] Per latest wording paper, co_* are no longer permitted in any
unevaluated operands.

llvm-svn: 253641
2015-11-20 02:54:01 +00:00
Devin Coughlin c7315b3ebf [analyzer] DeadStoresChecker: Treat locals captured by reference in C++ lambdas as escaped.
The analyzer currently reports dead store false positives when a local variable
is captured by reference in a C++ lambda.

For example:

  int local = 0; auto lambda = [&local]() {
    local++;
  };
  local = 7; // False Positive: Value stored to 'local' is never read
  lambda();

In this case, the assignment setting `local` to 7 is not a dead store because
the called lambda will later read that assigned value.

This commit silences this source of false positives by treating locals captured
by reference in C++ lambdas as escaped, similarly to how the DeadStoresChecker
deals with locals whose address is taken.

rdar://problem/22165179

llvm-svn: 253630
2015-11-20 01:53:44 +00:00
Tom Stellard d097e94abb AMDGPU: Add support for 's' and 'v' asm constraints
Summary: 's' is used to specify sgprs and 'v' is used to specify vgprs.

Reviewers: arsenm, echristo

Subscribers: cfe-commits

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

llvm-svn: 253610
2015-11-19 22:11:58 +00:00
Dehao Chen b85fc5c799 Update clang tests to accomendate discriminator changes.
Summary: The discriminator change in http://reviews.llvm.org/D14738 will fail these clang tests. Update the test to accomendate the discriminator change.

Reviewers: dblaikie, davidxl, dnovillo

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

llvm-svn: 253595
2015-11-19 19:53:16 +00:00
Hans Wennborg 2763dc29a5 clang-cl: Make /W4 imply -Wall -Wextra (PR25563)
llvm-svn: 253582
2015-11-19 17:49:59 +00:00
Alexey Bataev f278eb10b7 PR10235: support for vector mode attributes + warning, by Dmitry Polukhin.
Add support for vector mode attributes like "attribute((mode(V4SF)))". Also add warning about deprecated vector modes like GCC does.
Differential Revision: http://reviews.llvm.org/D14744

llvm-svn: 253551
2015-11-19 10:13:11 +00:00
Pete Cooper 3b39e88ae0 Revert "Change memcpy/memset/memmove to have dest and source alignments."
This reverts commit r253512.

This likely broke the bots in:
http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202
http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787

llvm-svn: 253542
2015-11-19 05:55:59 +00:00
Richard Smith 9b2f53e39e [coroutines] Tweak diagnostics to always use fully-qualified name for std::coroutine_traits.
llvm-svn: 253535
2015-11-19 02:36:35 +00:00
John McCall 00b2bbb7bb Don't actually add the __unsafe_unretained qualifier in MRC;
driving a canonical difference between that and an unqualified
type is a really bad idea when both are valid.  Instead, remember
that it was there in a non-canonical way, then look for that in
the one place we really care about it: block captures.  The net
effect closely resembles the behavior of a decl attribute, except
still closely following ARC's standard qualifier parsing rules.

llvm-svn: 253534
2015-11-19 02:28:03 +00:00
John McCall d80218fa42 Fix the emission of ARC-style ivar layouts in the fragile runtime
to start at the offset of the first ivar instead of the rounded-up
end of the superclass.  The latter could include a large amount of
tail padding because of a highly-aligned ivar, and subclass ivars
can be laid out within that.

llvm-svn: 253533
2015-11-19 02:27:55 +00:00
Anna Zaks 61fcb521fa [analyzer] Improve modeling of static initializers.
Conversions between unrelated pointer types (e.g. char * and void *) involve
bitcasts which were not properly modeled in case of static initializers. The
patch fixes this problem.

The problem was originally spotted by Artem Dergachev. Patched by Yuri Gribov!

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

llvm-svn: 253532
2015-11-19 01:25:28 +00:00
David Majnemer 70effde0af [MS ABI] Let arbitrary entities participate in vftable ordering
In the Microsoft ABI, the vftable is laid out in the order in the
declaration order of the entities defined within it.

Obviously, only virtual methods end up in the vftable but they will be
placed into the table at the same position as the first entity with the
same name.

llvm-svn: 253523
2015-11-19 00:03:54 +00:00
Devin Coughlin 6e644abd46 [analyzer] Skip checking blocks in dependent contexts.
Since we don't check functions in dependent contexts, we should skip blocks
in those contexts as well. This avoids an assertion failure when the
DeadStoresChecker attempts to evaluate an array subscript expression with
a dependent name type.

rdar://problem/23564220

llvm-svn: 253516
2015-11-18 22:46:52 +00:00
Pete Cooper 7bfd5cb7be Change memcpy/memset/memmove to have dest and source alignments.
This is a follow on from a similar LLVM commit: r253511.

Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

These intrinsics currently have an explicit alignment argument which is
required to be a constant integer.  It represents the alignment of the
source and dest, and so must be the minimum of those.

This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments.  The alignment
argument itself is removed.

The only code change to clang is hidden in CGBuilder.h which now passes
both dest and source alignment to IRBuilder, instead of taking the minimum of
dest and source alignments.

Reviewed by Hal Finkel.

llvm-svn: 253512
2015-11-18 22:18:45 +00:00
David Majnemer bee2bc3932 [MSVC Compat] Make -Wmicrosoft-cast not an error by default
Too much code is sloppy about this to error by default.

llvm-svn: 253506
2015-11-18 21:42:38 +00:00
Betul Buyukkurt 6247bed9bd [PGO] Test update for revision 253484.
llvm-svn: 253485
2015-11-18 18:15:55 +00:00
Douglas Katzman d617e44065 [Myriad]: fix test for Windows
llvm-svn: 253476
2015-11-18 17:19:47 +00:00
Bradley Smith bbf5a00de1 [ARM] Support +feature targeting in -mcpu/-march
llvm-svn: 253471
2015-11-18 16:33:48 +00:00
Douglas Katzman 674a31243b [Myriad]: insert -L paths into linker cmd only when they exist.
Differential Revision: http://reviews.llvm.org/D14754

llvm-svn: 253467
2015-11-18 16:24:46 +00:00
Igor Laevsky 27e67986af Fix tests in order for them to not fail after r252604.
Some expected attributes appear to be incorrect after 
optimizations are run and llvm will strip them. Use -O0
so that llvm will not have a chance to remove them. 

llvm-svn: 253458
2015-11-18 14:40:41 +00:00
Faisal Vali 0374bf0d07 [NFC] Change the evaluation context of a non-type default template argument from Unevaluated to ConstantEvaluated.
This patch emits a more appropriate (but still noisy) diagnostic stream when a lambda-expression is encountered within a non-type default argument. 

For e.g. template<int N = ([] { return 5; }())> int f();

As opposed to complaining that a lambda expression is not allowed in an unevaluated operand, the patch complains about the lambda being forbidden in a constant expression context (which will be allowed in C++17 now that they have been accepted by EWG, unless of course CWG or national bodies (that have so far shown no signs of concern) rise in protest) 

As I start submitting patches for constexpr lambdas (http://wg21.link/P0170R0) under C++1z (OK'd by Richard Smith at Kona), this will be one less change to make.

Thanks!

llvm-svn: 253431
2015-11-18 04:29:22 +00:00
Akira Hatanaka 8c26ea663d Produce a better diagnostic for global register variables.
Currently, when there is a global register variable in a program that
is bound to an invalid register, clang/llvm prints an error message that
is not very user-friendly.

This commit improves the diagnostic and moves the check that used to be
in the backend to Sema. In addition, it makes changes to error out if
the size of the register doesn't match the declared variable size.

e.g., volatile register int B asm ("rbp");

rdar://problem/23084219

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

llvm-svn: 253405
2015-11-18 00:15:28 +00:00
Richard Smith 752ada870d [modules] When a #include is mapped to a module import and appears somewhere
other than the top level, we issue an error. This breaks a fair amount of C++
code wrapping C libraries, where the C library is #included within a namespace
/ extern "C" combination, because the C library (probably) includes C++
standard library headers which may be within modules.

Without modules, this setup is harmless if (and *only* if) the corresponding
standard library module was already included outside the namespace, so
downgrade the error to a default-error extension in that case, so that it can
be selectively disabled for such misbehaving libraries.

llvm-svn: 253398
2015-11-17 23:32:01 +00:00
Douglas Katzman 9d40374880 [Myriad]: -nostdlib implies -nostartfiles
llvm-svn: 253390
2015-11-17 22:33:34 +00:00
Artem Belevich 8601733c1c [CUDA] Make CUDA compilation usable by default.
Currently clang requires several additional command
line options in order to enable new features needed
during CUDA compilation. This patch makes these
options default.

* Automatically include cuda_runtime.h if we've found
  a valid CUDA installation.
* Disable automatic CUDA header inclusion during unit tests.
* Added test case for command line construction.
* Enabled target overloads and relaxed call checks that are
  needed in order to include CUDA headers.
* Added CUDA-7.5 installation path to the CUDA installation search list.
* Define __CUDA__ macro to indicate CUDA compilation.

llvm-svn: 253389
2015-11-17 22:28:55 +00:00
Artem Belevich 34f481acc6 [CUDA] Detect and link with CUDA's libdevice bitcode library.
- added detection of libdevice bitcode file and API to find one appropriate for the GPU we're compiling for.
- pass additional cc1 options for linking with detected libdevice bitcode
- added -nocudalib to prevent automatic linking with libdevice
- added test cases to verify new functionality

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

llvm-svn: 253387
2015-11-17 22:28:50 +00:00
Artem Belevich fa11ab53c0 [CUDA] added include paths for both sides of CUDA compilation.
In order to compile a CUDA file clang must be able to find
include files for both both host and device.

This patch passes AuxToolchain to AddPreprocessingOptions and
uses it to add include paths for the opposite side of compilation.

We also must be able to find CUDA include files. If the driver
found CUDA installation, it adds appropriate include path
to CUDA headers. This can be disabled with '-nocudainc'.

- Added include paths for the opposite side of compilation.
- Added include paths to detected CUDA installation.
- Added -nocudainc to prevent adding CUDA include path.
- Added test cases to verify new functionality.

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

llvm-svn: 253386
2015-11-17 22:28:46 +00:00
Artem Belevich 5e2a3ecd48 [CUDA] use -aux-triple to pass target triple of opposite side of compilation
Clang needs to know target triple for both sides of compilation so that
preprocessor macros and target builtins from both sides are available.

This change augments Compilation class to carry information about
toolchains used during different CUDA compilation passes and refactors
BuildActions to use it when it constructs CUDA jobs.

Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no
longer needed.

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

llvm-svn: 253385
2015-11-17 22:28:40 +00:00
Douglas Katzman 78b37b0555 Use !hasArg with two options instead of !hasArg && !hasArg.
Thereby fixing a warning about failure to claim all args.

llvm-svn: 253372
2015-11-17 20:28:07 +00:00
Charles Li e7cbb3ed4f [Lit Test] Updated 34 Lit tests to be C++11 compatible.
Added expected diagnostics new to C++11.
Expanded RUN line to: default, C++98/03 and C++11.

llvm-svn: 253371
2015-11-17 20:25:05 +00:00