]> granicus.if.org Git - clang/log
clang
8 years agoFix clang-format test. I believe that the new behavior is better.
Daniel Jasper [Mon, 23 Nov 2015 08:50:52 +0000 (08:50 +0000)]
Fix clang-format test. I believe that the new behavior is better.

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

8 years agoclang-format: Make moving of the Cursor work properly when sorting #includes.
Daniel Jasper [Mon, 23 Nov 2015 08:36:35 +0000 (08:36 +0000)]
clang-format: Make moving of the Cursor work properly when sorting #includes.

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

8 years agoFix calculation of shifted cursor/code positions. Specifically support
Daniel Jasper [Mon, 23 Nov 2015 08:33:48 +0000 (08:33 +0000)]
Fix calculation of shifted cursor/code positions. Specifically support
the case where a specific range is replaced by new text. Previously,
the calculation would shift any position from within a replaced region
to the first character after the region. This is undersirable, e.g. for
clang-format's include sorting.

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

8 years agoOpenMPClause.h: Fix typos. [-Wdocumentation]
NAKAMURA Takumi [Mon, 23 Nov 2015 06:41:50 +0000 (06:41 +0000)]
OpenMPClause.h: Fix typos. [-Wdocumentation]

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

8 years ago[Driver] Mark isForDiagnostics as const. NFC.
Vedant Kumar [Mon, 23 Nov 2015 06:40:49 +0000 (06:40 +0000)]
[Driver] Mark isForDiagnostics as const. NFC.

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

8 years agoRevert r253846 (build bot failure))
Xinliang David Li [Mon, 23 Nov 2015 05:41:05 +0000 (05:41 +0000)]
Revert r253846 (build bot failure))

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

8 years ago[OpenMP] Parsing and sema support for map clause - add test case
Kelvin Li [Mon, 23 Nov 2015 05:36:37 +0000 (05:36 +0000)]
[OpenMP] Parsing and sema support for map clause - add test case

http://reviews.llvm.org/D14134

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

8 years ago[OpenMP] Parsing and sema support for map clause
Kelvin Li [Mon, 23 Nov 2015 05:32:03 +0000 (05:32 +0000)]
[OpenMP] Parsing and sema support for map clause

http://reviews.llvm.org/D14134

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

8 years agoDisable frame pointer elimination when using -pg
Xinliang David Li [Mon, 23 Nov 2015 05:09:10 +0000 (05:09 +0000)]
Disable frame pointer elimination when using -pg

This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives
an error if -fomit-frame-pointer is used in combination
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend
when -pg is set.

Patch by Stefan Kempf.

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

8 years ago[MS ABI] Tolerate invokes of __RTDynamicCast
David Majnemer [Mon, 23 Nov 2015 03:01:14 +0000 (03:01 +0000)]
[MS ABI] Tolerate invokes of __RTDynamicCast

The pointer returned by __RTDynamicCast must be bitcasted.  However, it
was not expected that __RTDynamicCast would be invoked, resulting in the
bitcast occuring in a different BasicBlock than the invoke.  This caused
a down-stream PHI to get confused about which BasicBlock the incomming
value was from.

This fixes PR25606.

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

8 years ago[coroutines] Check for overload sets in co_yield / co_return operands being resolved...
Richard Smith [Sun, 22 Nov 2015 07:33:28 +0000 (07:33 +0000)]
[coroutines] Check for overload sets in co_yield / co_return operands being resolved by a call to yield_value / return_value before rejecting them.

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

8 years ago[coroutines] Build implicit return_value / return_void calls for co_return.
Richard Smith [Sun, 22 Nov 2015 07:05:16 +0000 (07:05 +0000)]
[coroutines] Build implicit return_value / return_void calls for co_return.

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

8 years agoTest: Update mingw-useld.c to reflect r253813
Martell Malone [Sun, 22 Nov 2015 05:45:03 +0000 (05:45 +0000)]
Test: Update mingw-useld.c to reflect r253813

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

8 years agoDriver: Specifically tell the linker the target for mingw-w64
Martell Malone [Sun, 22 Nov 2015 05:40:06 +0000 (05:40 +0000)]
Driver: Specifically tell the linker the target for mingw-w64

Cross compiling from linux and OSX results in Error: Exec format.
This is because the linker is expecting ELF formated objects.
By passing the target we can explicitly tell the linker that
it should be linking COFF objects regardless of the host.

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

8 years ago[coroutines] Materialize the awaitable before generating the await_* calls.
Richard Smith [Sun, 22 Nov 2015 03:13:02 +0000 (03:13 +0000)]
[coroutines] Materialize the awaitable before generating the await_* calls.

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

8 years ago[coroutines] Factor out co_await representation into common base class for co_await...
Richard Smith [Sun, 22 Nov 2015 02:57:17 +0000 (02:57 +0000)]
[coroutines] Factor out co_await representation into common base class for co_await and co_yield, and use it to hold await_* calls.

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

8 years agoclang-format: Make sorting includes respect // clang-format off
Daniel Jasper [Sat, 21 Nov 2015 09:17:08 +0000 (09:17 +0000)]
clang-format: Make sorting includes respect // clang-format off

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

8 years agoLet's try to fix this test again with a fixed target triple
Matthias Braun [Sat, 21 Nov 2015 02:28:42 +0000 (02:28 +0000)]
Let's try to fix this test again with a fixed target triple

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

8 years agoFix c-unicode.c testcase again.
Matthias Braun [Sat, 21 Nov 2015 02:13:29 +0000 (02:13 +0000)]
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.

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

8 years agoFix testcase when building on darwin
Matthias Braun [Sat, 21 Nov 2015 00:56:41 +0000 (00:56 +0000)]
Fix testcase when building on darwin

Explicitely specify a target to avoid "_" prefixes on the names.

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

8 years ago[clang] Disable Unicode in asm files
Vinicius Tinti [Fri, 20 Nov 2015 23:42:39 +0000 (23:42 +0000)]
[clang] Disable Unicode in asm files

Clang should not convert tokens to Unicode when preprocessing assembly
files.

Fixes PR25558.

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

8 years ago[coroutines] Better handling of placeholder types.
Richard Smith [Fri, 20 Nov 2015 22:57:24 +0000 (22:57 +0000)]
[coroutines] Better handling of placeholder types.

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

8 years ago[coroutines] Support braced-init-list as operand of co_yield expression.
Richard Smith [Fri, 20 Nov 2015 22:47:10 +0000 (22:47 +0000)]
[coroutines] Support braced-init-list as operand of co_yield expression.

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

8 years ago[coroutines] Synthesize yield_value call for co_yield.
Richard Smith [Fri, 20 Nov 2015 22:40:06 +0000 (22:40 +0000)]
[coroutines] Synthesize yield_value call for co_yield.

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

8 years ago[CMake] Add support for specifying arguments to the bootstrap build.
Chris Bieneman [Fri, 20 Nov 2015 22:09:06 +0000 (22:09 +0000)]
[CMake] Add support for specifying arguments to the bootstrap build.

This adds support for three types of argument specifications for bootstrap builds:

(1) Arguments prefixed with BOOTSTRAP_* will be passed through with the leading BOOTSTRAP_ removed.
(2) CLANG_BOOTSTRAP_PASSTHROUGH can specify a list of variables to be passed through as they are set.
(3) BOOTSTRAP_DEFAULT_PASSTHROUGH is a list of some default passthrough variables that are always passed through. Those variables include the version string and should only specify variables that are always expected to be the same between the stage1 and stage2

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

8 years ago[CMake] Fix handling of passing through semi-colon separated lists.
Chris Bieneman [Fri, 20 Nov 2015 22:09:03 +0000 (22:09 +0000)]
[CMake] Fix handling of passing through semi-colon separated lists.

When passing around CMake arguments as lists of arguments any arguments containing lists need to have their semi-colons escaped otherwise CMake will split the arguments in the middle.

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

8 years agoDriver: Defer computation of linker path until it is needed.
Peter Collingbourne [Fri, 20 Nov 2015 20:49:39 +0000 (20:49 +0000)]
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.

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

8 years agoFix test case function name checks
Bill Seurer [Fri, 20 Nov 2015 20:47:34 +0000 (20:47 +0000)]
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.

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

8 years agoThread Safety Analysis: Fix DenseMap iterator invalidation UAF
Reid Kleckner [Fri, 20 Nov 2015 19:08:30 +0000 (19:08 +0000)]
Thread Safety Analysis: Fix DenseMap iterator invalidation UAF

Rather than storing BeforeInfo in the DenseMap by value, this stores a
unique_ptr to it, so that we can keep a pointer to it live across
subsequent DenseMap insertions.

This change also removes the unique_ptr wrapper around BeforeVect
because now we're indirecting at a higher level.

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

8 years agoHonor system specific paths of MAN pages
Chris Bieneman [Fri, 20 Nov 2015 18:49:02 +0000 (18:49 +0000)]
Honor system specific paths of MAN pages

Summary: Caught on NetBSD.

Patch by: Kamil Rytarowski (krytarowski)

Reviewers: beanz, jroelofs

Subscribers: cfe-commits, joerg

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

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

8 years agoAdd -disable-llvm-passes for frontend debug info tests.
Dehao Chen [Fri, 20 Nov 2015 18:29:01 +0000 (18:29 +0000)]
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

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

8 years ago[DebugInfo] Look through type sugar on union types when casting
Reid Kleckner [Fri, 20 Nov 2015 17:41:12 +0000 (17:41 +0000)]
[DebugInfo] Look through type sugar on union types when casting

Fixes PR25584.

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

8 years agoRevert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"
Hans Wennborg [Fri, 20 Nov 2015 16:51:56 +0000 (16:51 +0000)]
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.

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

8 years agoHandle ARMv6-J as an alias, instead of fake architecture
Artyom Skrobov [Fri, 20 Nov 2015 16:47:05 +0000 (16:47 +0000)]
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

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

8 years agoclang-format: [JS] Make AllowShortFunctionsOnASingle line value "Empty"
Daniel Jasper [Fri, 20 Nov 2015 16:44:28 +0000 (16:44 +0000)]
clang-format: [JS] Make AllowShortFunctionsOnASingle line value "Empty"
work properly.

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

8 years agoclang-format: [JS] Properly add a space after "in" in for loops.
Daniel Jasper [Fri, 20 Nov 2015 16:18:42 +0000 (16:18 +0000)]
clang-format: [JS] Properly add a space after "in" in for loops.

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

8 years agoclang-format: [JS] struct and union aren't keywords / reserved words.
Daniel Jasper [Fri, 20 Nov 2015 15:58:50 +0000 (15:58 +0000)]
clang-format: [JS] struct and union aren't keywords / reserved words.

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

8 years agoclang-format: Don't use incorrect space in macro calls with operators.
Daniel Jasper [Fri, 20 Nov 2015 15:26:50 +0000 (15:26 +0000)]
clang-format: Don't use incorrect space in macro calls with operators.

Before:
  MACRO(> );

After:
  MACRO(>);

Not overly important, but easy and good for symmetry reasons :-).

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

8 years agoclang-format: [Proto] Support extending message.
Daniel Jasper [Fri, 20 Nov 2015 14:32:54 +0000 (14:32 +0000)]
clang-format: [Proto] Support extending message.

Before:
  extend.foo.Bar {
  }

After:
  extend .foo.Bar {
  }

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

8 years agoRegenerate ASTMatchersReference without CRLF.
Benjamin Kramer [Fri, 20 Nov 2015 07:57:46 +0000 (07:57 +0000)]
Regenerate ASTMatchersReference without CRLF.

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

8 years agoFix ASTMatcher reference newlines and make the generator script windows-proof.
Benjamin Kramer [Fri, 20 Nov 2015 07:46:19 +0000 (07:46 +0000)]
Fix ASTMatcher reference newlines and make the generator script windows-proof.

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

8 years ago[MS] Fix for bug 25013 - #pragma vtordisp is unknown inside functions, by Denis Zobnin.
Alexey Bataev [Fri, 20 Nov 2015 07:02:57 +0000 (07:02 +0000)]
[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

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

8 years ago[Myriad]: handle Preprocess job action (-E)
Douglas Katzman [Fri, 20 Nov 2015 04:58:12 +0000 (04:58 +0000)]
[Myriad]: handle Preprocess job action (-E)

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

8 years ago[libclang] Make sure to use the raw module format for libclang parsing.
Argyrios Kyrtzidis [Fri, 20 Nov 2015 03:36:21 +0000 (03:36 +0000)]
[libclang] Make sure to use the raw module format for libclang parsing.

Fixes crash when passing '-gmodules' in the compiler options.
rdar://23588717

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

8 years ago[coroutines] Per latest wording paper, co_* are no longer permitted in any
Richard Smith [Fri, 20 Nov 2015 02:54:01 +0000 (02:54 +0000)]
[coroutines] Per latest wording paper, co_* are no longer permitted in any
unevaluated operands.

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

8 years ago[CMake] Add a specific 'install-clang-headers' target.
Argyrios Kyrtzidis [Fri, 20 Nov 2015 02:24:03 +0000 (02:24 +0000)]
[CMake] Add a specific 'install-clang-headers' target.

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

8 years ago[analyzer] DeadStoresChecker: Treat locals captured by reference in C++ lambdas as...
Devin Coughlin [Fri, 20 Nov 2015 01:53:44 +0000 (01:53 +0000)]
[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

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

8 years agoSupport CMake's clang_rt.profile library naming scheme
Chris Bieneman [Fri, 20 Nov 2015 00:19:21 +0000 (00:19 +0000)]
Support CMake's clang_rt.profile library naming scheme

Summary: This code is a bit undesirable, but it gets clang to work with the autoconf and cmake-built libclang_rt.profile libraries.

Reviewers: bogner

Subscribers: cfe-commits

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

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

8 years agoAMDGPU: Add support for 's' and 'v' asm constraints
Tom Stellard [Thu, 19 Nov 2015 22:11:58 +0000 (22:11 +0000)]
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

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

8 years agoUpdate clang tests to accomendate discriminator changes.
Dehao Chen [Thu, 19 Nov 2015 19:53:16 +0000 (19:53 +0000)]
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

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

8 years agoChange the expression evaluation context from Unevaluated to ConstantEvaluated while...
Faisal Vali [Thu, 19 Nov 2015 19:20:17 +0000 (19:20 +0000)]
Change the expression evaluation context from Unevaluated to ConstantEvaluated while substituting into non-type template argument defaults.

Also address a typo from a prior patch that performed a similar fix during Parsing of default non-type template arguments.  I left the RAII ExpressionEvaluationContext variable Name as Unevaluated though we had switched the context to ConstantEvaluated.

There should be no functionality change here - since when expression evaluation context is popped off, for the most part these two contexts currently behave similarly in regards to lambda diagnostics and odr-use tracking.

Like its parsing counterpart, this patch presages the advent of constexpr lambda patches...

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

8 years agoclang-cl: Make /W4 imply -Wall -Wextra (PR25563)
Hans Wennborg [Thu, 19 Nov 2015 17:49:59 +0000 (17:49 +0000)]
clang-cl: Make /W4 imply -Wall -Wextra (PR25563)

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

8 years agoclangFrontend: [PR25565] Quick fix for dependencies on Attributes.inc.
NAKAMURA Takumi [Thu, 19 Nov 2015 10:59:48 +0000 (10:59 +0000)]
clangFrontend: [PR25565] Quick fix for dependencies on Attributes.inc.

FIXME: Attributes.inc may be an independent target.

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

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

8 years agoPR10235: support for vector mode attributes + warning, by Dmitry Polukhin.
Alexey Bataev [Thu, 19 Nov 2015 10:13:11 +0000 (10:13 +0000)]
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

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

8 years agoRevert "Change memcpy/memset/memmove to have dest and source alignments."
Pete Cooper [Thu, 19 Nov 2015 05:55:59 +0000 (05:55 +0000)]
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

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

8 years agoRevert "Fix debian build after r253512."
Pete Cooper [Thu, 19 Nov 2015 05:55:44 +0000 (05:55 +0000)]
Revert "Fix debian build after r253512."

This reverts commit r253519.

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

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

8 years ago[coroutines] Tweak diagnostics to always use fully-qualified name for std::coroutine_...
Richard Smith [Thu, 19 Nov 2015 02:36:35 +0000 (02:36 +0000)]
[coroutines] Tweak diagnostics to always use fully-qualified name for std::coroutine_traits.

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

8 years agoDon't actually add the __unsafe_unretained qualifier in MRC;
John McCall [Thu, 19 Nov 2015 02:28:03 +0000 (02:28 +0000)]
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.

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

8 years agoFix the emission of ARC-style ivar layouts in the fragile runtime
John McCall [Thu, 19 Nov 2015 02:27:55 +0000 (02:27 +0000)]
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.

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

8 years ago[analyzer] Improve modeling of static initializers.
Anna Zaks [Thu, 19 Nov 2015 01:25:28 +0000 (01:25 +0000)]
[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

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

8 years ago[MS ABI] Let arbitrary entities participate in vftable ordering
David Majnemer [Thu, 19 Nov 2015 00:03:54 +0000 (00:03 +0000)]
[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.

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

8 years agoFix debian build after r253512.
Pete Cooper [Wed, 18 Nov 2015 22:53:40 +0000 (22:53 +0000)]
Fix debian build after r253512.

The conversion from QuantityType to the (temporary) IntegerAlignment class
was ambiguous.

For now add in explicit conversion to unsigned to satisfy the clang-x86_64-debian-fast bot.

I'll remove the explicit conversion when I remove the IntegerAlignment class.

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

8 years ago[analyzer] Skip checking blocks in dependent contexts.
Devin Coughlin [Wed, 18 Nov 2015 22:46:52 +0000 (22:46 +0000)]
[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

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

8 years agoChange memcpy/memset/memmove to have dest and source alignments.
Pete Cooper [Wed, 18 Nov 2015 22:18:45 +0000 (22:18 +0000)]
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.

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

8 years ago[MSVC Compat] Make -Wmicrosoft-cast not an error by default
David Majnemer [Wed, 18 Nov 2015 21:42:38 +0000 (21:42 +0000)]
[MSVC Compat] Make -Wmicrosoft-cast not an error by default

Too much code is sloppy about this to error by default.

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

8 years ago[Sema] Don't work around a malformed AST
David Majnemer [Wed, 18 Nov 2015 19:49:19 +0000 (19:49 +0000)]
[Sema] Don't work around a malformed AST

We created a malformed TemplateSpecializationType: it was dependent but
had a RecordType as it's canonical type.  This would lead getAs to
crash.  r249090 worked around this but we should fix this for real by
providing a more appropriate template specialization type as the
canonical type.

This fixes PR24246.

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

8 years agoRemoving the AST matcher test for thread_local storage duration. Not all platforms...
Aaron Ballman [Wed, 18 Nov 2015 18:37:29 +0000 (18:37 +0000)]
Removing the AST matcher test for thread_local storage duration. Not all platforms support TLS, and on platforms that do not support it, use of thread_local causes an error. Since there's no way to determine whether the testing platform supports TLS, there's no way to know whether the test is safe to run or not. I will explore ways to enable this test, but this will appease at least one more build bot.

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

8 years ago[PGO] Test update for revision 253484.
Betul Buyukkurt [Wed, 18 Nov 2015 18:15:55 +0000 (18:15 +0000)]
[PGO] Test update for revision 253484.

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

8 years agoRe-committing r253473 after hopefully fixing the bot breakage. There was a copy-pasta...
Aaron Ballman [Wed, 18 Nov 2015 17:56:55 +0000 (17:56 +0000)]
Re-committing r253473 after hopefully fixing the bot breakage. There was a copy-pasta issue that my local testing did not catch.

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

8 years ago[Myriad]: fix test for Windows
Douglas Katzman [Wed, 18 Nov 2015 17:19:47 +0000 (17:19 +0000)]
[Myriad]: fix test for Windows

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

8 years agoReverting r253473 while I investigate build bot failures.
Aaron Ballman [Wed, 18 Nov 2015 17:16:01 +0000 (17:16 +0000)]
Reverting r253473 while I investigate build bot failures.

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

8 years agoAdding AST matchers for VarDecl storage durations. Can now determine whether a VarDec...
Aaron Ballman [Wed, 18 Nov 2015 17:05:39 +0000 (17:05 +0000)]
Adding AST matchers for VarDecl storage durations. Can now determine whether a VarDecl has automatic, static, or thread storage duration. This also updates the documentation for matchers, which appear to be missing some previous additions.

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

8 years ago[ARM] Support +feature targeting in -mcpu/-march
Bradley Smith [Wed, 18 Nov 2015 16:33:48 +0000 (16:33 +0000)]
[ARM] Support +feature targeting in -mcpu/-march

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

8 years ago[Myriad]: insert -L paths into linker cmd only when they exist.
Douglas Katzman [Wed, 18 Nov 2015 16:24:46 +0000 (16:24 +0000)]
[Myriad]: insert -L paths into linker cmd only when they exist.

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

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

8 years ago[libclang] Add entry points that take a full command line including argv[0].
Benjamin Kramer [Wed, 18 Nov 2015 16:14:27 +0000 (16:14 +0000)]
[libclang] Add entry points that take a full command line including argv[0].

This provides both a more uniform interface and makes libclang behave like
clang tooling wrt relative paths against argv[0]. This is necessary for
finding paths to a c++ standard library relative to a clang binary given
in a compilation database. It can also be used to find paths relative to
libclang.so if the full path to it is passed in.

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

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

8 years agoFix tests in order for them to not fail after r252604.
Igor Laevsky [Wed, 18 Nov 2015 14:40:41 +0000 (14:40 +0000)]
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.

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

8 years agoSet flag for lldb when qualified name lookup is being done
Eugene Leviant [Wed, 18 Nov 2015 12:48:05 +0000 (12:48 +0000)]
Set flag for lldb when qualified name lookup is being done

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

8 years agoUpdate for llvm change.
Rafael Espindola [Wed, 18 Nov 2015 06:54:13 +0000 (06:54 +0000)]
Update for llvm change.

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

8 years agoBuildUniversalActions(): Prune obsolete \param(s). [-Wdocumentation]
NAKAMURA Takumi [Wed, 18 Nov 2015 05:15:21 +0000 (05:15 +0000)]
BuildUniversalActions(): Prune obsolete \param(s). [-Wdocumentation]

FIXME: Describe BAInputs.

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

8 years ago[NFC] Change the evaluation context of a non-type default template argument from...
Faisal Vali [Wed, 18 Nov 2015 04:29:22 +0000 (04:29 +0000)]
[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!

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

8 years agoDon't expose iterators into the list of types on the ASTContext; these are
Richard Smith [Wed, 18 Nov 2015 01:19:02 +0000 (01:19 +0000)]
Don't expose iterators into the list of types on the ASTContext; these are
unsafe, since many operations on the types can trigger lazy deserialization of
more types and invalidate the iterators. This fixes a crasher, but I've not
been able to reduce it to a reasonable testcase yet.

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

8 years agoTry to fix leak in CXStringSet from r252853
Reid Kleckner [Wed, 18 Nov 2015 01:06:39 +0000 (01:06 +0000)]
Try to fix leak in CXStringSet from r252853

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

8 years agoFix for use-after-free which caused test failure in cuda-detect.cu.
Artem Belevich [Wed, 18 Nov 2015 00:37:41 +0000 (00:37 +0000)]
Fix for use-after-free which caused test failure in cuda-detect.cu.

Return std::string itself instead StringRef to a temporary std::string.

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

8 years agoProduce a better diagnostic for global register variables.
Akira Hatanaka [Wed, 18 Nov 2015 00:15:28 +0000 (00:15 +0000)]
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

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

8 years ago[PGO] Removed unused code. [NFC]
Betul Buyukkurt [Wed, 18 Nov 2015 00:14:08 +0000 (00:14 +0000)]
[PGO] Removed unused code. [NFC]

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

8 years ago[modules] When a #include is mapped to a module import and appears somewhere
Richard Smith [Tue, 17 Nov 2015 23:32:01 +0000 (23:32 +0000)]
[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.

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

8 years ago[Myriad]: -nostdlib implies -nostartfiles
Douglas Katzman [Tue, 17 Nov 2015 22:33:34 +0000 (22:33 +0000)]
[Myriad]: -nostdlib implies -nostartfiles

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

8 years ago[CUDA] Make CUDA compilation usable by default.
Artem Belevich [Tue, 17 Nov 2015 22:28:55 +0000 (22:28 +0000)]
[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.

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

8 years ago[CUDA] Added a wrapper header for inclusion of stock CUDA headers.
Artem Belevich [Tue, 17 Nov 2015 22:28:52 +0000 (22:28 +0000)]
[CUDA] Added a wrapper header for inclusion of stock CUDA headers.

Header files that come with CUDA are assuming split host/device
compilation and are not usable by clang out of the box.
With a bit of preprocessor magic it's possible to twist them
into something clang can use.

This wrapper always includes CUDA headers exactly the same way during
host and device compilation passes and produces identical preprocessed
content during host and device side compilation for sm_35 GPUs. Device
compilation passes for older GPUs will see a smaller subset of device
functions supported by particular GPU.

The wrapper assumes specific contents of CUDA header files and works
only with CUDA 7.0 and 7.5.

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

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

8 years ago[CUDA] Detect and link with CUDA's libdevice bitcode library.
Artem Belevich [Tue, 17 Nov 2015 22:28:50 +0000 (22:28 +0000)]
[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

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

8 years ago[CUDA] added include paths for both sides of CUDA compilation.
Artem Belevich [Tue, 17 Nov 2015 22:28:46 +0000 (22:28 +0000)]
[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

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

8 years ago[CUDA] use -aux-triple to pass target triple of opposite side of compilation
Artem Belevich [Tue, 17 Nov 2015 22:28:40 +0000 (22:28 +0000)]
[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

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

8 years agoUse !hasArg with two options instead of !hasArg && !hasArg.
Douglas Katzman [Tue, 17 Nov 2015 20:28:07 +0000 (20:28 +0000)]
Use !hasArg with two options instead of !hasArg && !hasArg.

Thereby fixing a warning about failure to claim all args.

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

8 years ago[Lit Test] Updated 34 Lit tests to be C++11 compatible.
Charles Li [Tue, 17 Nov 2015 20:25:05 +0000 (20:25 +0000)]
[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.

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

8 years agobmiintrin.h: Allow using the tzcnt intrinsics for non-BMI targets
Hans Wennborg [Tue, 17 Nov 2015 18:46:48 +0000 (18:46 +0000)]
bmiintrin.h: Allow using the tzcnt intrinsics for non-BMI targets

The tzcnt intrinsics are used non non-BMI targets by code (e.g. ffmpeg)
that uses it as a potentially faster BSF.

The TZCNT instruction is special in that it's encoded in a
backward-compatible way and behaves as BSF on non-BMI targets.

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

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

8 years agoARM: fix mismatch between Clang and backend on exception type.
Tim Northover [Tue, 17 Nov 2015 18:27:27 +0000 (18:27 +0000)]
ARM: fix mismatch between Clang and backend on exception type.

"-arch armv7k" is only normally used with a watchos target, but Clang doesn't
stop you from giving a "-miphoneos-version-min" option too, converting the
triple to "thumbv7k-apple-ios". In this case the backend will decide to use
SjLj exceptions, so Clang needs to agree so it can create the correct
predefines.

Fortunately, there's a handy function to make the decision for us now.

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

8 years agoAdd trivial utility to append -L arguments to linker step. NFC
Douglas Katzman [Tue, 17 Nov 2015 17:41:23 +0000 (17:41 +0000)]
Add trivial utility to append -L arguments to linker step. NFC

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

8 years agoRevert "Make FP_CONTRACT ON the default."
Manuel Klimek [Tue, 17 Nov 2015 15:40:10 +0000 (15:40 +0000)]
Revert "Make FP_CONTRACT ON the default."

This reverts commit r253269.

This leads to assert / segfault triggering on the following reduced example:
float foo(float U, float base, float cell) { return (U = 2 * base) - cell; }

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

8 years ago[Sema] Remove unnecessary typecast of bool to int when passing arguments to diagnosti...
Craig Topper [Tue, 17 Nov 2015 05:40:12 +0000 (05:40 +0000)]
[Sema] Remove unnecessary typecast of bool to int when passing arguments to diagnostics. NFC

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

8 years ago[Sema] Combine similar diagnostics using %select. NFC
Craig Topper [Tue, 17 Nov 2015 05:40:09 +0000 (05:40 +0000)]
[Sema] Combine similar diagnostics using %select. NFC

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