]> granicus.if.org Git - clang/log
clang
9 years agoDon't crash when a reserved global placement operator new is paired
John McCall [Tue, 29 Sep 2015 23:55:17 +0000 (23:55 +0000)]
Don't crash when a reserved global placement operator new is paired
with a non-reserved operator delete in a new-expression.

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

9 years agoMove functions declared in ExprObjC.h into ExprObjC.cpp.
James Y Knight [Tue, 29 Sep 2015 22:28:44 +0000 (22:28 +0000)]
Move functions declared in ExprObjC.h into ExprObjC.cpp.

r51703 back in 2008 split out all the ObjC Expr subclasses from Expr.h
to a new ExprObjC.h file, but failed to also split the implementation
from Expr.cpp to ExprObjC.cpp. Do so, finally, for readability's sake.

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

9 years agoFix Clang-tidy modernize-use-nullptr warnings in headers and generated files; other...
Hans Wennborg [Tue, 29 Sep 2015 20:56:43 +0000 (20:56 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in headers and generated files; other minor cleanups.

By Eugene Zelenko!

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

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

9 years agoCGDebugInfo: Don't reuse a reference into a DenseMap if the DenseMap may
Adrian Prantl [Tue, 29 Sep 2015 20:44:46 +0000 (20:44 +0000)]
CGDebugInfo: Don't reuse a reference into a DenseMap if the DenseMap may
be modified in between. (NFC)

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

9 years agoForgot to remove a FIXME that has been fixed. NFC.
Nemanja Ivanovic [Tue, 29 Sep 2015 18:20:59 +0000 (18:20 +0000)]
Forgot to remove a FIXME that has been fixed. NFC.

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

9 years agoAddition of interfaces the FE to conform to Table A-2 of ELF V2 ABI V1.1
Nemanja Ivanovic [Tue, 29 Sep 2015 18:13:34 +0000 (18:13 +0000)]
Addition of interfaces the FE to conform to Table A-2 of ELF V2 ABI V1.1

This patch corresponds to review:
http://reviews.llvm.org/D13190

Implemented the following interfaces to conform to ELF V2 ABI version 1.1.

vector signed __int128 vec_adde (vector signed __int128, vector signed __int128, vector signed __int128);
vector unsigned __int128 vec_adde (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);
vector signed __int128 vec_addec (vector signed __int128, vector signed __int128, vector signed __int128);
vector unsigned __int128 vec_addec (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);
vector signed int vec_addc(vector signed int __a, vector signed int __b);
vector bool char vec_cmpge (vector signed char __a, vector signed char __b);
vector bool char vec_cmpge (vector unsigned char __a, vector unsigned char __b);
vector bool short vec_cmpge (vector signed short __a, vector signed short __b);
vector bool short vec_cmpge (vector unsigned short __a, vector unsigned short __b);
vector bool int vec_cmpge (vector signed int __a, vector signed int __b);
vector bool int vec_cmpge (vector unsigned int __a, vector unsigned int __b);
vector bool char vec_cmple (vector signed char __a, vector signed char __b);
vector bool char vec_cmple (vector unsigned char __a, vector unsigned char __b);
vector bool short vec_cmple (vector signed short __a, vector signed short __b);
vector bool short vec_cmple (vector unsigned short __a, vector unsigned short __b);
vector bool int vec_cmple (vector signed int __a, vector signed int __b);
vector bool int vec_cmple (vector unsigned int __a, vector unsigned int __b);
vector double vec_double (vector signed long long __a);
vector double vec_double (vector unsigned long long __a);
vector bool char vec_eqv(vector bool char __a, vector bool char __b);
vector bool short vec_eqv(vector bool short __a, vector bool short __b);
vector bool int vec_eqv(vector bool int __a, vector bool int __b);
vector bool long long vec_eqv(vector bool long long __a, vector bool long long __b);
vector signed short vec_madd(vector signed short __a, vector signed short __b, vector signed short __c);
vector signed short vec_madd(vector signed short __a, vector unsigned short __b, vector unsigned short __c);
vector signed short vec_madd(vector unsigned short __a, vector signed short __b, vector signed short __c);
vector unsigned short vec_madd(vector unsigned short __a, vector unsigned short __b, vector unsigned short __c);
vector bool long long vec_mergeh(vector bool long long __a, vector bool long long __b);
vector bool long long vec_mergel(vector bool long long __a, vector bool long long __b);
vector bool char vec_nand(vector bool char __a, vector bool char __b);
vector bool short vec_nand(vector bool short __a, vector bool short __b);
vector bool int vec_nand(vector bool int __a, vector bool int __b);
vector bool long long vec_nand(vector bool long long __a, vector bool long long __b);
vector bool char vec_orc(vector bool char __a, vector bool char __b);
vector bool short vec_orc(vector bool short __a, vector bool short __b);
vector bool int vec_orc(vector bool int __a, vector bool int __b);
vector bool long long vec_orc(vector bool long long __a, vector bool long long __b);
vector signed long long vec_sub(vector signed long long __a, vector signed long long __b);
vector signed long long vec_sub(vector bool long long __a, vector signed long long __b);
vector signed long long vec_sub(vector signed long long __a, vector bool long long __b);
vector unsigned long long vec_sub(vector unsigned long long __a, vector unsigned long long __b);
vector unsigned long long vec_sub(vector bool long long __a, vector unsigned long long __b);
vector unsigned long long vec_sub(vector unsigned long long __V2 ABI V1.1

http://ror float vec_sub(vector float __a, vector float __b);
unsigned char vec_extract(vector bool char __a, int __b);
signed short vec_extract(vector signed short __a, int __b);
unsigned short vec_extract(vector bool short __a, int __b);
signed int vec_extract(vector signed int __a, int __b);
unsigned int vec_extract(vector bool int __a, int __b);
signed long long vec_extract(vector signed long long __a, int __b);
unsigned long long vec_extract(vector unsigned long long __a, int __b);
unsigned long long vec_extract(vector bool long long __a, int __b);
double vec_extract(vector double __a, int __b);
vector bool char vec_insert(unsigned char __a, vector bool char __b, int __c);
vector signed short vec_insert(signed short __a, vector signed short __b, int __c);
vector bool short vec_insert(unsigned short __a, vector bool short __b, int __c);
vector signed int vec_insert(signed int __a, vector signed int __b, int __c);
vector bool int vec_insert(unsigned int __a, vector bool int __b, int __c);
vector signed long long vec_insert(signed long long __a, vector signed long long __b, int __c);
vector unsigned long long vec_insert(unsigned long long __a, vector unsigned long long __b, int __c);
vector bool long long vec_insert(unsigned long long __a, vector bool long long __b, int __c);
vector double vec_insert(double __a, vector double __b, int __c);
vector signed long long vec_splats(signed long long __a);
vector unsigned long long vec_splats(unsigned long long __a);
vector signed __int128 vec_splats(signed __int128 __a);
vector unsigned __int128 vec_splats(unsigned __int128 __a);
vector double vec_splats(double __a);
int vec_all_eq(vector double __a, vector double __b);
int vec_all_ge(vector double __a, vector double __b);
int vec_all_gt(vector double __a, vector double __b);
int vec_all_le(vector double __a, vector double __b);
int vec_all_lt(vector double __a, vector double __b);
int vec_all_nan(vector double __a);
int vec_all_ne(vector double __a, vector double __b);
int vec_all_nge(vector double __a, vector double __b);
int vec_all_ngt(vector double __a, vector double __b);
int vec_any_eq(vector double __a, vector double __b);
int vec_any_ge(vector double __a, vector double __b);
int vec_any_gt(vector double __a, vector double __b);
int vec_any_le(vector double __a, vector double __b);
int vec_any_lt(vector double __a, vector double __b);
int vec_any_ne(vector double __a, vector double __b);
vector unsigned char vec_sbox_be (vector unsigned char);
vector unsigned char vec_cipher_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_cipherlast_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_ncipher_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_ncipherlast_be (vector unsigned char, vector unsigned char);
vector unsigned int vec_shasigma_be (vector unsigned int, const int, const int);
vector unsigned long long vec_shasigma_be (vector unsigned long long, const int, const int);
vector unsigned short vec_pmsum_be (vector unsigned char, vector unsigned char);
vector unsigned int vec_pmsum_be (vector unsigned short, vector unsigned short);
vector unsigned long long vec_pmsum_be (vector unsigned int, vector unsigned int);
vector unsigned __int128 vec_pmsum_be (vector unsigned long long, vector unsigned long long);
vector unsigned char vec_gb (vector unsigned char);
vector unsigned long long vec_bperm (vector unsigned __int128 __a, vector unsigned char __b);

Removed the folowing interfaces either because their signatures have changed
in version 1.1 of the ABI or because they were implemented for ELF V2 ABI but
have actually been deprecated in version 1.1.

vector signed char vec_eqv(vector bool char __a, vector signed char __b);
vector signed char vec_eqv(vector signed char __a, vector bool char __b);
vector unsigned char vec_eqv(vector bool char __a, vector unsigned char __b);
vector unsigned char vec_eqv(vector unsigned char __a, vector bool char __b);
vector signed short vec_eqv(vector bool short __a, vector signed short __b);
vector signed short vec_eqv(vector signed short __a, vector bool short __b);
vector unsigned short vec_eqv(vector bool short __a, vector unsigned short __b);
vector unsigned short vec_eqv(vector unsigned short __a, vector bool short __b);
vector signed int vec_eqv(vector bool int __a, vector signed int __b);
vector signed int vec_eqv(vector signed int __a, vector bool int __b);
vector unsigned int vec_eqv(vector bool int __a, vector unsigned int __b);
vector unsigned int vec_eqv(vector unsigned int __a, vector bool int __b);
vector signed long long vec_eqv(vector bool long long __a, vector signed long long __b);
vector signed long long vec_eqv(vector signed long long __a, vector bool long long __b);
vector unsigned long long vec_eqv(vector bool long long __a, vector unsigned long long __b);
vector unsigned long long vec_eqv(vector unsigned long long __a, vector bool long long __b);
vector float vec_eqv(vector bool int __a, vector float __b);
vector float vec_eqv(vector float __a, vector bool int __b);
vector double vec_eqv(vector bool long long __a, vector double __b);
vector double vec_eqv(vector double __a, vector bool long long __b);
vector unsigned short vec_nand(vector bool short __a, vector unsigned short __b);

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

9 years agoAdded MSVC natvis visualizers for Type and QualType. These could probably be improved...
Aaron Ballman [Tue, 29 Sep 2015 17:32:36 +0000 (17:32 +0000)]
Added MSVC natvis visualizers for Type and QualType. These could probably be improved, but anything is better than staring at hex values in the debugger.

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

9 years agoFix typo.
Yaron Keren [Tue, 29 Sep 2015 16:51:08 +0000 (16:51 +0000)]
Fix typo.

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

9 years agoThread Safety Analysis: allow capability attribute on unions.
DeLesley Hutchins [Tue, 29 Sep 2015 16:24:18 +0000 (16:24 +0000)]
Thread Safety Analysis: allow capability attribute on unions.

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

9 years agoThread Safety Analysis: fix before/after checks so that they work on global
DeLesley Hutchins [Tue, 29 Sep 2015 15:25:51 +0000 (15:25 +0000)]
Thread Safety Analysis:  fix before/after checks so that they work on global
variables as well member variables.

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

9 years agoclang-format: Add a new brace style "custom" as well as flags to
Daniel Jasper [Tue, 29 Sep 2015 14:57:55 +0000 (14:57 +0000)]
clang-format: Add a new brace style "custom" as well as flags to
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expanded upon
calling the reformat function.

All presets have been chose to keep the existing formatting, so there
shouldn't be any difference in formatting behavior.

Also change the dump_format_style.py to properly document the nested
structs that are used to keep these flags discoverable among all the
configuration flags.

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

9 years agoclang-format: Extend #include sorting functionality
Daniel Jasper [Tue, 29 Sep 2015 07:53:08 +0000 (07:53 +0000)]
clang-format: Extend #include sorting functionality

Recognize the main module header as well as different #include categories.
This should now mimic the behavior of llvm/utils/sort_includes.py as
well as clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp very
closely.

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

9 years agoRevert part of r248776. One of the changes worked on my local build, but not on the...
Craig Topper [Tue, 29 Sep 2015 05:08:30 +0000 (05:08 +0000)]
Revert part of r248776. One of the changes worked on my local build, but not on the bots.

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

9 years agoSimplify or remove calls to makeArrayRef based on feedback from David Blaikie. NFC.
Craig Topper [Tue, 29 Sep 2015 04:53:28 +0000 (04:53 +0000)]
Simplify or remove calls to makeArrayRef based on feedback from David Blaikie. NFC.

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

9 years agoHonor the casted-to alignment of an explicit cast even when
John McCall [Tue, 29 Sep 2015 04:37:40 +0000 (04:37 +0000)]
Honor the casted-to alignment of an explicit cast even when
Sema thinks the cast is a no-op, as it does when (e.g.) the
only thing that changes is an alignment attribute.

Fixed PR24944.

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

9 years agoRemove 'const' from some ArrayRef arguments since they're passed by value anyway...
Craig Topper [Tue, 29 Sep 2015 04:30:07 +0000 (04:30 +0000)]
Remove 'const' from some ArrayRef arguments since they're passed by value anyway. NFC

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

9 years agoPass ArrayRef by value. NFC.
Craig Topper [Tue, 29 Sep 2015 04:30:05 +0000 (04:30 +0000)]
Pass ArrayRef by value. NFC.

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

9 years ago[OPENMP 4.1] Codegen for ‘simd’ clause in ‘ordered’ directive.
Alexey Bataev [Tue, 29 Sep 2015 03:48:57 +0000 (03:48 +0000)]
[OPENMP 4.1] Codegen for ‘simd’ clause in ‘ordered’ directive.
Description.
If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered regions in the order of the loop iterations.
Restrictions.
An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region.

An ordered directive with ‘simd’ clause is generated as an outlined function and corresponding function call to prevent this part of code from vectorization later in backend.

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

9 years agoUnique-pointerify these pointers an plug a memory leak.
Adrian Prantl [Mon, 28 Sep 2015 23:56:10 +0000 (23:56 +0000)]
Unique-pointerify these pointers an plug a memory leak.
Thanks to echristo for noticing!

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

9 years agoRemove the only use of LookupResult's implicit copy ctor
David Blaikie [Mon, 28 Sep 2015 23:48:55 +0000 (23:48 +0000)]
Remove the only use of LookupResult's implicit copy ctor

LookupResult should not be copyable, it's not readily copyable and can
only be copied when it's in specific states (in a query state, without
any results, basically). Instead, just extract the /query/ state and
pass that across the copy boundary, then build a new LookupResult on the
other side.

I wonder if a better API (one in which the query state is separate from
the result state - essentialyl making QueryState a first class part of
the Lookup API - pass a QueryState, get a LookupResult, rather than
mutating the LookupResult in place (LookupResult could contain a
QueryState if it's particularly helpful to be able to observe the query
parameters while also examining the result)) might be a good idea here.

Future patches will probably make LookupResult actually non-copyable
(transition the CXXBasePaths to unique_ptr, for example) and hopefully
we'll enable -Wdeprecated in LLVM soon to avoid issues like this.

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

9 years agoAdd an explicitly defaulted copy ctor (and FIXME) to Command since its copy ctor...
David Blaikie [Mon, 28 Sep 2015 23:48:52 +0000 (23:48 +0000)]
Add an explicitly defaulted copy ctor (and FIXME) to Command since its copy ctor is currently used (and actually slices derived objects... ) in some diagnostics handling.

Justin mentioned he'd look into this.

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

9 years agoRemove trivial dtor that was making uses of the copy ctor -Wdeprecated unclean
David Blaikie [Mon, 28 Sep 2015 23:48:49 +0000 (23:48 +0000)]
Remove trivial dtor that was making uses of the copy ctor -Wdeprecated unclean

And also remove an unused variable that's now diagnosed by
-Wunused-variable since the dtor is now trivial.

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

9 years ago[CUDA] 32-bit NVPTX should have 32-bit long type.
Artem Belevich [Mon, 28 Sep 2015 22:54:08 +0000 (22:54 +0000)]
[CUDA] 32-bit NVPTX should have 32-bit long type.

Currently it's 64-bit which will lead to mismatch between host and
device code if we compile for i386.

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

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

9 years agoGenerate assume loads only with -fstrict-vtable-pointers
Piotr Padlewski [Mon, 28 Sep 2015 20:30:22 +0000 (20:30 +0000)]
Generate assume loads only with -fstrict-vtable-pointers

Temporary fix till InstCombine and other possible passes will be
efficient to handle multiple assumes.

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

9 years agoclang-format: [JS] Support pseudo-keywords
Daniel Jasper [Mon, 28 Sep 2015 14:29:45 +0000 (14:29 +0000)]
clang-format: [JS] Support pseudo-keywords

JavaScript allows keywords to appear in IdenfierName positions, e.g.
fields, or object literal members, but not as plain identifiers.

Patch by Martin Probst. Thank you!

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

9 years agoclang-format: [JS] handle let (ES6)
Daniel Jasper [Mon, 28 Sep 2015 14:28:08 +0000 (14:28 +0000)]
clang-format: [JS] handle let (ES6)

Patch by Martin Probst. Thank you!

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

9 years ago[OPENMP 4.1] Add 'simd' clause for 'ordered' directive.
Alexey Bataev [Mon, 28 Sep 2015 06:39:35 +0000 (06:39 +0000)]
[OPENMP 4.1] Add 'simd' clause for 'ordered' directive.
Parsing and sema analysis for 'simd' clause in 'ordered' directive.
Description
If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered
regions in the order of the loop iterations.
Restrictions
An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region

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

9 years agoUse llvm::makeArrayRef. NFC.
Craig Topper [Sun, 27 Sep 2015 03:44:08 +0000 (03:44 +0000)]
Use llvm::makeArrayRef. NFC.

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

9 years agoclang/test/Driver/arm-compiler-rt.c: Relax expressions for dos path.
NAKAMURA Takumi [Sat, 26 Sep 2015 11:17:32 +0000 (11:17 +0000)]
clang/test/Driver/arm-compiler-rt.c: Relax expressions for dos path.

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

9 years agoRevert part of r248660 as using None didn't work with the ArrayRef being returned...
Craig Topper [Sat, 26 Sep 2015 05:42:17 +0000 (05:42 +0000)]
Revert part of r248660 as using None didn't work with the ArrayRef being returned as an Optional.

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

9 years agoUse None to avoid re-mentioning the ArrayRef type to call the default constructor.
Craig Topper [Sat, 26 Sep 2015 05:22:17 +0000 (05:22 +0000)]
Use None to avoid re-mentioning the ArrayRef type to call the default constructor.

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

9 years agoRemove move constructor and assignment operator from SourceMappingRegion. The types...
Craig Topper [Sat, 26 Sep 2015 05:10:16 +0000 (05:10 +0000)]
Remove move constructor and assignment operator from SourceMappingRegion. The types of the fields are trivially copyable. NFC

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

9 years agoFix a couple other places that were returning SourceLocation by reference. NFC
Craig Topper [Sat, 26 Sep 2015 05:10:14 +0000 (05:10 +0000)]
Fix a couple other places that were returning SourceLocation by reference. NFC

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

9 years agoDriver: support ARM/HF on a single toolchain
Saleem Abdulrasool [Sat, 26 Sep 2015 03:26:44 +0000 (03:26 +0000)]
Driver: support ARM/HF on a single toolchain

ARM EABI adds target attributes to the object file.  Amongst the attributes that
are emitted is the VFP argument passing (Hard vs Soft).  The linker is
responsible for checking these attributes and erroring on mismatches.  This
causes problems for the compiler-rt builtins when targeting both hard and
soft.  Because both of these options name the builtins compiler-rt component
the same (libclang_rt.builtins-arm.a or libclang_rt.builtins-arm-android).  GCC
is able to get away with this as it does one target per toolchain.  This
changes the naming convention for the ARM compiler-rt builtins to differentiate
between HF and Soft.  Although this means that compiler-rt may be duplicated, it
enables supporting both variants from a single toolchain.  A similar approach is
taken by the Darwin toolchain, naming the library to differentiate between the
calling conventions.

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

9 years agoReplace a loop and temporary string copying with llvm::join.
Eric Christopher [Sat, 26 Sep 2015 01:25:08 +0000 (01:25 +0000)]
Replace a loop and temporary string copying with llvm::join.

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

9 years agoChange arc-cxx11-init-list.mm to work with upcoming SCEV changes.
Sanjoy Das [Fri, 25 Sep 2015 23:07:11 +0000 (23:07 +0000)]
Change arc-cxx11-init-list.mm to work with upcoming SCEV changes.

Summary:
The store being checked for in arc-cxx11-init-list.mm is a store to an
unescaped alloca.  After an uncoming change to ScalarEvolution, LLVM is
able to elide the store, so adjust the test accordingly.

Reviewers: compnerd

Subscribers: cfe-commits

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

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

9 years agoRelax test to allow for __attribute__((thiscall)). Under Win32 c-index-test output is
Yaron Keren [Fri, 25 Sep 2015 22:09:07 +0000 (22:09 +0000)]
Relax test to allow for __attribute__((thiscall)). Under Win32 c-index-test output is

CXXMethod=foo:4:7 (unavailable) [type=int () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0]
CXXConstructor=Foo:5:3 (unavailable) [type=void () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]

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

9 years agoFix bug on reporting availability of deleted methods in libclang.
Manuel Klimek [Fri, 25 Sep 2015 17:53:16 +0000 (17:53 +0000)]
Fix bug on reporting availability of deleted methods in libclang.

Patch by Sergey Kalinichev.

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

9 years agoMake incomplete type errors better with enable_if
George Burgess IV [Fri, 25 Sep 2015 17:53:16 +0000 (17:53 +0000)]
Make incomplete type errors better with enable_if

This patch fixes the order in which we evaluate the different ways that
a function call could be disallowed. Now, if you call a non-overloaded
function with an incomplete type and failing enable_if, we'll prioritize
reporting the more obvious error (use of incomplete type) over reporting
the failing enable_if.

Thanks to Ettore Speziale for the patch!

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

9 years agoThe Clang gcc-compatible driver (clang/tools/driver/driver.cpp) has some
Eric Christopher [Fri, 25 Sep 2015 17:44:31 +0000 (17:44 +0000)]
The Clang gcc-compatible driver (clang/tools/driver/driver.cpp) has some
logic to select an alternate target based on the executable it was
called as. For instance, if you symlink i686-linux-android-gcc to clang
and invoke it, the driver will act as though it were called with another
argument ("-target i686-linux-android"). This leads to visible effects
even in syntax-only compilations (like the ANDROID preprocessor symbol
being defined).

This behavior is not replicated for tool invocations--for instance,
clang::createInvocationFromCommandLine will not choose an alternate
target based on ArgList[0]. This means that configurations stored in
compilation databases aren't accurately replayed.

This patch separates the logic for selecting a mode flag and target from
the executable name into a new member function on ToolChain. It should
have no functional effects (but will allow other code to reuse the
target/mode selection logic).

Patch by Luke Zarko!

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

9 years agoRevert "This patch adds missing pieces to clang, including the PS4 toolchain definiti...
Greg Bedwell [Fri, 25 Sep 2015 16:11:00 +0000 (16:11 +0000)]
Revert "This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler."

This reverts commit r248546 to get our bot green again while we discuss the best way forward.

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

9 years ago[OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.
Alexey Bataev [Fri, 25 Sep 2015 10:37:12 +0000 (10:37 +0000)]
[OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.
OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'.
If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations.
The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive.

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

9 years agoNew test ps4-linker-win.c (added in r48546) is causing problems for Windows bots...
Ekaterina Romanova [Fri, 25 Sep 2015 09:10:33 +0000 (09:10 +0000)]
New test ps4-linker-win.c (added in r48546) is causing problems for Windows bots. I'm deleting this file during investigation.

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

9 years agoThis patch adds missing pieces to clang, including the PS4 toolchain
Ekaterina Romanova [Thu, 24 Sep 2015 22:06:52 +0000 (22:06 +0000)]
This patch adds missing pieces to clang, including the PS4 toolchain
definition, added warnings, PS4 defaults, and Driver changes needed for
our compiler.

A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova!

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

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

9 years agoMove the darwin define static function to be close to the OS define.
Eric Christopher [Thu, 24 Sep 2015 21:17:04 +0000 (21:17 +0000)]
Move the darwin define static function to be close to the OS define.

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

9 years agoUse just one larger anonymous namespace instead of a lot of smaller ones.
Eric Christopher [Thu, 24 Sep 2015 21:17:02 +0000 (21:17 +0000)]
Use just one larger anonymous namespace instead of a lot of smaller ones.

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

9 years agofix typos; NFC
Sanjay Patel [Thu, 24 Sep 2015 21:11:52 +0000 (21:11 +0000)]
fix typos; NFC

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

9 years agoRecommit r248154: [ARM] Handle DSP feature as an ArchExtKind
Artyom Skrobov [Thu, 24 Sep 2015 17:34:05 +0000 (17:34 +0000)]
Recommit r248154: [ARM] Handle DSP feature as an ArchExtKind

Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in
a hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME:
attached.

http://reviews.llvm.org/D12937 moved the handling of the DSP feature over to
ARMTargetParser.def in LLVM, to be in line with other architecture extensions.

This is the corresponding patch to clang, to clear the FIXME: and update
the tests.

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

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

9 years agoEnable SafeStack on all Linux platforms.
Evgeniy Stepanov [Thu, 24 Sep 2015 17:22:46 +0000 (17:22 +0000)]
Enable SafeStack on all Linux platforms.

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

9 years ago[analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire region.
Devin Coughlin [Thu, 24 Sep 2015 16:52:56 +0000 (16:52 +0000)]
[analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire region.

Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size
array fields. With this change, instead of invalidating the entire containing region the
analyzer now invalidates only offsets for the array itself when it can show that the
memcpy stays within the bounds of the array.

This addresses false positive memory leak warnings of the kind reported by
krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954

(This is the second attempt, now with assertion failures resolved.)

A patch by Pierre Gousseau!

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

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

9 years agoModule Debugging: Emit submodules as nested DW_TAG_modules.
Adrian Prantl [Thu, 24 Sep 2015 16:10:10 +0000 (16:10 +0000)]
Module Debugging: Emit submodules as nested DW_TAG_modules.

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

9 years agoDebug Info: Use the module pointer as key for the module cache.
Adrian Prantl [Thu, 24 Sep 2015 16:10:04 +0000 (16:10 +0000)]
Debug Info: Use the module pointer as key for the module cache.
This way we don't need to rebuild the full module name for every decl.

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

9 years agoRefactor ASTSourceDescriptor to not store copies of all strings. (NFC)
Adrian Prantl [Thu, 24 Sep 2015 16:10:00 +0000 (16:10 +0000)]
Refactor ASTSourceDescriptor to not store copies of all strings. (NFC)

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

9 years agoDrop useless const in for-range loops.
Benjamin Kramer [Thu, 24 Sep 2015 14:48:49 +0000 (14:48 +0000)]
Drop useless const in for-range loops.

StringRefs always point to immutable memory so the const doesn't add value
here. Also quiets clang's -Wrange-loop-analysis which warns about the implicit
copying.

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

9 years ago[Driver] Don't implicitly copy std::strings in for-range loop.
Benjamin Kramer [Thu, 24 Sep 2015 14:48:37 +0000 (14:48 +0000)]
[Driver] Don't implicitly copy std::strings in for-range loop.

Found by -Wrange-loop-analysis.

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

9 years ago[mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.
Daniel Sanders [Thu, 24 Sep 2015 10:22:17 +0000 (10:22 +0000)]
[mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.

Summary:
Strictly speaking, the MIPS*R2 ISA's should not permit -mnan=2008 since this
feature was added in MIPS*R3. However, other toolchains permit this and we
should do the same.

Reviewers: atanasyan

Subscribers: cfe-commits

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

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

9 years ago[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="
Vladimir Sukharev [Thu, 24 Sep 2015 10:06:44 +0000 (10:06 +0000)]
[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="

Fix of dangling StringRef after temporary std::string is destroyed

Follow-up to: http://reviews.llvm.org/rL248479

Reviewers: alexfh

Subscribers: cfe-commits

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

9 years ago[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="
Vladimir Sukharev [Thu, 24 Sep 2015 09:55:08 +0000 (09:55 +0000)]
[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="

Fix of dangling StringRef after temporary std::string is destroyed

Follow-up to: http://reviews.llvm.org/rL248370

Reviewers: alexfh

Subscribers: cfe-commits

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

9 years ago[Driver] Add support for Windows 10 SDK
Igor Kudrin [Thu, 24 Sep 2015 05:16:36 +0000 (05:16 +0000)]
[Driver] Add support for Windows 10 SDK

Summary:
With Windows 10 SDK, Include and Lib directories now contain an additional subfolder with the name that corresponds to the full version of the SDK, for example:
  - C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um
  - C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64

Reviewers: ruiu, rnk

Subscribers: majnemer, cfe-commits

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

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

9 years agocuda-path: StringRef cannot be used here.
NAKAMURA Takumi [Thu, 24 Sep 2015 03:15:44 +0000 (03:15 +0000)]
cuda-path: StringRef cannot be used here.

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

9 years agoclang/test/Analysis/malloc-overflow2.c: Appease 32-bit targets.
NAKAMURA Takumi [Thu, 24 Sep 2015 02:49:00 +0000 (02:49 +0000)]
clang/test/Analysis/malloc-overflow2.c: Appease 32-bit targets.

size_t is not unsigned long for targeting i686 (and Windows x64).

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

9 years agoMake a test a bit shorter. No behavior change.
Nico Weber [Thu, 24 Sep 2015 01:34:27 +0000 (01:34 +0000)]
Make a test a bit shorter. No behavior change.

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

9 years agoImprove the printing of ranges when macros are involved.
Richard Trieu [Thu, 24 Sep 2015 01:21:01 +0000 (01:21 +0000)]
Improve the printing of ranges when macros are involved.

Trace the ranges through the macro backtrace better.  This allows better
range highlighting through all levels of the macro bracktrace.  Also some
improvements to backtrace printer for omitting different backtraces.

Patch by Zhengkai Wu.

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

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

9 years agoDisabled one of the test runs in cuda-detect.cu
Artem Belevich [Thu, 24 Sep 2015 00:15:47 +0000 (00:15 +0000)]
Disabled one of the test runs in cuda-detect.cu

--sysroot apparently can't handle long paths which triggers test
failure on some platforms.

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

9 years ago[analyzer] Discard malloc-overflow bug-report when a known size is malloc'ed.
Devin Coughlin [Wed, 23 Sep 2015 23:27:55 +0000 (23:27 +0000)]
[analyzer] Discard malloc-overflow bug-report when a known size is malloc'ed.

This patch ignores malloc-overflow bug in two cases:
Case1:
x = a/b; where n < b
malloc (x*n); Then x*n will not overflow.

Case2:
x = a; // when 'a' is a known value.
malloc (x*n);

Also replaced isa with dyn_cast.

Reject multiplication by zero cases in MallocOverflowSecurityChecker
Currently MallocOverflowSecurityChecker does not catch cases like:
malloc(n * 0 * sizeof(int));

This patch rejects such cases.

Two test cases added. malloc-overflow2.c has an example inspired from a code
in linux kernel where the current checker flags a warning while it should not.

A patch by Aditya Kumar!

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

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

9 years ago[darwin] [builtins] Stop generating cc_kext_ios5 and move iOS architectures out of...
Chris Bieneman [Wed, 23 Sep 2015 22:52:35 +0000 (22:52 +0000)]
[darwin] [builtins] Stop generating cc_kext_ios5 and move iOS architectures out of cc_kext into cc_kext_ios

Summary:
This corresponds to a patch to compiler-rt (D13112).

Xcode 7 doesn't support targeting iOS5 and earlier. Instead of just dropping cc_kext_ios5, I've repurposed it to cc_kext_ios, and I'm pulling the iOS architectures out of cc_kext. Putting OS X and iOS slices inside the same archive was just odd.

Reviewers: bogner, bob.wilson

Subscribers: cfe-commits

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

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

9 years agoForbid qualifiers on ObjC generic parameters and arguments, but
John McCall [Wed, 23 Sep 2015 22:14:21 +0000 (22:14 +0000)]
Forbid qualifiers on ObjC generic parameters and arguments, but
silently ignore them on arguments when they're provided indirectly
(.e.g behind a template argument or typedef).

This is mostly just good language design --- specifying that a
generic argument is __weak doesn't actually do anything --- but
it also prevents assertions when trying to apply a different
ownership qualifier.

rdar://21612439

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

9 years agoRemove warning on over-wide bit-field of boolean type; there's no risk that
Richard Smith [Wed, 23 Sep 2015 22:07:44 +0000 (22:07 +0000)]
Remove warning on over-wide bit-field of boolean type; there's no risk that
someone thought all the bits would be value bits in this case.

Also fix the wording of the warning -- it claimed that the width of 'bool' is
8, which is not correct; the width is 1 bit, whereas the size is 8 bits in our
implementation.

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

9 years ago[CUDA] Added CUDA installation detector class.
Artem Belevich [Wed, 23 Sep 2015 21:49:39 +0000 (21:49 +0000)]
[CUDA] Added CUDA installation detector class.

Added new option --cuda-path=<path> which allows
overriding default search paths.
If it's not specified we look for CUDA installation in
/usr/include/cuda and /usr/include/cuda-7.0.

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

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

9 years ago[analyzer] Improve localizability checks for iOS / OS X.
Devin Coughlin [Wed, 23 Sep 2015 21:43:21 +0000 (21:43 +0000)]
[analyzer] Improve localizability checks for iOS / OS X.

Various improvements to the localization checker:
* Adjusted copy to be consistent with diagnostic text in other Apple
  API checkers.
* Added in ~150 UIKit / AppKit methods that require localized strings in
  UnlocalizedStringsChecker.
* UnlocalizedStringChecker now checks for UI methods up the class hierarchy and
  UI methods that conform for a certain Objective-C protocol.
* Added in alpha version of PluralMisuseChecker and some regression tests. False
  positives are still not ideal.

(This is the second attempt, with the memory issues on Linux resolved.)

A patch by Kulpreet Chilana!

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

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

9 years agoPR14858: Initial support for proper sizeof... handling within alias templates.
Richard Smith [Wed, 23 Sep 2015 21:41:42 +0000 (21:41 +0000)]
PR14858: Initial support for proper sizeof... handling within alias templates.
This doesn't quite get alias template equivalence right yet, but handles the
egregious cases where we would silently give the wrong answers.

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

9 years agoRemove wrong implication that value-dependent implies instantiation-dependent,
Richard Smith [Wed, 23 Sep 2015 21:30:47 +0000 (21:30 +0000)]
Remove wrong implication that value-dependent implies instantiation-dependent,
and fix the only code that was depending on this so that it sets all the
relevant flags appropriately.

No functionality change intended.

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

9 years agoSupport linking against OpenMP runtime on NetBSD.
Joerg Sonnenberger [Wed, 23 Sep 2015 20:11:00 +0000 (20:11 +0000)]
Support linking against OpenMP runtime on NetBSD.

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

9 years agoPush OpenMP linker flags after linker input on Darwin. Don't add any
Joerg Sonnenberger [Wed, 23 Sep 2015 20:07:56 +0000 (20:07 +0000)]
Push OpenMP linker flags after linker input on Darwin. Don't add any
libraries if -nostdlib is specified. Test.

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

9 years agoReverted r248408 "[CUDA] Added CUDA installation detector class."
Artem Belevich [Wed, 23 Sep 2015 18:28:30 +0000 (18:28 +0000)]
Reverted r248408 "[CUDA] Added CUDA installation detector class."

because included test fails on some platforms.

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

9 years ago[CUDA] Added CUDA installation detector class.
Artem Belevich [Wed, 23 Sep 2015 18:13:25 +0000 (18:13 +0000)]
[CUDA] Added CUDA installation detector class.

Added new option --cuda-path=<path> which allows
overriding default search paths.
If it's not specified we look for CUDA installation in
/usr/include/cuda and /usr/include/cuda-7.0.

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

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

9 years ago[CUDA] __global__ functions should always be visible externally.
Artem Belevich [Wed, 23 Sep 2015 17:44:53 +0000 (17:44 +0000)]
[CUDA] __global__ functions should always be visible externally.

Adjust __global__ functions with DiscardableODR linkage to use
StrongODR linkage instead, so they are visible externally.

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

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

9 years ago[Lex] A source-file new-line in a raw string literal results in a new-line
David Majnemer [Wed, 23 Sep 2015 16:04:47 +0000 (16:04 +0000)]
[Lex] A source-file new-line in a raw string literal results in a new-line

Our string literal parser copied any source-file new-line characters
into the execution string-literal.  This is incorrect if the source-file
new-line character was a \r\n sequence because new-line characters are
merely \n.

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

9 years ago[Sema] Don't create an invalid source range for overlong initializer lists.
Benjamin Kramer [Wed, 23 Sep 2015 16:03:53 +0000 (16:03 +0000)]
[Sema] Don't create an invalid source range for overlong initializer lists.

We took both source locations from the end of the initializer list what
the code below doesn't expect. This can lead to a crash when rendering
the diagnostic (PR24816). Assert that we have more than one element in
a scalar initializer with too many elements.

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

9 years agoRefactor library decision for -fopenmp support from Darwin into a
Joerg Sonnenberger [Wed, 23 Sep 2015 14:06:52 +0000 (14:06 +0000)]
Refactor library decision for -fopenmp support from Darwin into a
function for sharing with other platforms.

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

9 years agoAdd -fplugin=name.so option to the driver
John Brawn [Wed, 23 Sep 2015 13:55:40 +0000 (13:55 +0000)]
Add -fplugin=name.so option to the driver

This translates to -load name.so in the cc1 command. We can't name the driver
option -load, as that means "link against oad", so instead we follow GCC's lead
and name the option -fplugin.

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

9 years ago[DeclPrinter] Don't crash when printing a using decl with a special name
Benjamin Kramer [Wed, 23 Sep 2015 13:43:16 +0000 (13:43 +0000)]
[DeclPrinter] Don't crash when printing a using decl with a special name

Fixes PR24872.

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

9 years agoFix bad iterator access.
Daniel Jasper [Wed, 23 Sep 2015 12:47:50 +0000 (12:47 +0000)]
Fix bad iterator access.

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

9 years ago[ARM] Fix crash "-target arm -mcpu=generic", without "-march="
Vladimir Sukharev [Wed, 23 Sep 2015 09:29:32 +0000 (09:29 +0000)]
[ARM] Fix crash "-target arm -mcpu=generic", without "-march="

An assertion hit has been fixed for cmdlines like

$ clang --target=arm-linux-gnueabi -mcpu=generic hello.c

Related to: http://reviews.llvm.org/rL245445

Reviewers: rengolin

Subscribers: cfe-commits

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

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

9 years agoclang-format: Add initial #include sorting capabilities.
Daniel Jasper [Wed, 23 Sep 2015 08:30:47 +0000 (08:30 +0000)]
clang-format: Add initial #include sorting capabilities.

To implement this nicely, add a function that merges two sets of
replacements that are meant to be done in sequence. This functionality
will also be useful for other applications, e.g. formatting the result
of clang-tidy fixes.

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

9 years agoMake ms-intrin.cpp test require the x86 target.
Nico Weber [Wed, 23 Sep 2015 00:24:34 +0000 (00:24 +0000)]
Make ms-intrin.cpp test require the x86 target.

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

9 years agoRevert "[analyzer] Improve localizability checks for iOS / OS X."
Devin Coughlin [Wed, 23 Sep 2015 00:17:52 +0000 (00:17 +0000)]
Revert "[analyzer] Improve localizability checks for iOS / OS X."

This reverts commit r248350. The pluralization checks are failing on some bots.

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

9 years ago[analyzer] Improve localizability checks for iOS / OS X.
Devin Coughlin [Tue, 22 Sep 2015 23:58:04 +0000 (23:58 +0000)]
[analyzer] Improve localizability checks for iOS / OS X.

Various improvements to the localization checker:
* Adjusted copy to be consistent with diagnostic text in other Apple
  API checkers.
* Added in ~150 UIKit / AppKit methods that require localized strings in
  UnlocalizedStringsChecker.
* UnlocalizedStringChecker now checks for UI methods up the class hierarchy and
  UI methods that conform for a certain Objective-C protocol.
* Added in alpha version of PluralMisuseChecker and some regression tests. False
  positives are still not ideal.

A patch by Kulpreet Chilana!

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

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

9 years agoModule Debugging: Use the clang module signature as the module's dwo_id
Adrian Prantl [Tue, 22 Sep 2015 23:26:43 +0000 (23:26 +0000)]
Module Debugging: Use the clang module signature as the module's dwo_id
when building a module. Clang already records the module signature when
building a skeleton CU to reference a clang module.

Matching the id in the skeleton with the one in the module allows a DWARF
consumer to verify that they found the correct version of the module
without them needing to know about the clang module format.

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

9 years agoSerialization: Let ASTWriter return the signature of the written module.
Adrian Prantl [Tue, 22 Sep 2015 23:26:31 +0000 (23:26 +0000)]
Serialization: Let ASTWriter return the signature of the written module.

NFC

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

9 years ago[analyzer] Make realloc(ptr, 0) handling equivalent to malloc(0).
Devin Coughlin [Tue, 22 Sep 2015 22:47:14 +0000 (22:47 +0000)]
[analyzer] Make realloc(ptr, 0) handling equivalent to malloc(0).

Currently realloc(ptr, 0) is treated as free() which seems to be not correct. C
standard (N1570) establishes equivalent behavior for malloc(0) and realloc(ptr,
0): "7.22.3 Memory management functions calloc, malloc, realloc: If the size of
the space requested is zero, the behavior is implementation-defined: either a
null pointer is  returned, or the behavior is as if the size were some nonzero
value, except that the returned pointer shall not be used to access an object."
The patch equalizes the processing of malloc(0) and realloc(ptr,0). The patch
also enables unix.Malloc checker to detect references to zero-allocated memory
returned by realloc(ptr,0) ("Use of zero-allocated memory" warning).

A patch by Антон Ярцев!

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

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

9 years ago[analyzer] Create one state for a range switch case instead of multiple.
Devin Coughlin [Tue, 22 Sep 2015 20:31:19 +0000 (20:31 +0000)]
[analyzer] Create one state for a range switch case instead of multiple.

This fixes PR16833, in which the analyzer was using large amounts of memory
for switch statements with large case ranges.

rdar://problem/14685772

A patch by Aleksei Sidorin!

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

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

9 years agoAnalyzer: Teach analyzer how to handle TypeTraitExpr
Ismail Pazarbasi [Tue, 22 Sep 2015 19:33:15 +0000 (19:33 +0000)]
Analyzer: Teach analyzer how to handle TypeTraitExpr

Summary:
`TypeTraitExpr`s are not supported by the ExprEngine today. Analyzer
creates a sink, and aborts the block. Therefore, certain bugs that
involve type traits intrinsics cannot be detected (see PR24710).

This patch creates boolean `SVal`s for `TypeTraitExpr`s, which are
evaluated by the compiler.

Test within the patch is a summary of PR24710.

Reviewers: zaks.anna, dcoughlin, krememek

Subscribers: cfe-commits

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

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

9 years ago[CUDA] Allow parsing of host and device code simultaneously.
Artem Belevich [Tue, 22 Sep 2015 17:23:22 +0000 (17:23 +0000)]
[CUDA] Allow parsing of host and device code simultaneously.

 * adds -aux-triple option to specify target triple
 * propagates aux target info to AST context and Preprocessor
 * pulls in target specific preprocessor macros.
 * pulls in target-specific builtins from aux target.
 * sets appropriate host or device attribute on builtins.

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

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

9 years agoAugmented CudaHostAction to carry device-side triple.
Artem Belevich [Tue, 22 Sep 2015 17:23:13 +0000 (17:23 +0000)]
Augmented CudaHostAction to carry device-side triple.

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

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

9 years ago[CUDA] Fixes minor cuda-related issues in the driver
Artem Belevich [Tue, 22 Sep 2015 17:23:09 +0000 (17:23 +0000)]
[CUDA] Fixes minor cuda-related issues in the driver

* Only the last of the --cuda-host-only/--cuda-device-only options has effect.
* CudaHostAction always wraps host-side compilation now.
* Fixed printing of empty action lists.

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

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

9 years ago[CUDA] Add appropriate host/device attribute to builtins.
Artem Belevich [Tue, 22 Sep 2015 17:23:05 +0000 (17:23 +0000)]
[CUDA] Add appropriate host/device attribute to builtins.

The changes are part of attribute-based CUDA function overloading (D12453)
and as such are only enabled when it's in effect (-fcuda-target-overloads).

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

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

9 years ago[CUDA] Allow function overloads in CUDA based on host/device attributes.
Artem Belevich [Tue, 22 Sep 2015 17:22:59 +0000 (17:22 +0000)]
[CUDA] Allow function overloads in CUDA based on host/device attributes.

The patch makes it possible to parse CUDA files that contain host/device
functions with identical signatures, but different attributes without
having to physically split source into host-only and device-only parts.

This change is needed in order to parse CUDA header files that have
a lot of name clashes with standard include files.

Gory details are in design doc here: https://goo.gl/EXnymm
Feel free to leave comments there or in this review thread.

This feature is controlled with CC1 option -fcuda-target-overloads
and is disabled by default.

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

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

9 years ago[CUDA] Add implicit __attribute__((used)) to all __global__ functions.
Artem Belevich [Tue, 22 Sep 2015 17:22:51 +0000 (17:22 +0000)]
[CUDA] Add implicit __attribute__((used)) to all __global__ functions.

This makes sure that we emit kernels that were instantiated from the
host code and which would never be explicitly referenced by anything
else on device side.

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

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

9 years ago[tooling] Provide the compile commands of the JSON database in the order that they...
Argyrios Kyrtzidis [Tue, 22 Sep 2015 17:22:33 +0000 (17:22 +0000)]
[tooling] Provide the compile commands of the JSON database in the order that they were provided in the JSON file.

This is useful for debugging of issues and reduction of test cases.
For example, an issue may show up due to the order that some commands were processed.
It is convenient to be able to remove commands from the file and still preserve the order
that they are returned, instead of getting a completely different order when removing a few commands.

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