]> granicus.if.org Git - clang/log
clang
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

8 years ago[Sema] Minor formatting fixes. NFC
Craig Topper [Tue, 17 Nov 2015 05:40:05 +0000 (05:40 +0000)]
[Sema] Minor formatting fixes. NFC

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

8 years ago[modules] Fix some more cases where we used to reject a conflict between two
Richard Smith [Tue, 17 Nov 2015 03:02:41 +0000 (03:02 +0000)]
[modules] Fix some more cases where we used to reject a conflict between two
declarations that are not simultaneously visible, and where at least one of
them has internal/no linkage.

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

8 years agoMake FP_CONTRACT ON the default.
Stephen Canon [Mon, 16 Nov 2015 23:09:11 +0000 (23:09 +0000)]
Make FP_CONTRACT ON the default.

Differential Revision: D14200

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

8 years agoDerive nacltools::Linker from GnuTool to get response file support
Derek Schuff [Mon, 16 Nov 2015 22:21:25 +0000 (22:21 +0000)]
Derive nacltools::Linker from GnuTool to get response file support

It could be derived from gnutools::Linker directly but this way makes it
consistent with all the other toolchains around it.

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

8 years agoCorrectly handle type mismatches in the __weak copy/move-initialization
John McCall [Mon, 16 Nov 2015 22:11:41 +0000 (22:11 +0000)]
Correctly handle type mismatches in the __weak copy/move-initialization
peephole I added in r250916.

rdar://23559789

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

8 years agoWhen producing error messages for always_inline functions with the
Eric Christopher [Mon, 16 Nov 2015 18:29:59 +0000 (18:29 +0000)]
When producing error messages for always_inline functions with the
target attribute, don't include "negative" subtarget features in the
list of required features. Builtins are positive by default so don't
need this change, but we pull the default list of features from the
command line and so need to make sure that we only include features
that are turned on for code generation in our error.

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

8 years ago[mips] Do not add arch name in the compiler-rt's components.
Vasileios Kalintiris [Mon, 16 Nov 2015 15:41:30 +0000 (15:41 +0000)]
[mips] Do not add arch name in the compiler-rt's components.

Instead, use the constant "mips" since the libraries are already
placed under the multilib's OS suffix.

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

8 years ago[Myriad]: pass the 'std=' option to moviCompile
Douglas Katzman [Mon, 16 Nov 2015 15:38:40 +0000 (15:38 +0000)]
[Myriad]: pass the 'std=' option to moviCompile

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

8 years ago[ARM,AArch64] Fix __rev16l and __rev16ll intrinsics
Oliver Stannard [Mon, 16 Nov 2015 14:58:50 +0000 (14:58 +0000)]
[ARM,AArch64] Fix __rev16l and __rev16ll intrinsics

These two intrinsics are defined in arm_acle.h.

__rev16l needs to rotate by 16 bits, bit it was actually rotating by 2 bits.
For AArch64, where long is 64 bits, this would still be wrong.

__rev16ll was incorrect, it reversed the bytes in each 32-bit word, rather than
each 16-bit halfword. The correct implementation is to apply __rev16 to the top
and bottom words of the 64-bit value.

For AArch32 targets, these get compiled down to the hardware rev16 instruction
at -O1 and above. For AArch64 targets, the 64-bit ones get compiled to two
32-bit rev16 instructions, because there is not currently a pattern for the
64-bit rev16 instruction.

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

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

8 years agoHandle ARMv6KZ naming
Artyom Skrobov [Mon, 16 Nov 2015 14:05:48 +0000 (14:05 +0000)]
Handle ARMv6KZ naming

Summary: Update for clang tests for D14568

Reviewers: rengolin, joerg, bogden

Subscribers: aemerson, rengolin, cfe-commits

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

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

8 years agoclang-format: Enable #include sorting by default.
Daniel Jasper [Mon, 16 Nov 2015 12:38:56 +0000 (12:38 +0000)]
clang-format: Enable #include sorting by default.

This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command line flag can from now on be used to override whatever is set
in the style.

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

8 years ago[ARM] Pass in the architecture to TargetParser to cope with API change
Bradley Smith [Mon, 16 Nov 2015 11:16:36 +0000 (11:16 +0000)]
[ARM] Pass in the architecture to TargetParser to cope with API change

The TargetParser API to get the default FPU and default extensions has
changed so that it can fall back to the architecture in case of a
generic CPU.

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

8 years agoUpdate for the gnu flavor being renamed to old-gnu.
Rafael Espindola [Mon, 16 Nov 2015 09:12:12 +0000 (09:12 +0000)]
Update for the gnu flavor being renamed to old-gnu.

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

8 years ago[CGDebugInfo] Set the size and align for reference types
Keno Fischer [Mon, 16 Nov 2015 09:04:13 +0000 (09:04 +0000)]
[CGDebugInfo] Set the size and align for reference types

In r253186, I changed the DIBuilder API to now take size and align
for reference types as well. This was done in preparation for upcoming
changes to the Verifier that will validate that sizes match between
DI types and IR values that are declared as having those types.
This updates clang to actually pass the information through.

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

8 years ago[Sema] Implement several unary type traits more accurately
David Majnemer [Mon, 16 Nov 2015 06:58:51 +0000 (06:58 +0000)]
[Sema] Implement several unary type traits more accurately

is_empty, is_polymorphic, and is_abstract didn't handle incomplete types
correctly.  Only non-union class types must be complete for these
traits.

is_final and is_sealed don't care about the particular spelling of the
FinalAttr.

is_interface_class should always return false regardless of its input.
The type trait can only be satisfied in a mode we do not support (/CLR).

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

8 years ago[Basic] Replace vector<bool> with BitVector in SourceManager. NFC.
Vedant Kumar [Mon, 16 Nov 2015 04:39:22 +0000 (04:39 +0000)]
[Basic] Replace vector<bool> with BitVector in SourceManager. NFC.

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

8 years ago[Frontend] Rangify for loop. NFC.
Vedant Kumar [Mon, 16 Nov 2015 00:59:34 +0000 (00:59 +0000)]
[Frontend] Rangify for loop. NFC.

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

8 years ago[Basic] Use a bitfield in SLocEntry for clarity. NFC.
Vedant Kumar [Mon, 16 Nov 2015 00:11:58 +0000 (00:11 +0000)]
[Basic] Use a bitfield in SLocEntry for clarity. NFC.

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

8 years ago[analyzer] Handle calling ObjC super method from inside C++ lambda.
Devin Coughlin [Sun, 15 Nov 2015 17:48:22 +0000 (17:48 +0000)]
[analyzer] Handle calling ObjC super method from inside C++ lambda.

When calling a ObjC method on super from inside a C++ lambda, look at the
captures to find "self". This mirrors how the analyzer handles calling super in
an ObjC block and fixes an assertion failure.

rdar://problem/23550077

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

8 years ago[Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo on the...
Craig Topper [Sun, 15 Nov 2015 17:27:57 +0000 (17:27 +0000)]
[Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo on the AST context instead of Preprocessor. NFC

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

8 years ago[Sema] Fix filename in header. NFC
Craig Topper [Sun, 15 Nov 2015 17:27:55 +0000 (17:27 +0000)]
[Sema] Fix filename in header. NFC

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

8 years ago[Sema] Remove unnecessary includes and forward declarations. NFC
Craig Topper [Sun, 15 Nov 2015 17:27:52 +0000 (17:27 +0000)]
[Sema] Remove unnecessary includes and forward declarations. NFC

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

8 years ago[X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing cvt intrinsics
Simon Pilgrim [Sun, 15 Nov 2015 14:40:31 +0000 (14:40 +0000)]
[X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing cvt intrinsics

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

8 years ago[libclang] Visit TypeAliasTemplateDecl
Sergey Kalinichev [Sun, 15 Nov 2015 13:48:32 +0000 (13:48 +0000)]
[libclang] Visit TypeAliasTemplateDecl

This makes TypeAliasTemplateDecl accessible via LibClang and python bindings

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

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

8 years ago[libclang] Expose AutoType
Sergey Kalinichev [Sun, 15 Nov 2015 13:10:10 +0000 (13:10 +0000)]
[libclang] Expose AutoType

Expose the AutoType via LibClang and python bindings

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

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

8 years agoRemove some trailing whitespace
Sergey Kalinichev [Sun, 15 Nov 2015 12:37:01 +0000 (12:37 +0000)]
Remove some trailing whitespace

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

8 years agoMake the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
Yaron Keren [Sun, 15 Nov 2015 08:06:27 +0000 (08:06 +0000)]
Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
Post-commit suggestion by Filipe Cabecinhas.

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

8 years agoFix a layering oddity by passing Sema to DeclSpec::Finish instead of DiagnosticsEngin...
Craig Topper [Sun, 15 Nov 2015 03:32:11 +0000 (03:32 +0000)]
Fix a layering oddity by passing Sema to DeclSpec::Finish instead of DiagnosticsEngine and Preprocessor. Everything the preprocessor was being used for can be acquired from Sema.

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

8 years ago[analyzer] Refer to capture field to determine if capture is reference.
Devin Coughlin [Sun, 15 Nov 2015 03:07:17 +0000 (03:07 +0000)]
[analyzer] Refer to capture field to determine if capture is reference.

The analyzer incorrectly treats captures as references if either the original
captured variable is a reference or the variable is captured by reference.
This causes the analyzer to crash when capturing a reference type by copy
(PR24914). Fix this by refering solely to the capture field to determine when a
DeclRefExpr for a lambda capture should be treated as a reference type.

https://llvm.org/bugs/show_bug.cgi?id=24914
rdar://problem/23524412

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

8 years ago[Sema] Don't crash trying to diagnose abs called on a pointer type
David Majnemer [Sun, 15 Nov 2015 03:04:34 +0000 (03:04 +0000)]
[Sema] Don't crash trying to diagnose abs called on a pointer type

Clang tries to figure out if a call to abs is suspicious by looking
through implicit casts to look at the underlying, implicitly converted
type.
Interestingly, C has implicit conversions from pointer-ish types like
function to less exciting types like int.  This trips up our 'abs'
checker because it doesn't know which variant of 'abs' is appropriate.

Instead, diagnose 'abs' called on function types upfront.  This sort of
thing is highly suspicious and is likely indicative of a missing
pointer dereference/function call/array index operation.

This fixes PR25532.

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

8 years agoUse Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC
Craig Topper [Sun, 15 Nov 2015 02:31:46 +0000 (02:31 +0000)]
Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC

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

8 years ago[WebAssembly] Remove the "const" attribute from __builtin_wasm_memory_size.
Dan Gohman [Sat, 14 Nov 2015 22:57:34 +0000 (22:57 +0000)]
[WebAssembly] Remove the "const" attribute from __builtin_wasm_memory_size.

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

8 years agoMove diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic...
Craig Topper [Sat, 14 Nov 2015 19:31:56 +0000 (19:31 +0000)]
Move diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic.h diagnostics.

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

8 years agoFix indentation. NFC
Craig Topper [Sat, 14 Nov 2015 19:31:52 +0000 (19:31 +0000)]
Fix indentation. NFC

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

8 years agoMerge some similar diagnostics using %select.
Craig Topper [Sat, 14 Nov 2015 18:16:08 +0000 (18:16 +0000)]
Merge some similar diagnostics using %select.

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

8 years agoMinor formatting fixes. NFC
Craig Topper [Sat, 14 Nov 2015 18:16:02 +0000 (18:16 +0000)]
Minor formatting fixes. NFC

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

8 years agoFix 80 column violation. NFC.
Craig Topper [Sat, 14 Nov 2015 18:16:00 +0000 (18:16 +0000)]
Fix 80 column violation. NFC.

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

8 years agoFix spelling error in comment.
Craig Topper [Sat, 14 Nov 2015 18:15:55 +0000 (18:15 +0000)]
Fix spelling error in comment.

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

8 years ago[X86][MMX] Sorted MMX IR + assembly codegen builtin tests
Simon Pilgrim [Sat, 14 Nov 2015 13:25:06 +0000 (13:25 +0000)]
[X86][MMX] Sorted MMX IR + assembly codegen builtin tests

Makes it easier to track what tests are missing....

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

8 years ago[X86][MMX] Added MMX IR + assembly codegen builtin tests
Simon Pilgrim [Sat, 14 Nov 2015 12:47:44 +0000 (12:47 +0000)]
[X86][MMX] Added MMX IR + assembly codegen builtin tests

Improved tests as discussed in PR24580

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

8 years agoMark is_destructible/is_nothrow_destructible as implemented
David Majnemer [Sat, 14 Nov 2015 07:21:35 +0000 (07:21 +0000)]
Mark is_destructible/is_nothrow_destructible as implemented

These were implemented back in r244564.  However, I forgot to update the
docs.

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

8 years ago[modules] Allow "redefinition" of typedef of anon tag from unimported submodule
Ben Langmuir [Sat, 14 Nov 2015 03:26:14 +0000 (03:26 +0000)]
[modules] Allow "redefinition" of typedef of anon tag from unimported submodule

r233345 started being stricter about typedef names for linkage purposes
in non-visible modules, but broke languages without the ODR.

rdar://23527954

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

8 years agoAdd support for the always_inline + target feature diagnostic to print
Eric Christopher [Sat, 14 Nov 2015 02:38:37 +0000 (02:38 +0000)]
Add support for the always_inline + target feature diagnostic to print
out the first missing target feature that's required and reword
the diagnostic accordingly.

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

8 years agoUse %select to merge similar diagnostics. NFC
Craig Topper [Sat, 14 Nov 2015 02:09:55 +0000 (02:09 +0000)]
Use %select to merge similar diagnostics. NFC

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

8 years agoClarify and elaborate the conditions on which we're checking target
Eric Christopher [Sat, 14 Nov 2015 01:56:04 +0000 (01:56 +0000)]
Clarify and elaborate the conditions on which we're checking target
features for calls.

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

8 years agoMake some tests LLVM-optimization agnostic and remove some others that were beyond...
David Blaikie [Sat, 14 Nov 2015 01:10:38 +0000 (01:10 +0000)]
Make some tests LLVM-optimization agnostic and remove some others that were beyond value/repair

Several of these tests (the two deleted, and the one removal edit) were
relying on the optimizer to collapse things to test some frontend
feature. The tests were really old and features seemed amply covered by
other parts of the test suite, so I just removed them.

If anyone thinks they're valuable enough to keep/fix, we can play around
with that, for sure.

(inspired by r252872)

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

8 years agoCFG: Delay creating Dtors for CompoundStmts which end in ReturnStmt
Matthias Gehre [Sat, 14 Nov 2015 00:36:50 +0000 (00:36 +0000)]
CFG: Delay creating Dtors for CompoundStmts which end in ReturnStmt

Summary:
VisitReturnStmt would create a new block with including Dtors, so the Dtors created
in VisitCompoundStmts would be in an unreachable block.

Example:

struct S {
  ~S();
};

void f()
{
  S s;
  return;
}

void g()
{
  S s;
}

Before this patch, f has one additional unreachable block containing just the
destructor of S. With this patch, both f and g have the same blocks.

Reviewers: krememek

Subscribers: cfe-commits

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

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

8 years agoRevert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."
Justin Bogner [Fri, 13 Nov 2015 23:07:31 +0000 (23:07 +0000)]
Revert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."

This reverts r243310, which is redundant as of r253102.

Conflicts:
lib/Driver/Tools.cpp

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

8 years ago[CMake] Don't install c-index-test when LLVM_INSTALL_TOOLCHAIN_ONLY=ON.
Argyrios Kyrtzidis [Fri, 13 Nov 2015 22:41:14 +0000 (22:41 +0000)]
[CMake] Don't install c-index-test when LLVM_INSTALL_TOOLCHAIN_ONLY=ON.

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

8 years agoFix build... again
Jonathan Roelofs [Fri, 13 Nov 2015 21:04:14 +0000 (21:04 +0000)]
Fix build... again

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

8 years ago[scan-build] Make scan-build work whether it's installed or not
Jonathan Roelofs [Fri, 13 Nov 2015 20:34:15 +0000 (20:34 +0000)]
[scan-build] Make scan-build work whether it's installed or not

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

8 years agoRelax mingw-useld test to fix bot failures.
Yaron Keren [Fri, 13 Nov 2015 20:02:08 +0000 (20:02 +0000)]
Relax mingw-useld test to fix bot failures.

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

8 years ago[scan-build] Move non user-facing utilities to share
Jonathan Roelofs [Fri, 13 Nov 2015 19:56:07 +0000 (19:56 +0000)]
[scan-build] Move non user-facing utilities to share

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

8 years agoAdd test case for mingw -fuse-ld= support introduced in r242121.
Yaron Keren [Fri, 13 Nov 2015 19:46:02 +0000 (19:46 +0000)]
Add test case for mingw -fuse-ld= support introduced in r242121.

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

8 years agoFix auto-link for text-based dynamic library SDKs.
Juergen Ributzka [Fri, 13 Nov 2015 19:08:07 +0000 (19:08 +0000)]
Fix auto-link for text-based dynamic library SDKs.

When linking against text-based dynamic library SDKs the library name of a
framework has now more than one possible filename extensions. This fix tests for
both possible extensions (none, and .tbd).

This fixes rdar://problem/20609975

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

8 years agoSlacken the norecurse test slightly
James Molloy [Fri, 13 Nov 2015 17:29:18 +0000 (17:29 +0000)]
Slacken the norecurse test slightly

It has been reported that this test currently fails on some Power buildbots due to them adding a "signext" function attribute.

As that's not what we're checking here, slacken off the test a bit.

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

8 years agoDeduplicate three identical copies of isExplicitInstantiationOrSpecialization, NFC.
Yaron Keren [Fri, 13 Nov 2015 15:39:39 +0000 (15:39 +0000)]
Deduplicate three identical copies of isExplicitInstantiationOrSpecialization, NFC.

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

8 years agoscan-build: Fix install.
NAKAMURA Takumi [Fri, 13 Nov 2015 06:48:02 +0000 (06:48 +0000)]
scan-build: Fix install.

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

8 years ago[Sema] __is_constructible should return false for function types
David Majnemer [Fri, 13 Nov 2015 05:32:43 +0000 (05:32 +0000)]
[Sema] __is_constructible should return false for function types

While functions types are complete, they cannot be constructed.

This fixes PR25513.

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

8 years ago[modules] When a declaration has non-trivial visibility, check whether it's
Richard Smith [Fri, 13 Nov 2015 05:14:45 +0000 (05:14 +0000)]
[modules] When a declaration has non-trivial visibility, check whether it's
actually hidden before we check its linkage. This avoids computing the linkage
"too early" for an anonymous struct with a typedef name for linkage.

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

8 years agoclang/test/Driver/mips-mti-linux.c: Tweak to match DOSish paths.
NAKAMURA Takumi [Fri, 13 Nov 2015 04:44:51 +0000 (04:44 +0000)]
clang/test/Driver/mips-mti-linux.c: Tweak to match DOSish paths.

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

8 years ago[modules] Follow the C++ standard's rule for linkage of enumerators: they have
Richard Smith [Fri, 13 Nov 2015 03:52:13 +0000 (03:52 +0000)]
[modules] Follow the C++ standard's rule for linkage of enumerators: they have
the linkage of the enumeration. For enumerators of unnamed enumerations, extend
the -Wmodules-ambiguous-internal-linkage extension to allow selecting an
arbitrary enumerator (but only if they all have the same value, otherwise it's
ambiguous).

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

8 years ago[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install desti...
Argyrios Kyrtzidis [Fri, 13 Nov 2015 01:46:18 +0000 (01:46 +0000)]
[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install destination of c-index-test and the libclang headers.

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

8 years agoFix build
Jonathan Roelofs [Fri, 13 Nov 2015 01:23:40 +0000 (01:23 +0000)]
Fix build

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

8 years agoAdd support for function attribute 'disable_tail_calls'.
Akira Hatanaka [Fri, 13 Nov 2015 00:42:21 +0000 (00:42 +0000)]
Add support for function attribute 'disable_tail_calls'.

The ``disable_tail_calls`` attribute instructs the backend to not
perform tail call optimization inside the marked function.

For example,

int callee(int);

int foo(int a) __attribute__((disable_tail_calls)) {
  return callee(a); // This call is not tail-call optimized.
}

Note that this attribute is different from 'not_tail_called', which
prevents tail-call optimization to the marked function.

rdar://problem/8973573

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

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

8 years ago[scan-build] Create share directory similar to scan-view's
Jonathan Roelofs [Fri, 13 Nov 2015 00:32:54 +0000 (00:32 +0000)]
[scan-build] Create share directory similar to scan-view's

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

8 years ago[scan-view] Rename 'Resources' --> 'share'
Jonathan Roelofs [Fri, 13 Nov 2015 00:25:04 +0000 (00:25 +0000)]
[scan-view] Rename 'Resources' --> 'share'

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

8 years agoclang/test/Driver/mips-mti-linux.c: Remove XFAIL. It shouldn't fail for targeting...
NAKAMURA Takumi [Thu, 12 Nov 2015 23:56:37 +0000 (23:56 +0000)]
clang/test/Driver/mips-mti-linux.c: Remove XFAIL. It shouldn't fail for targeting win32.

I will remove REQUIRES later.

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

8 years agoRemove -Wobjc-weak-compat; there isn't a compelling use case for this.
John McCall [Thu, 12 Nov 2015 23:39:39 +0000 (23:39 +0000)]
Remove -Wobjc-weak-compat; there isn't a compelling use case for this.

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

8 years agoAvoid duplicated diagnostic when lookup for a nested-name-specifier fails due to...
Richard Smith [Thu, 12 Nov 2015 22:40:09 +0000 (22:40 +0000)]
Avoid duplicated diagnostic when lookup for a nested-name-specifier fails due to ambiguity.

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

8 years agoMark clang/test/Driver/ms-bitfields.c as REQUIRES:clang-driver.
NAKAMURA Takumi [Thu, 12 Nov 2015 22:25:38 +0000 (22:25 +0000)]
Mark clang/test/Driver/ms-bitfields.c as REQUIRES:clang-driver.

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

8 years ago[modules] Simplify and generalize the existing rule for finding hidden
Richard Smith [Thu, 12 Nov 2015 22:19:45 +0000 (22:19 +0000)]
[modules] Simplify and generalize the existing rule for finding hidden
declarations in redeclaration lookup. A declaration is now visible to
lookup if:

 * It is visible (not in a module, or in an imported module), or
 * We're doing redeclaration lookup and it's externally-visible, or
 * We're doing typo correction and looking for unimported decls.

We now support multiple modules having different internal-linkage or no-linkage
definitions of the same name for all entities, not just for functions,
variables, and some typedefs. As previously, if multiple such entities are
visible, any attempt to use them will result in an ambiguity error.

This patch fixes the linkage calculation for a number of entities where we
previously didn't need to get it right (using-declarations, namespace aliases,
and so on).  It also classifies enumerators as always having no linkage, which
is a slight deviation from the C++ standard's definition, but not an observable
change outside modules (this change is being discussed on the -core reflector
currently).

This also removes the prior special case for tag lookup, which made some cases
of this work, but also led to bizarre, bogus "must use 'struct' to refer to type
'Foo' in this scope" diagnostics in C++.

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

8 years agoDR407: Rationalize how we handle tags being hidden by typedefs. Even with
Richard Smith [Thu, 12 Nov 2015 22:04:34 +0000 (22:04 +0000)]
DR407: Rationalize how we handle tags being hidden by typedefs. Even with
DR407, the C++ standard doesn't really say how this should work. Here's what we
do (which is consistent with DR407 as far as I can tell):

 * When performing name lookup for an elaborated-type-specifier, a tag
   declaration hides a typedef declaration that names the same type.
 * When performing any other kind of lookup, a typedef declaration hides
   a tag declaration that names the same type.

In any other case where lookup finds both a typedef and a tag (that is, when
they name different types), the lookup will be ambiguous. If lookup finds a
tag and a typedef that name the same type, and finds anything else, the lookup
will always be ambiguous (even if the other entity would hide the tag, it does
not also hide the typedef).

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

8 years agoRevert r240335.
Richard Smith [Thu, 12 Nov 2015 21:55:58 +0000 (21:55 +0000)]
Revert r240335.

This failed to solve the problem it was aimed at, and introduced just as many
issues as it resolved. Realistically, we need to deal with the possibility that
multiple modules might define different internal linkage symbols with the same
name, and this isn't a problem unless two such symbols are simultaneously
visible.

The case where two modules define equivalent internal linkage symbols is
handled by r252063: if lookup finds multiple sufficiently-similar entities from
different modules, we just pick one of them as an extension (but we keep them
separate).

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

8 years agoAdditional tests from r252690 that I forgot to 'svn add'.
Richard Smith [Thu, 12 Nov 2015 21:42:39 +0000 (21:42 +0000)]
Additional tests from r252690 that I forgot to 'svn add'.

From a patch by Nicholas Allegra!

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

8 years agoCorrect atomic libcall support for __atomic_*_fetch builtins.
James Y Knight [Thu, 12 Nov 2015 18:37:29 +0000 (18:37 +0000)]
Correct atomic libcall support for __atomic_*_fetch builtins.

In r244063, I had caused these builtins to call the same-named library
functions, __atomic_*_fetch_SIZE. However, this was incorrect: while
those functions are in fact supported by GCC's libatomic, they're not
documented by the spec (and gcc doesn't ever call them).

Instead, you're /supposed/ to call the __atomic_fetch_* builtins and
then redo the operation inline to return the final value.

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

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

8 years agoAdd support for driver option -mno-ms-bitfields.
Akira Hatanaka [Thu, 12 Nov 2015 17:21:22 +0000 (17:21 +0000)]
Add support for driver option -mno-ms-bitfields.

This option is used to cancel -mms-bitfields on the command line.

rdar://problem/15898553

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

8 years agoCull non-standard variants of ARM architectures (NFC)
Artyom Skrobov [Thu, 12 Nov 2015 15:52:02 +0000 (15:52 +0000)]
Cull non-standard variants of ARM architectures (NFC)

Summary: Clang-side update, corresponding to D14577

Reviewers: rengolin

Subscribers: aemerson, cfe-commits, rengolin

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

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

8 years ago[C++] Add the "norecurse" attribute to main() if in C++ mode
James Molloy [Thu, 12 Nov 2015 15:36:04 +0000 (15:36 +0000)]
[C++] Add the "norecurse" attribute to main() if in C++ mode

The C++ spec (3.6.1.3) says "The function `main` shall not be used within a program". This implies that it cannot recurse, so add the norecurse attribute to help the midend out a bit.

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

8 years agoRe-recommit: Add support for the new mips-mti-linux toolchain.
Vasileios Kalintiris [Thu, 12 Nov 2015 15:26:54 +0000 (15:26 +0000)]
Re-recommit: Add support for the new mips-mti-linux toolchain.

Last time, this caused two Windows buildbots and a single ARM buildbot to fail.
I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM
buildbot complains again.

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

8 years agoSilencing an MSVC warning about linkage specifications and C-incompatible UDTs by...
Aaron Ballman [Thu, 12 Nov 2015 15:25:06 +0000 (15:25 +0000)]
Silencing an MSVC warning about linkage specifications and C-incompatible UDTs by moving a function definition out of an extern "C" block.

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

8 years agoFix c-index-test install path
Ismail Donmez [Thu, 12 Nov 2015 13:47:35 +0000 (13:47 +0000)]
Fix c-index-test install path

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