Commit Graph

61506 Commits

Author SHA1 Message Date
Kelvin Li a15fb1a110 [OpenMP] Parsing and sema support for thread_limit clause.
http://reviews.llvm.org/D15029

llvm-svn: 254207
2015-11-27 18:47:36 +00:00
Artyom Skrobov d08cb6c528 int function without a return statement is invalid C++.
Changing the return type to void.

llvm-svn: 254206
2015-11-27 18:10:49 +00:00
Daniel Sanders bd3f47f5b5 [mips] Interrupt attribute support.
Summary: This patch adds support for the interrupt attribute for mips32r2+.

Patch by Simon Dardis.

Reviewers: dsanders, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 254205
2015-11-27 18:03:44 +00:00
Daniel Sanders 8f8eb8f545 Revert r254203: [mips] Interrupt attribute support.
I forgot to credit the author.

llvm-svn: 254204
2015-11-27 18:00:36 +00:00
Daniel Sanders 586be02495 [mips] Interrupt attribute support.
Summary: This patch adds support for the interrupt attribute for mips32r2+.

Reviewers: dsanders, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 254203
2015-11-27 17:39:20 +00:00
Joerg Sonnenberger 97f4d2c47f Revert Sparc and SparcV9 to external assembler. Now that the CPU
handling is corrected, the primary reason for forcing IAS as default is
gone and the remaining issues are still somewhat problematic in common
situations.

llvm-svn: 254199
2015-11-27 13:16:33 +00:00
Andrey Bokhanko 2a4db90157 [x86] Exclusion of incorrect include headers paths for MCU target
Exclusion of /usr/include and /usr/local/include headers paths for MCU target.

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

llvm-svn: 254195
2015-11-27 12:18:22 +00:00
Pierre Gousseau 2a3ca840e3 Test commit
Remove tabs.

llvm-svn: 254181
2015-11-26 22:08:58 +00:00
Justin Bogner 98712bd771 docs: Remove references to the long-defunct LLVM_USED_LIBS
LLVM_USED_LIBS hasn't done anything since 2012, stop telling people to
set it in the docs.

llvm-svn: 254173
2015-11-26 19:52:24 +00:00
Oliver Stannard 4cc70802c7 [AArch64] Add command-line options for Statistical Profiling Extension
This adds the "+profile" and +noprofile" suffixes for the -march and
-mcpu options, to allow enabling or disabling the options Statistical
Profiling Extension to ARMv8.2-A.

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

llvm-svn: 254161
2015-11-26 15:38:54 +00:00
Oliver Stannard 76afca7617 [AArch64] Add command-line options for ARMv8.2-A
This adds new values for the -march option (armv8.2a and armv8.2-a,
which are aliases of each other), and new suffixes for the -march and
-mcpu options (+fp16 and +nofp16), to allow targeting the ARMv8.2-A
architecture and it's optional half-precision floating-point extension.

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

llvm-svn: 254160
2015-11-26 15:36:42 +00:00
Alexander Musman f97c8933cb Fix for merging decls in pragma weak
Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged.
Differential Revision: http://reviews.llvm.org/D13048

llvm-svn: 254143
2015-11-26 09:34:30 +00:00
Alexey Bataev 7b6bc88c5a [OPENMP 4.5] Fixed rules for 'ordered' clause.
According to OpenMP 4.5 the parameter of 'ordered' clause must be greater than or equal to the parameter of 'collapse' clause. Patch adds this rule.

llvm-svn: 254141
2015-11-26 07:50:39 +00:00
Craig Topper 5e35e669a5 [Diagnostics] Call setMapping on the correct diagnostic states in a few places. GetCurDiagState() was being used when it shouldn't be.
I spotted this by inspection in the for loop that wasn't using its iterator and was just acting on the current state repeatedly.

This appears to have been introduced as a copy and paste bug in r140763 over 4 years ago.

I have no idea how to test this. I just went back to the original commit and tried to use the variables it was using before that.

llvm-svn: 254134
2015-11-26 05:51:54 +00:00
Craig Topper a52e2b22e6 Use range-based for loops. NFC
llvm-svn: 254133
2015-11-26 05:10:07 +00:00
Richard Smith 85864d5b43 Update reference to final TM TS spec.
llvm-svn: 254123
2015-11-26 02:23:21 +00:00
Richard Smith 4a0cd89325 P0002R1: increment on expressions of type bool is no longer allowed in C++1z.
llvm-svn: 254122
2015-11-26 02:16:37 +00:00
Richard Smith a8cfffa351 [modules] Refactor handling of -fmodules-embed-*. Track this properly rather
than reusing the "overridden buffer" mechanism. This will allow us to make
embedded files and overridden files behave differently in future.

llvm-svn: 254121
2015-11-26 02:04:16 +00:00
Martell Malone 5cad22519d Driver: protect from empty -L args
Differential Revision: http://reviews.llvm.org/D12466

llvm-svn: 254117
2015-11-26 01:02:07 +00:00
Devin Coughlin 2c2c3cb3d0 [analyzer] Add tests for generalized lambda capture (C++14). NFC.
Add tests demonstrating that the analyzer supports generalized lambda capture. This
support falls out naturally from the work Gábor Horváth did adding C++11 lambdas to
the analyzer.

llvm-svn: 254114
2015-11-26 00:11:23 +00:00
Devin Coughlin b6029b7ef4 [analyzer] Include block capture copy expressions in the CFG.
This prevents spurious dead store warnings when a C++ lambda is casted to a block.

I've also added several tests documenting our still-incomplete support for lambda-to-block
casts.

rdar://problem/22236293

llvm-svn: 254107
2015-11-25 22:35:37 +00:00
Richard Smith 291027692f P0001R1: 'register' storage class specifier is no longer permitted in C++1z.
We will still allow it in system headers, in macros from system headers, when
combined with an 'asm' label, and under the flag -Wno-register.

llvm-svn: 254097
2015-11-25 21:34:21 +00:00
Richard Smith 3275813d35 Stop using SFINAE to detect whether a derived-class override of Traverse* can
take a queue; some supported versions of GCC believe that this substitution
failure is an error. Instead, use a partial specialization to detect the type
of a pointer to the corresponding member. This is less general, but good enough
for our uses.

llvm-svn: 254083
2015-11-25 19:33:20 +00:00
Alexey Bataev f763027f04 [MSVC] 'property' with an empty array in array subscript expression.
MSVC supports 'property' attribute and allows to apply it to the declaration of an empty array in a class or structure definition.
For example:
```
__declspec(property(get=GetX, put=PutX)) int x[];
```
The above statement indicates that x[] can be used with one or more array indices. In this case, i=p->x[a][b] will be turned into i=p->GetX(a, b), and p->x[a][b] = i will be turned into p->PutX(a, b, i);
Differential Revision: http://reviews.llvm.org/D13336

llvm-svn: 254067
2015-11-25 12:01:00 +00:00
Alexey Bataev c99b04983b [X86] Support for C calling convention only for MCU target.
For MCU only C calling convention is allowed, all other calling conventions are not supported.
Differential Revision: http://reviews.llvm.org/D14864

llvm-svn: 254063
2015-11-25 09:24:26 +00:00
Richard Smith cb50b511de Fix typo that was being SFINAE'd away (and apparently GCC 4.7.2 rejects-valid on this).
llvm-svn: 254053
2015-11-25 02:41:42 +00:00
Richard Smith a205719319 Teach RAV to pass its DataRecursionQueue to derived classes if they ask for it,
to allow them to explicitly opt into data recursion despite having overridden
Traverse*Stmt or Traverse*Expr. Use this to reintroduce data recursion to the
one place that lost it when DataRecursiveASTVisitor was removed.

llvm-svn: 254041
2015-11-24 23:50:47 +00:00
Kelvin Li 099bb8c65d [OpenMP] Parsing and sema support for num_teams clause
http://reviews.llvm.org/D14802

llvm-svn: 254019
2015-11-24 20:50:12 +00:00
Yaron Keren 4c31fcfcf5 Replace [=] lambda capture with [&] per David Blaikieþ suggestion.
llvm-svn: 254013
2015-11-24 20:18:24 +00:00
Devin Coughlin c1986638a7 [analyzer] Pass value expression for inlined defensive checks when binding null to nonnull.
The nullability checker was not suppressing false positives resulting from
inlined defensive checks when null was bound to a nonnull variable because it
was passing the entire bind statement rather than the value expression to
trackNullOrUndefValue().

This commit changes that checker to synactically match on the bind statement to
extract the value expression so it can be passed to trackNullOrUndefValue().

rdar://problem/23575439

llvm-svn: 254007
2015-11-24 19:15:11 +00:00
Nirav Dave b0bb6142f5 Fix rewrite of reserved library name in case of -nodefaultlibs
The Driver only checked if nostdlib was set when deciding to add
reserved_lib_stdcxx, but as nostdlib is always exactly nodefaultlibs and
nostartfiles we should be checking one (clearly nodefaultlibs in the
case) as well. This appears to be the only such instance of this in the
codebase.

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

llvm-svn: 253990
2015-11-24 16:07:21 +00:00
Alexey Bataev 40e36f1f64 [OPENMP] Fix crash on codegen for 'task' directive with no shared variables.
If 'task' region does not have shared variables codegen could crash on calculation of size of list of shared variables.

llvm-svn: 253977
2015-11-24 13:01:44 +00:00
Richard Smith 812465436b Reduce the stack usage per recursive step when RecursiveASTVisitor cannot perform data recursion.
llvm-svn: 253958
2015-11-24 07:13:06 +00:00
Richard Smith 919ce23566 [modules] Add -cc1 flag -fmodules-embed-all-files.
This flag causes all files that were read by the compilation to be embedded
into a produced module file. This is useful for distributed build systems that
use an include scanning system to determine which files are "needed" by a
compilation, and only provide those files to remote compilation workers. Since
using a module can require any file that is part of that module (or anything it
transitively includes), files that are not found by an include scanner can be
required in a regular build using explicit modules. With this flag, only files
that are actually referenced by transitively-#included files are required to be
present on the build machine.

llvm-svn: 253950
2015-11-24 04:22:21 +00:00
Richard Smith 50668455a7 Remove DataRecursiveASTVisitor; it no longer serves any purpose, since it's just an alias for RecursiveASTVisitor.
llvm-svn: 253949
2015-11-24 03:55:01 +00:00
Richard Smith 8583872060 Use data recursion in RecursiveASTVisitor when traversing Stmt and Expr nodes.
When RAV traverses a Stmt or Expr node, if the corresponding Traverse*
functions have not been overridden, it will now use data recursion to walk
those nodes. We arrange this to be an unobservable optimization to RAV
subclasses, and to gracefully degrade as parts of the visitation are overridden
with functions that might observe the visitation.

For instance, if an RAV subclass overrides TraverseUnaryNot, we will ensure
that there are real recursive stack frames for those traversals, but we'll
use data recursion for all other traversals.

This removes the need for DataRecursiveASTVisitor, and for the
'shouldUseDataRecursionFor' extension point, both of which are removed by this
change.

llvm-svn: 253948
2015-11-24 03:09:01 +00:00
Artem Belevich d977f4ab99 Do not attempt to include CUDA headers during the test.
llvm-svn: 253947
2015-11-24 02:45:55 +00:00
Richard Smith 2af65c4a89 [coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, and form the initial_suspend, final_suspend, and get_return_object calls.
llvm-svn: 253946
2015-11-24 02:34:39 +00:00
NAKAMURA Takumi 8965799aa3 CodeGenFunction.h: Prune a \param in r253926. [-Wdocumentation]
llvm-svn: 253938
2015-11-23 23:38:13 +00:00
Chris Bieneman ae88ac200d NFC. Fixing my consistently incorrect spelling.
llvm-svn: 253937
2015-11-23 23:34:13 +00:00
NAKAMURA Takumi a70cdf5166 clang-c/Index.h: Move \brief. [-Wdocumentation]
llvm-svn: 253932
2015-11-23 22:51:26 +00:00
Samuel Antao 798f11cfb7 Preserve exceptions information during calls code generation.
This patch changes the generation of CGFunctionInfo to contain 
the FunctionProtoType if it is available. This enables the code 
generation for call instructions to look into this type for 
exception information and therefore generate better quality 
IR - it will not create invoke instructions for functions that 
are know not to throw.

llvm-svn: 253926
2015-11-23 22:04:44 +00:00
Chad Rosier c6bb4241fd Fix a warning about commas at the end of enumerator lists.
llvm-svn: 253914
2015-11-23 21:05:04 +00:00
Ehsan Akhgari 93697fa755 Make clang_Cursor_getMangling not mangle if the declaration isn't mangled
Right now clang_Cursor_getMangling will attempt to mangle any
declaration, even if the declaration isn't mangled (extern C).  This
results in a partially mangled name which isn't useful for much. This
patch makes clang_Cursor_getMangling return an empty string if the
declaration isn't mangled.

Patch by Michael Wu <mwu@mozilla.com>.

llvm-svn: 253909
2015-11-23 19:56:46 +00:00
Yaron Keren 941ad90146 Replace loop with std::any_of, NFC.
Inspired by similar commits from Craig Topper.

llvm-svn: 253904
2015-11-23 19:28:42 +00:00
Daniel Jasper 8e8b4fb678 clang-format: Re-add code path deleted in r253873 and add missing test.
llvm-svn: 253900
2015-11-23 19:11:45 +00:00
Martell Malone a96925322b Fix alignment of r253898
llvm-svn: 253899
2015-11-23 19:05:19 +00:00
Martell Malone f6301faa8b Driver: fallback to the location of clang if no sysroot,
hard coding /usr makes little sense for mingw-w64.
If we have portable toolchains having /usr breaks that.
If the clang we use is in /usr/bin or /usr/sbin etc this will
still detect as though it was hard coded to /usr

This makes the most sense going forward for mingw-w64 toolchains
on both linux and mac

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

llvm-svn: 253898
2015-11-23 18:59:48 +00:00
Sumanth Gundapaneni c61c08e618 Make tbm-builtins.c as X86 specific unit test
Differential Revision: http://reviews.llvm.org/D14887

llvm-svn: 253887
2015-11-23 17:33:49 +00:00
Xinliang David Li 4dff875259 Disable frame pointer elimination when using -pg
(Re-apply patch after bug fixing)

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

Patch by Stefan Kempf.

llvm-svn: 253886
2015-11-23 17:30:31 +00:00
Aaron Ballman 6290fc9154 Add an AST matcher for narrowing when a type is volatile-qualified.
llvm-svn: 253882
2015-11-23 17:09:24 +00:00
Martell Malone ba0f7d2b9d Revert part of r253813
The new lld gnu frontend does not support the -target option

llvm-svn: 253874
2015-11-23 16:04:55 +00:00
Daniel Jasper 569369ce28 clang-format: Signficantly refactor the cast detection.
No functional changes intended.

llvm-svn: 253873
2015-11-23 15:55:55 +00:00
Daniel Jasper 9bb3001d53 clang-format: Fix incorrect cast detection.
Before:
  bool b = f(g<int>)&&c;

After:
  bool b = f(g<int>) && c;

llvm-svn: 253872
2015-11-23 15:55:50 +00:00
Daniel Jasper 253dad2323 clang-format: If the template list of a variable declaration spans
multiple lines, also break before the variable name.

Before:
  std::vector<aaaaaa, // wrap
              aa> aaa;

After:
  std::vector<aaaaaa, // wrap
              aa>
      aaa;

llvm-svn: 253871
2015-11-23 15:55:45 +00:00
Alexey Bataev 92e82f9cce [OPENMP] 'out' dependency for 'task' directives must be the same as 'inout'.
Runtime library requires, that codegen for 'depend' clause for 'out' dependency kind must be the same as codegen for 'depend' clause with 'inout' dependency.

llvm-svn: 253866
2015-11-23 13:33:42 +00:00
Anastasia Stulova 784fb78274 [OpenCL 2.0] Apply default address space (AS).
If AS of a variable/parameter declaration is not set by the source,
OpenCL v2.0 s6.5 defines explicit rules for default ASes:

- The AS of global and local static variables defaults to global;
- All pointers point to generic AS.

http://reviews.llvm.org/D13168

llvm-svn: 253863
2015-11-23 11:14:44 +00:00
Daniel Jasper 7048edb104 Fix clang-format test. I believe that the new behavior is better.
llvm-svn: 253861
2015-11-23 08:50:52 +00:00
Daniel Jasper b68aabf7fc clang-format: Make moving of the Cursor work properly when sorting #includes.
llvm-svn: 253860
2015-11-23 08:36:35 +00:00
Daniel Jasper 3fed94525c Fix calculation of shifted cursor/code positions. Specifically support
the case where a specific range is replaced by new text. Previously,
the calculation would shift any position from within a replaced region
to the first character after the region. This is undersirable, e.g. for
clang-format's include sorting.

llvm-svn: 253859
2015-11-23 08:33:48 +00:00
NAKAMURA Takumi 805e657584 OpenMPClause.h: Fix typos. [-Wdocumentation]
llvm-svn: 253854
2015-11-23 06:41:50 +00:00
Vedant Kumar 280001807b [Driver] Mark isForDiagnostics as const. NFC.
llvm-svn: 253853
2015-11-23 06:40:49 +00:00
Xinliang David Li a2124eebbd Revert r253846 (build bot failure))
llvm-svn: 253851
2015-11-23 05:41:05 +00:00
Kelvin Li 7010ed6be3 [OpenMP] Parsing and sema support for map clause - add test case
http://reviews.llvm.org/D14134 

llvm-svn: 253850
2015-11-23 05:36:37 +00:00
Kelvin Li 0bff7afab5 [OpenMP] Parsing and sema support for map clause
http://reviews.llvm.org/D14134 

llvm-svn: 253849
2015-11-23 05:32:03 +00:00
Xinliang David Li eadaf84e78 Disable frame pointer elimination when using -pg
This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives 
an error if -fomit-frame-pointer is used in combination 
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend 
when -pg is set.

Patch by Stefan Kempf.

llvm-svn: 253846
2015-11-23 05:09:10 +00:00
David Majnemer 67528eaacf [MS ABI] Tolerate invokes of __RTDynamicCast
The pointer returned by __RTDynamicCast must be bitcasted.  However, it
was not expected that __RTDynamicCast would be invoked, resulting in the
bitcast occuring in a different BasicBlock than the invoke.  This caused
a down-stream PHI to get confused about which BasicBlock the incomming
value was from.

This fixes PR25606.

llvm-svn: 253843
2015-11-23 03:01:14 +00:00
Richard Smith 71d403effb [coroutines] Check for overload sets in co_yield / co_return operands being resolved by a call to yield_value / return_value before rejecting them.
llvm-svn: 253817
2015-11-22 07:33:28 +00:00
Richard Smith 4ba66602bd [coroutines] Build implicit return_value / return_void calls for co_return.
llvm-svn: 253816
2015-11-22 07:05:16 +00:00
Martell Malone 605cdb5c9c Test: Update mingw-useld.c to reflect r253813
llvm-svn: 253815
2015-11-22 05:45:03 +00:00
Martell Malone aac044e35c Driver: Specifically tell the linker the target for mingw-w64
Cross compiling from linux and OSX results in Error: Exec format.
This is because the linker is expecting ELF formated objects.
By passing the target we can explicitly tell the linker that
it should be linking COFF objects regardless of the host.

llvm-svn: 253813
2015-11-22 05:40:06 +00:00
Richard Smith 1f38eddee0 [coroutines] Materialize the awaitable before generating the await_* calls.
llvm-svn: 253812
2015-11-22 03:13:02 +00:00
Richard Smith d7bed4d660 [coroutines] Factor out co_await representation into common base class for co_await and co_yield, and use it to hold await_* calls.
llvm-svn: 253811
2015-11-22 02:57:17 +00:00
Daniel Jasper 9b8c7c72f5 clang-format: Make sorting includes respect // clang-format off
llvm-svn: 253772
2015-11-21 09:17:08 +00:00
Matthias Braun 5961fef32e Let's try to fix this test again with a fixed target triple
llvm-svn: 253760
2015-11-21 02:28:42 +00:00
Matthias Braun 84055ecb7d Fix c-unicode.c testcase again.
Specifying a fixed triple is not possible because that target may not
even be compiler. Go for a simpler fix by using a _? regex for the
prefix.

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

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

Fixes PR25558.

llvm-svn: 253738
2015-11-20 23:42:39 +00:00
Richard Smith 10610f7f2f [coroutines] Better handling of placeholder types.
llvm-svn: 253731
2015-11-20 22:57:24 +00:00
Richard Smith ae3d147c91 [coroutines] Support braced-init-list as operand of co_yield expression.
llvm-svn: 253726
2015-11-20 22:47:10 +00:00
Richard Smith 23da82c5ea [coroutines] Synthesize yield_value call for co_yield.
llvm-svn: 253725
2015-11-20 22:40:06 +00:00
Chris Bieneman 8638714dc7 [CMake] Add support for specifying arguments to the bootstrap build.
This adds support for three types of argument specifications for bootstrap builds:

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

llvm-svn: 253721
2015-11-20 22:09:06 +00:00
Chris Bieneman 5b390b53c6 [CMake] Fix handling of passing through semi-colon separated lists.
When passing around CMake arguments as lists of arguments any arguments containing lists need to have their semi-colons escaped otherwise CMake will split the arguments in the middle.

llvm-svn: 253720
2015-11-20 22:09:03 +00:00
Peter Collingbourne 39719a77d1 Driver: Defer computation of linker path until it is needed.
This allows us to construct Linux toolchains without a valid linker. This
is needed for example to build a CUDA device toolchain after r253385.

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

llvm-svn: 253706
2015-11-20 20:47:34 +00:00
Reid Kleckner 19ff5602da Thread Safety Analysis: Fix DenseMap iterator invalidation UAF
Rather than storing BeforeInfo in the DenseMap by value, this stores a
unique_ptr to it, so that we can keep a pointer to it live across
subsequent DenseMap insertions.

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

llvm-svn: 253694
2015-11-20 19:08:30 +00:00
Chris Bieneman 0502e98c8a Honor system specific paths of MAN pages
Summary: Caught on NetBSD.

Patch by: Kamil Rytarowski (krytarowski)

Reviewers: beanz, jroelofs

Subscribers: cfe-commits, joerg

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

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

Reviewers: dblaikie

Subscribers: cfe-commits

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

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

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

  clang-cl /W4 -Wno-unused-parameter

Reverting for now.

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

Reviewers: rengolin, bogden, compnerd

Subscribers: aemerson, rengolin, cfe-commits

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

llvm-svn: 253677
2015-11-20 16:47:05 +00:00
Daniel Jasper 71e574543f clang-format: [JS] Make AllowShortFunctionsOnASingle line value "Empty"
work properly.

llvm-svn: 253674
2015-11-20 16:44:28 +00:00
Daniel Jasper f95b1f4546 clang-format: [JS] Properly add a space after "in" in for loops.
llvm-svn: 253672
2015-11-20 16:18:42 +00:00
Daniel Jasper 09840efd92 clang-format: [JS] struct and union aren't keywords / reserved words.
llvm-svn: 253671
2015-11-20 15:58:50 +00:00
Daniel Jasper 7fa524b4b8 clang-format: Don't use incorrect space in macro calls with operators.
Before:
  MACRO(> );

After:
  MACRO(>);

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

llvm-svn: 253669
2015-11-20 15:26:50 +00:00
Daniel Jasper d8d9839ae6 clang-format: [Proto] Support extending message.
Before:
  extend.foo.Bar {
  }

After:
  extend .foo.Bar {
  }

llvm-svn: 253667
2015-11-20 14:32:54 +00:00
Benjamin Kramer 7d0cc23786 Regenerate ASTMatchersReference without CRLF.
llvm-svn: 253654
2015-11-20 07:57:46 +00:00
Benjamin Kramer 611d33a5a2 Fix ASTMatcher reference newlines and make the generator script windows-proof.
llvm-svn: 253653
2015-11-20 07:46:19 +00:00
Alexey Bataev 3d42f340cd [MS] Fix for bug 25013 - #pragma vtordisp is unknown inside functions, by Denis Zobnin.
This patch adds support of #pragma vtordisp inside functions in attempt to improve compatibility. Microsoft compiler appears to save the stack of vtordisp modes on entry of struct methods' bodies and restore it on exit (method-local vtordisp).
Differential Revision: http://reviews.llvm.org/D14467

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

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

llvm-svn: 253641
2015-11-20 02:54:01 +00:00
Argyrios Kyrtzidis dcb5653516 [CMake] Add a specific 'install-clang-headers' target.
llvm-svn: 253636
2015-11-20 02:24:03 +00:00
Devin Coughlin c7315b3ebf [analyzer] DeadStoresChecker: Treat locals captured by reference in C++ lambdas as escaped.
The analyzer currently reports dead store false positives when a local variable
is captured by reference in a C++ lambda.

For example:

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

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

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

rdar://problem/22165179

llvm-svn: 253630
2015-11-20 01:53:44 +00:00
Chris Bieneman 586d24bbf2 Support CMake's clang_rt.profile library naming scheme
Summary: This code is a bit undesirable, but it gets clang to work with the autoconf and cmake-built libclang_rt.profile libraries.

Reviewers: bogner

Subscribers: cfe-commits

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

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

Reviewers: arsenm, echristo

Subscribers: cfe-commits

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

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

Reviewers: dblaikie, davidxl, dnovillo

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

llvm-svn: 253595
2015-11-19 19:53:16 +00:00
Faisal Vali 48401eb18a Change the expression evaluation context from Unevaluated to ConstantEvaluated while substituting into non-type template argument defaults.
Also address a typo from a prior patch that performed a similar fix during Parsing of default non-type template arguments.  I left the RAII ExpressionEvaluationContext variable Name as Unevaluated though we had switched the context to ConstantEvaluated.

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

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

llvm-svn: 253590
2015-11-19 19:20:17 +00:00
Hans Wennborg 2763dc29a5 clang-cl: Make /W4 imply -Wall -Wextra (PR25563)
llvm-svn: 253582
2015-11-19 17:49:59 +00:00
NAKAMURA Takumi 8153a24a84 clangFrontend: [PR25565] Quick fix for dependencies on Attributes.inc.
FIXME: Attributes.inc may be an independent target.

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

llvm-svn: 253554
2015-11-19 10:59:48 +00:00
Alexey Bataev f278eb10b7 PR10235: support for vector mode attributes + warning, by Dmitry Polukhin.
Add support for vector mode attributes like "attribute((mode(V4SF)))". Also add warning about deprecated vector modes like GCC does.
Differential Revision: http://reviews.llvm.org/D14744

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

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

llvm-svn: 253542
2015-11-19 05:55:59 +00:00
Pete Cooper ccfcdc0d3a Revert "Fix debian build after r253512."
This reverts commit r253519.

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

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

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

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

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

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

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

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

llvm-svn: 253523
2015-11-19 00:03:54 +00:00
Pete Cooper eb3bc60e62 Fix debian build after r253512.
The conversion from QuantityType to the (temporary) IntegerAlignment class
was ambiguous.

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

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

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

rdar://problem/23564220

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

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

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

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

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

Reviewed by Hal Finkel.

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

llvm-svn: 253506
2015-11-18 21:42:38 +00:00
David Majnemer 678f50b622 [Sema] Don't work around a malformed AST
We created a malformed TemplateSpecializationType: it was dependent but
had a RecordType as it's canonical type.  This would lead getAs to
crash.  r249090 worked around this but we should fix this for real by
providing a more appropriate template specialization type as the
canonical type.

This fixes PR24246.

llvm-svn: 253495
2015-11-18 19:49:19 +00:00
Aaron Ballman f08e184815 Removing the AST matcher test for thread_local storage duration. Not all platforms support TLS, and on platforms that do not support it, use of thread_local causes an error. Since there's no way to determine whether the testing platform supports TLS, there's no way to know whether the test is safe to run or not. I will explore ways to enable this test, but this will appease at least one more build bot.
llvm-svn: 253486
2015-11-18 18:37:29 +00:00
Betul Buyukkurt 6247bed9bd [PGO] Test update for revision 253484.
llvm-svn: 253485
2015-11-18 18:15:55 +00:00
Aaron Ballman 8e7f00b0eb Re-committing r253473 after hopefully fixing the bot breakage. There was a copy-pasta issue that my local testing did not catch.
llvm-svn: 253481
2015-11-18 17:56:55 +00:00
Douglas Katzman d617e44065 [Myriad]: fix test for Windows
llvm-svn: 253476
2015-11-18 17:19:47 +00:00
Aaron Ballman 81d17f2f7e Reverting r253473 while I investigate build bot failures.
llvm-svn: 253475
2015-11-18 17:16:01 +00:00
Aaron Ballman 34e0bd40e4 Adding AST matchers for VarDecl storage durations. Can now determine whether a VarDecl has automatic, static, or thread storage duration. This also updates the documentation for matchers, which appear to be missing some previous additions.
llvm-svn: 253473
2015-11-18 17:05:39 +00:00
Bradley Smith bbf5a00de1 [ARM] Support +feature targeting in -mcpu/-march
llvm-svn: 253471
2015-11-18 16:33:48 +00:00
Douglas Katzman 674a31243b [Myriad]: insert -L paths into linker cmd only when they exist.
Differential Revision: http://reviews.llvm.org/D14754

llvm-svn: 253467
2015-11-18 16:24:46 +00:00
Benjamin Kramer c02670ed50 [libclang] Add entry points that take a full command line including argv[0].
This provides both a more uniform interface and makes libclang behave like
clang tooling wrt relative paths against argv[0]. This is necessary for
finding paths to a c++ standard library relative to a clang binary given
in a compilation database. It can also be used to find paths relative to
libclang.so if the full path to it is passed in.

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

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

llvm-svn: 253458
2015-11-18 14:40:41 +00:00
Eugene Leviant 0d8103e975 Set flag for lldb when qualified name lookup is being done
llvm-svn: 253456
2015-11-18 12:48:05 +00:00
Rafael Espindola cd67662ad9 Update for llvm change.
llvm-svn: 253440
2015-11-18 06:54:13 +00:00
NAKAMURA Takumi 64705c8e7b BuildUniversalActions(): Prune obsolete \param(s). [-Wdocumentation]
FIXME: Describe BAInputs.
llvm-svn: 253434
2015-11-18 05:15:21 +00:00
Faisal Vali 0374bf0d07 [NFC] Change the evaluation context of a non-type default template argument from Unevaluated to ConstantEvaluated.
This patch emits a more appropriate (but still noisy) diagnostic stream when a lambda-expression is encountered within a non-type default argument. 

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

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

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

Thanks!

llvm-svn: 253431
2015-11-18 04:29:22 +00:00
Richard Smith 2a40fb78c0 Don't expose iterators into the list of types on the ASTContext; these are
unsafe, since many operations on the types can trigger lazy deserialization of
more types and invalidate the iterators. This fixes a crasher, but I've not
been able to reduce it to a reasonable testcase yet.

llvm-svn: 253420
2015-11-18 01:19:02 +00:00
Reid Kleckner 356be39f65 Try to fix leak in CXStringSet from r252853
llvm-svn: 253418
2015-11-18 01:06:39 +00:00
Artem Belevich 6e50375286 Fix for use-after-free which caused test failure in cuda-detect.cu.
Return std::string itself instead StringRef to a temporary std::string.

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

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

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

rdar://problem/23084219

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

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

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

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

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

llvm-svn: 253389
2015-11-17 22:28:55 +00:00
Artem Belevich c29db84419 [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

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

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

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

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

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

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

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

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

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

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

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

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

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

llvm-svn: 253371
2015-11-17 20:25:05 +00:00
Hans Wennborg 1acf955a6a 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

llvm-svn: 253358
2015-11-17 18:46:48 +00:00
Tim Northover c741b04d1e 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.

llvm-svn: 253355
2015-11-17 18:27:27 +00:00
Douglas Katzman 6059ef98d9 Add trivial utility to append -L arguments to linker step. NFC
llvm-svn: 253350
2015-11-17 17:41:23 +00:00
Manuel Klimek ff39366de5 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; }

llvm-svn: 253337
2015-11-17 15:40:10 +00:00
Craig Topper e39fa490f9 [Sema] Remove unnecessary typecast of bool to int when passing arguments to diagnostics. NFC
llvm-svn: 253316
2015-11-17 05:40:12 +00:00
Craig Topper da7b27ff0b [Sema] Combine similar diagnostics using %select. NFC
llvm-svn: 253315
2015-11-17 05:40:09 +00:00
Craig Topper 8f7f3ea658 [Sema] Minor formatting fixes. NFC
llvm-svn: 253314
2015-11-17 05:40:05 +00:00
Richard Smith 10568d8c1c [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.

llvm-svn: 253283
2015-11-17 03:02:41 +00:00
Stephen Canon 916be92955 Make FP_CONTRACT ON the default.
Differential Revision: D14200

llvm-svn: 253269
2015-11-16 23:09:11 +00:00
Derek Schuff 821d884383 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.

llvm-svn: 253259
2015-11-16 22:21:25 +00:00
John McCall 0204e342ca Correctly handle type mismatches in the __weak copy/move-initialization
peephole I added in r250916.

rdar://23559789

llvm-svn: 253255
2015-11-16 22:11:41 +00:00
Eric Christopher b7bbc53314 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.

llvm-svn: 253242
2015-11-16 18:29:59 +00:00
Vasileios Kalintiris bbc9930a34 [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.

llvm-svn: 253214
2015-11-16 15:41:30 +00:00
Douglas Katzman 642e5f9fea [Myriad]: pass the 'std=' option to moviCompile
llvm-svn: 253213
2015-11-16 15:38:40 +00:00
Oliver Stannard 7aa90f5735 [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

llvm-svn: 253211
2015-11-16 14:58:50 +00:00
Artyom Skrobov afb3cb154b 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

llvm-svn: 253207
2015-11-16 14:05:48 +00:00
Daniel Jasper da44677082 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.

llvm-svn: 253202
2015-11-16 12:38:56 +00:00
Bradley Smith b350196d77 [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.

llvm-svn: 253199
2015-11-16 11:16:36 +00:00
Rafael Espindola 156aac0bb6 Update for the gnu flavor being renamed to old-gnu.
llvm-svn: 253191
2015-11-16 09:12:12 +00:00
Keno Fischer 87842f3b4e [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.

llvm-svn: 253190
2015-11-16 09:04:13 +00:00
David Majnemer 213bea3361 [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).

llvm-svn: 253184
2015-11-16 06:58:51 +00:00
Vedant Kumar 678125d7ec [Basic] Replace vector<bool> with BitVector in SourceManager. NFC.
llvm-svn: 253181
2015-11-16 04:39:22 +00:00
Vedant Kumar 5b60ad68ce [Frontend] Rangify for loop. NFC.
llvm-svn: 253178
2015-11-16 00:59:34 +00:00
Vedant Kumar a52fa8efe6 [Basic] Use a bitfield in SLocEntry for clarity. NFC.
llvm-svn: 253177
2015-11-16 00:11:58 +00:00
Devin Coughlin 1d4058322d [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

llvm-svn: 253176
2015-11-15 17:48:22 +00:00
Craig Topper 1212626041 [Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo on the AST context instead of Preprocessor. NFC
llvm-svn: 253175
2015-11-15 17:27:57 +00:00
Craig Topper 56e51be796 [Sema] Fix filename in header. NFC
llvm-svn: 253174
2015-11-15 17:27:55 +00:00
Craig Topper 177f6b9758 [Sema] Remove unnecessary includes and forward declarations. NFC
llvm-svn: 253173
2015-11-15 17:27:52 +00:00
Simon Pilgrim 7b8f926465 [X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing cvt intrinsics
llvm-svn: 253169
2015-11-15 14:40:31 +00:00
Sergey Kalinichev 8f3b187e21 [libclang] Visit TypeAliasTemplateDecl
This makes TypeAliasTemplateDecl accessible via LibClang and python bindings

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

llvm-svn: 253166
2015-11-15 13:48:32 +00:00
Sergey Kalinichev c015120b53 [libclang] Expose AutoType
Expose the AutoType via LibClang and python bindings

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

llvm-svn: 253165
2015-11-15 13:10:10 +00:00
Sergey Kalinichev 43ed98b9dd Remove some trailing whitespace
llvm-svn: 253164
2015-11-15 12:37:01 +00:00
Yaron Keren a7fa79fb9b Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
Post-commit suggestion by Filipe Cabecinhas.

llvm-svn: 253161
2015-11-15 08:06:27 +00:00
Craig Topper 2512241b31 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.
llvm-svn: 253158
2015-11-15 03:32:11 +00:00
Devin Coughlin e69b043088 [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

llvm-svn: 253157
2015-11-15 03:07:17 +00:00
David Majnemer 7f77eb90a5 [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.

llvm-svn: 253156
2015-11-15 03:04:34 +00:00
Craig Topper 07fa176669 Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC
llvm-svn: 253155
2015-11-15 02:31:46 +00:00
Dan Gohman ce70b42bce [WebAssembly] Remove the "const" attribute from __builtin_wasm_memory_size.
llvm-svn: 253146
2015-11-14 22:57:34 +00:00
Craig Topper abb83aed5c Move diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic.h diagnostics.
llvm-svn: 253143
2015-11-14 19:31:56 +00:00
Craig Topper 7d2f94319f Fix indentation. NFC
llvm-svn: 253142
2015-11-14 19:31:52 +00:00
Craig Topper 54a6a68c70 Merge some similar diagnostics using %select.
llvm-svn: 253136
2015-11-14 18:16:08 +00:00
Craig Topper 3110a5cb93 Minor formatting fixes. NFC
llvm-svn: 253135
2015-11-14 18:16:02 +00:00
Craig Topper ff35428593 Fix 80 column violation. NFC.
llvm-svn: 253134
2015-11-14 18:16:00 +00:00
Craig Topper 3f13d4d20d Fix spelling error in comment.
llvm-svn: 253133
2015-11-14 18:15:55 +00:00
Simon Pilgrim 54cf98eeb2 [X86][MMX] Sorted MMX IR + assembly codegen builtin tests
Makes it easier to track what tests are missing....

llvm-svn: 253131
2015-11-14 13:25:06 +00:00
Simon Pilgrim 087b6a7216 [X86][MMX] Added MMX IR + assembly codegen builtin tests
Improved tests as discussed in PR24580

llvm-svn: 253130
2015-11-14 12:47:44 +00:00
David Majnemer 55cf252d75 Mark is_destructible/is_nothrow_destructible as implemented
These were implemented back in r244564.  However, I forgot to update the
docs.

llvm-svn: 253128
2015-11-14 07:21:35 +00:00
Ben Langmuir 90717ad731 [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

llvm-svn: 253123
2015-11-14 03:26:14 +00:00
Eric Christopher ce83677666 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.

llvm-svn: 253121
2015-11-14 02:38:37 +00:00
Craig Topper 7f5ff2175f Use %select to merge similar diagnostics. NFC
llvm-svn: 253119
2015-11-14 02:09:55 +00:00
Eric Christopher 39db726093 Clarify and elaborate the conditions on which we're checking target
features for calls.

llvm-svn: 253117
2015-11-14 01:56:04 +00:00
David Blaikie 6267684a18 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)

llvm-svn: 253114
2015-11-14 01:10:38 +00:00
Matthias Gehre 09a134eca3 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

llvm-svn: 253107
2015-11-14 00:36:50 +00:00
Justin Bogner f905256386 Revert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."
This reverts r243310, which is redundant as of r253102.

Conflicts:
	lib/Driver/Tools.cpp

llvm-svn: 253104
2015-11-13 23:07:31 +00:00
Argyrios Kyrtzidis f10158c025 [CMake] Don't install c-index-test when LLVM_INSTALL_TOOLCHAIN_ONLY=ON.
llvm-svn: 253099
2015-11-13 22:41:14 +00:00
Jonathan Roelofs 534c4eec48 Fix build... again
llvm-svn: 253081
2015-11-13 21:04:14 +00:00
Jonathan Roelofs 814aa25a92 [scan-build] Make scan-build work whether it's installed or not
llvm-svn: 253074
2015-11-13 20:34:15 +00:00
Yaron Keren 273f9560c9 Relax mingw-useld test to fix bot failures.
llvm-svn: 253069
2015-11-13 20:02:08 +00:00
Jonathan Roelofs 80df3d262d [scan-build] Move non user-facing utilities to share
llvm-svn: 253068
2015-11-13 19:56:07 +00:00
Yaron Keren 8759cd3930 Add test case for mingw -fuse-ld= support introduced in r242121.
llvm-svn: 253066
2015-11-13 19:46:02 +00:00
Juergen Ributzka 8aaae5a911 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

llvm-svn: 253060
2015-11-13 19:08:07 +00:00
James Molloy c674ecedc3 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.

llvm-svn: 253055
2015-11-13 17:29:18 +00:00
Yaron Keren 3e43cda61c Deduplicate three identical copies of isExplicitInstantiationOrSpecialization, NFC.
llvm-svn: 253046
2015-11-13 15:39:39 +00:00
NAKAMURA Takumi 624922ad87 scan-build: Fix install.
llvm-svn: 253016
2015-11-13 06:48:02 +00:00
David Majnemer 9658ecc53b [Sema] __is_constructible should return false for function types
While functions types are complete, they cannot be constructed.

This fixes PR25513.

llvm-svn: 253013
2015-11-13 05:32:43 +00:00
Richard Smith 6e132bef6f [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.

llvm-svn: 253012
2015-11-13 05:14:45 +00:00
NAKAMURA Takumi 978cbc54bc clang/test/Driver/mips-mti-linux.c: Tweak to match DOSish paths.
llvm-svn: 253011
2015-11-13 04:44:51 +00:00
Richard Smith 26210db67f [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).

llvm-svn: 253010
2015-11-13 03:52:13 +00:00
Argyrios Kyrtzidis 2cab8eec74 [CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install destination of c-index-test and the libclang headers.
llvm-svn: 253001
2015-11-13 01:46:18 +00:00
Jonathan Roelofs 7c297074d4 Fix build
llvm-svn: 252991
2015-11-13 01:23:40 +00:00
Akira Hatanaka 7828b1e604 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

llvm-svn: 252986
2015-11-13 00:42:21 +00:00
Jonathan Roelofs 2ec2acb03e [scan-build] Create share directory similar to scan-view's
llvm-svn: 252981
2015-11-13 00:32:54 +00:00
Jonathan Roelofs 5e20518443 [scan-view] Rename 'Resources' --> 'share'
llvm-svn: 252977
2015-11-13 00:25:04 +00:00
NAKAMURA Takumi 2ffa1c2f1c clang/test/Driver/mips-mti-linux.c: Remove XFAIL. It shouldn't fail for targeting win32.
I will remove REQUIRES later.

llvm-svn: 252972
2015-11-12 23:56:37 +00:00
John McCall d6da23d2df Remove -Wobjc-weak-compat; there isn't a compelling use case for this.
llvm-svn: 252971
2015-11-12 23:39:39 +00:00
Richard Smith 4b213d73d8 Avoid duplicated diagnostic when lookup for a nested-name-specifier fails due to ambiguity.
llvm-svn: 252967
2015-11-12 22:40:09 +00:00
NAKAMURA Takumi 525c4e0446 Mark clang/test/Driver/ms-bitfields.c as REQUIRES:clang-driver.
llvm-svn: 252961
2015-11-12 22:25:38 +00:00
Richard Smith 97135cc94a [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++.

llvm-svn: 252960
2015-11-12 22:19:45 +00:00
Richard Smith 990668b7d0 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).

llvm-svn: 252959
2015-11-12 22:04:34 +00:00
Richard Smith 5e3fb7616d 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).

llvm-svn: 252957
2015-11-12 21:55:58 +00:00
Richard Smith 03fd3915ee Additional tests from r252690 that I forgot to 'svn add'.
From a patch by Nicholas Allegra!

llvm-svn: 252955
2015-11-12 21:42:39 +00:00
James Y Knight 7aefb5b623 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

llvm-svn: 252920
2015-11-12 18:37:29 +00:00
Akira Hatanaka 0202848ad0 Add support for driver option -mno-ms-bitfields.
This option is used to cancel -mms-bitfields on the command line.

rdar://problem/15898553

llvm-svn: 252912
2015-11-12 17:21:22 +00:00
Artyom Skrobov ab2fab926f 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

llvm-svn: 252904
2015-11-12 15:52:02 +00:00
James Molloy c16a60b63e [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.

llvm-svn: 252902
2015-11-12 15:36:04 +00:00
Vasileios Kalintiris c744e120f6 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.

llvm-svn: 252901
2015-11-12 15:26:54 +00:00
Aaron Ballman a85d3f85df Silencing an MSVC warning about linkage specifications and C-incompatible UDTs by moving a function definition out of an extern "C" block.
llvm-svn: 252900
2015-11-12 15:25:06 +00:00
Ismail Donmez 19a17c3a16 Fix c-index-test install path
llvm-svn: 252890
2015-11-12 13:47:35 +00:00
James Molloy 57207ce922 Update clang regression tests for 'norecurse'
FunctionAttrs has just been taught how to infer 'norecurse'. Update clang tests for LLVM r252871.

llvm-svn: 252872
2015-11-12 10:56:51 +00:00
Craig Topper 71a51ff10e Use %select to merge two diagnostics that only differ in one word and are emitted in the same place. NFC
llvm-svn: 252861
2015-11-12 07:36:50 +00:00
Nathan Wilson 3702255bc9 [Sema] Remove unnecessary parens in check using logical or; NFC.
llvm-svn: 252855
2015-11-12 04:25:03 +00:00
Saleem Abdulrasool 6003443b8e libclang: add clang_Cursor_getCXXManglings
This function permits the mangling of a C++ 'structor.  Depending on the ABI and
the declaration, the declaration may contain more than one associated symbol for
a given declaration.  This allows the consumer to retrieve all of the associated
symbols for the declaration the cursor points to.

llvm-svn: 252853
2015-11-12 03:57:22 +00:00
Saleem Abdulrasool 5d92eaeb17 libclang: add new StringSet type
This allows the return of a set of CXStrings from libclang.  This is setup work
for an upcoming change to permit returning multiple mangled symbols.

llvm-svn: 252852
2015-11-12 03:57:16 +00:00
Akira Hatanaka 645af38957 [AttrDocs] Insert blank lines before and after code-block directives.
The code snippets were not being displayed. This commit fixes the bug.

llvm-svn: 252849
2015-11-12 02:41:56 +00:00
Ted Kremenek 9815be3042 Change code owner for Clang Static Analyzer to Anna Zaks.
llvm-svn: 252841
2015-11-12 01:31:27 +00:00
David Blaikie 5df25338a0 Refactor out some common code from r252834
llvm-svn: 252840
2015-11-12 01:09:58 +00:00
Argyrios Kyrtzidis e053d44309 [CMake] Setup an install component for libclang and c-index-test.
Also don't create libclang dylib symlinks on darwin.

llvm-svn: 252836
2015-11-12 00:46:57 +00:00
Eric Christopher 2b2d56f059 Provide a frontend based error for always_inline functions that require
target features that the caller function doesn't provide. This matches
the existing backend failure to inline functions that don't have
matching target features - and diagnoses earlier in the case of
always_inline.

Fix up a few test cases that were, in fact, invalid if you tried
to generate code from the backend with the specified target features
and add a couple of tests to illustrate what's going on.

This should fix PR25246.

llvm-svn: 252834
2015-11-12 00:44:12 +00:00
Eric Christopher fbfd97ed5c Move checkTargetFeatures to CodeGenFunction.cpp to make it
more obvious that it's generic.

llvm-svn: 252833
2015-11-12 00:44:07 +00:00
Eric Christopher c7e79dbec8 In preparation to use it in more places rename
checkBuiltinTargetFeatures to checkTargetFeatures and sink
the error handling into the function.

llvm-svn: 252832
2015-11-12 00:44:04 +00:00
Vedant Kumar 5eeeab7dcf [Basic] Fix DRY violation, just call getLineTable() (NFC)
llvm-svn: 252828
2015-11-12 00:11:19 +00:00
Nathan Wilson 68b2b9b3dc Add diagnostics which fall under [dcl.spec.concept]p5
Summary: Diagnose when a function concept declaration has parameter(s)

Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast

Subscribers: cfe-commits

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

llvm-svn: 252827
2015-11-11 23:53:35 +00:00
Manman Ren f93fff27f0 [TLS on Darwin] treat all Darwin platforms in the same way.
rdar://problem/9001553

llvm-svn: 252820
2015-11-11 23:08:18 +00:00
Eric Christopher 2b90a64e31 Extract out a function onto CodeGenModule for getting the map of
features for a particular function, then use it to clean up some
code.

llvm-svn: 252819
2015-11-11 23:05:08 +00:00
Manman Ren 6815026991 [TLS on Darwin] change how we handle globals with linkonce or weak linkage.
This is about how we handle static member of a template. Before this commit,
we use internal linkage for the IR thread-local variable, which is inefficient.
With this commit, we will start to follow Itanium C++ ABI.

rdar://problem/23415206

Reviewed by John McCall.

llvm-svn: 252814
2015-11-11 22:42:31 +00:00
Chris Bieneman 74d20e4853 [CMake] Fixing passthrough for variables starting with COMPILER_RT
This allows COMPILER_RT_* variables to be passed from the top-level CMake into the external project when LLVM_BUILD_EXTERNAL_COMPILER_RT=On.

llvm-svn: 252809
2015-11-11 21:53:08 +00:00
Devin Coughlin 932d88ca05 [analyzer] Fix scan-build to handle missing output directories.
Cwd::abs_path has a somewhat tricky semantics: if it's operand directory does not exist,
it'll return undefined (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=257568).
This may cause scan-build to silently ignore output directory (specified with -o) and
use /tmp instead of trying to create directory. This tiny patch fixes the problem.

A patch by Yury Gribov!

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

llvm-svn: 252797
2015-11-11 20:39:03 +00:00
Davide Italiano 5be2233a81 [SemaDeclCXX] Use isTemplateParamScope() rather than accessing raw bits.
llvm-svn: 252793
2015-11-11 20:06:35 +00:00
Charles Li 542f04cc4d [Lit Test] Updated 26 Lit tests to be C++11 compatible.
Expected diagnostics have been expanded to vary by C++ dialect.
RUN line has also been expanded to: default, C++98/03 and C++11.

llvm-svn: 252785
2015-11-11 19:34:47 +00:00
Manman Ren 14f88158c7 [TLS] move setting tls_guard in tls_init.
We used to emit the store prior to branch in the entry block. To make it more
efficient, this commit moves it to the init block. We still mark as initialized
before initializing anything else.

llvm-svn: 252777
2015-11-11 19:19:26 +00:00
Aaron Ballman 8f3f6347aa Hiding the scan-build and scan-view projects under the Misc folder in IDEs instead of having them at the root view.
llvm-svn: 252771
2015-11-11 18:13:42 +00:00
Aaron Ballman a9a728513c Silencing a -Wreturn-type warning for control reaching the end of a non-void function.
llvm-svn: 252727
2015-11-11 13:42:02 +00:00
Yury Gribov 5bfeca1201 [ASan] Allow -fsanitize-recover=address.
Differential Revision: http://reviews.llvm.org/D14243

llvm-svn: 252721
2015-11-11 10:45:48 +00:00
Artyom Skrobov efb0c3780e Make test/Driver/biarch.c use FileCheck instead of grep
Summary:
For clarity and ease of maintenance, I suggest porting this test
to use the same tooling as the rest of the tests.

Reviewers: joerg, rengolin, dougk, yaron.keren

Subscribers: cfe-commits

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

llvm-svn: 252720
2015-11-11 10:45:44 +00:00
Craig Topper fb79b5f273 [X86] Add 'pause' builtin that's already in llvm and use it instead of inline assembly to implement _mm_pause.
llvm-svn: 252712
2015-11-11 08:13:33 +00:00
Craig Topper a5455524c2 [X86] Use __builtin_ia32_paddq and __builtin_ia32_psubq to implement a couple intrinsics that were supposed to operate on MMX registers. Otherwise we end up operating on GPRs. Throw in a test for _mm_mul_su32 while I was there.
llvm-svn: 252711
2015-11-11 08:00:41 +00:00
Craig Topper 880f60b7b3 [X86] Header formatting fixes. NFC
llvm-svn: 252710
2015-11-11 08:00:39 +00:00
Craig Topper d619eaaae4 [X86] Add missing typecasts in intrinsic macros. This should make them more robust against inputs that aren't already the right type.
llvm-svn: 252700
2015-11-11 03:47:10 +00:00
Craig Topper 19744ee6ad [X86] Change pointer type in AVX2 gather builtins to be the scalar type instead of the vector type. This matches gcc and removes extras casts.
llvm-svn: 252697
2015-11-11 02:51:18 +00:00
Akira Hatanaka 25aa9f091e Reorder the check strings in test case following r252692.
rdar://problem/19836465

llvm-svn: 252693
2015-11-11 02:13:36 +00:00
Eric Christopher ed60b436d4 Fix a FIXME about using std::is_sorted.
llvm-svn: 252691
2015-11-11 02:04:08 +00:00
Richard Smith e301ba2b48 Add support for GCC's '__auto_type' extension, per the GCC manual:
https://gcc.gnu.org/onlinedocs/gcc/Typeof.html

Differences from the GCC extension:
 * __auto_type is also permitted in C++ (but only in places where
   it could appear in C), allowing its use in headers that might
   be shared across C and C++, or used from C++98
 * __auto_type can be combined with a declarator, as with C++ auto
   (for instance, "__auto_type *p")
 * multiple variables can be declared in a single __auto_type
   declaration, with the C++ semantics (the deduced type must be
   the same in each case)

This patch also adds a missing restriction on applying typeof to
a bit-field, which GCC has historically rejected in C (due to
lack of clarity as to whether the operand should be promoted).
The same restriction also applies to __auto_type in C (in both
GCC and Clang).

This also fixes PR25449.

Patch by Nicholas Allegra!

llvm-svn: 252690
2015-11-11 02:02:15 +00:00
Richard Smith 42b1057244 N3922: direct-list-initialization of an auto-typed variable no longer deduces a
std::initializer_list<T> type. Instead, the list must contain a single element
and the type is deduced from that.

In Clang 3.7, we warned by default on all the cases that would change meaning
due to this change. In Clang 3.8, we will support only the new rules -- per
the request in N3922, this change is applied as a Defect Report against earlier
versions of the C++ standard.

This change is not entirely trivial, because for lambda init-captures we
previously did not track the difference between direct-list-initialization and
copy-list-initialization. The difference was not previously observable, because
the two forms of initialization always did the same thing (the elements of the
initializer list were always copy-initialized regardless of the initialization
style used for the init-capture).

llvm-svn: 252688
2015-11-11 01:36:17 +00:00
Anna Zaks de14eb5b4e [static analyzer] Don't flag nil storage into NSMutableDictionary.
This is now allowed and has the behavior of removing the mapping.

llvm-svn: 252679
2015-11-11 00:49:22 +00:00
John McCall 28ea04fc4c Define __unsafe_unretained and __autoreleasing in ObjC GC mode.
This was an accidental regression from the MRC __weak patch.

llvm-svn: 252668
2015-11-10 23:00:25 +00:00
Jonathan Roelofs a3219a70be Fix build
llvm-svn: 252667
2015-11-10 22:59:18 +00:00
Jonathan Roelofs 1ff9c63204 Implement post-commit review feedback on r252662
llvm-svn: 252664
2015-11-10 22:48:11 +00:00
Jonathan Roelofs 467ab05291 Implement the fix that r252641 should have been
llvm-svn: 252662
2015-11-10 22:38:59 +00:00
Reid Kleckner 489cfe1401 [COFF] Don't try to emit weak aliases on COFF
This comes up when a derived class destructor is equivalent to a base
class destructor defined in the same TU, and we try to alias them.

A COFF weak alias cannot satisfy a normal undefined symbol reference
from another TU. The other TU must also mark the referenced symbol as
weak, and we can't rely on that.

Clang already has a special case here for dllexport, but we failed to
realize that the problem also applies to other non-discardable symbols
such as those from explicit template instantiations.

Fixes PR25477.

llvm-svn: 252659
2015-11-10 22:23:58 +00:00
Evgeniy Stepanov ae6ebd3af5 Implement __attribute__((internal_linkage)).
The attrubite is applicable to functions and variables and changes
the linkage of the subject to internal.

This is the same functionality as C-style "static", but applicable to
class methods; and the same as anonymouns namespaces, but can apply
to individual methods of a class.

Following the proposal in
http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html

llvm-svn: 252648
2015-11-10 21:28:44 +00:00
Dan Gohman 6db4640b80 [WebAssembly] Change long double to be quadruple-precision floating point.
llvm-svn: 252646
2015-11-10 21:01:46 +00:00
Jonathan Roelofs 2a439a104b Fix missing CMake dependency introduced in r252474
llvm-svn: 252641
2015-11-10 20:01:22 +00:00
Joerg Sonnenberger 4ecfa623e5 Add the variant of __sparc_v9__ with five underscores, not just four.
llvm-svn: 252640
2015-11-10 19:28:17 +00:00
Aaron Ballman 4960df0db3 No longer creating the install-clang target for IDEs, as it was never meant for those.
llvm-svn: 252601
2015-11-10 12:51:25 +00:00
Sean Eveson 00e780e1cc [Analyzer] Fix comments and formatting. NFC.
llvm-svn: 252599
2015-11-10 11:48:55 +00:00
Craig Topper fd778eebac [X86] Use setzero instead of set1(0) in a few places in intrinsic headers.
llvm-svn: 252587
2015-11-10 05:08:08 +00:00
Craig Topper 7148166785 [X86] Remove temporary variables from macros in x86 intrinsic headers. Prevents duplicate names appearing from multiple macro expansions. NFC
llvm-svn: 252586
2015-11-10 05:08:05 +00:00
Craig Topper 166f8b20a3 [X86] Fix bad intrinsic header comment. NFC.
llvm-svn: 252585
2015-11-10 05:08:00 +00:00
Joerg Sonnenberger 5c1ac90715 Use the generic Sparc CPU handling for Linux, FreeBSD and OpenBSD, too.
This currently changes the default toward the more historic -Av8/-Av9,
but as discussed with James Y Knight, consistency is for now more
important than figuring out which default CPU each OS should be using.

llvm-svn: 252571
2015-11-10 00:40:29 +00:00
Joerg Sonnenberger 9d3e4f6651 Use the normal switch over getArch() approach and not a long if chain.
llvm-svn: 252562
2015-11-10 00:23:12 +00:00
Vedant Kumar 0affb93894 [Driver] Use platform-appropriate profiling libraries for WatchOS, TVOS
When adding profiling instrumentation, use libclang_rt.profile_tvos.a
for TVOS targets and libclang_rt.profile_watchos.a for WatchOS targets.

I've also fixed up a comment and added an assert() that prevents us from
defaulting to an incorrect platform.

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

Reviewed-by: t.p.northover
llvm-svn: 252558
2015-11-10 00:20:34 +00:00
Joerg Sonnenberger ec353d3fc6 Reorganise CPU handling for Sparc. When using -mcpu=v9 and co, __sparcv8
is not defined for 32bit mode, but __sparcv9 is. Pass down the correct
-target-cpu flags to the backend, so that instruction restrictions are
applied correctly. Pass down the correct -A flag when not using IAS.
The latter is limited to NetBSD targets in this commit.

llvm-svn: 252545
2015-11-09 23:39:45 +00:00
Chris Bieneman 4e3b36947b [CMake] Support passing CMAKE_VERBOSE_MAKEFILE through to bootstrap builds.
This option enables full verbosity in recursive CMake builds.

llvm-svn: 252523
2015-11-09 22:43:10 +00:00
Evgeniy Stepanov 65bc2b1223 Extend linux header search to find libc++ headers in c++/vN for any N.
llvm-svn: 252514
2015-11-09 21:10:54 +00:00
Tim Northover cc2a6e0608 Atomics: support __c11_* calls on _Atomic struct types.
When a struct's size is not a power of 2, the corresponding _Atomic() type is
promoted to the nearest. We already correctly handled normal C++ expressions of
this form, but direct calls to the __c11_atomic_whatever builtins ended up
performing dodgy operations on the smaller non-atomic types (e.g. memcpy too
much). Later optimisations removed this as undefined behaviour.

This patch converts EmitAtomicExpr to allocate its temporaries at the full
atomic width, sidestepping the issue.

llvm-svn: 252507
2015-11-09 19:56:35 +00:00
Devin Coughlin 9c76869bc3 [analyzer] Fix assertion failure invalidating on const member function calls (PR25392).
We now return early when the 'this' value cannot be converted to a MemRegion.

llvm-svn: 252506
2015-11-09 19:50:29 +00:00
Mike Aizatsky aeb9dd92d5 Moving FileManager::removeDotPaths to llvm::sys::path::remove_dots
Differential Revision: http://reviews.llvm.org/D14394

llvm-svn: 252501
2015-11-09 19:12:18 +00:00
Alexander Kornienko fd6ce04cf6 Use "auto" when the type name is redundant
Summary: Use "auto" when the type name is redundant

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 252494
2015-11-09 17:53:06 +00:00
Jonathan Roelofs 9c0d3f5e6f Fix the cmake build after r252474 broke it
llvm-svn: 252489
2015-11-09 16:47:09 +00:00
Alexander Kornienko 4f35532dbe Adjust printQualifiedName to handle unscoped enums in a way similar to anonymous namespaces.
Patch by Sterling Augustine!

Differential revision: http://reviews.llvm.org/D14459

llvm-svn: 252488
2015-11-09 16:45:17 +00:00
Jonathan Roelofs e961432ae7 Create install targets for scan-build and scan-view
http://reviews.llvm.org/D14403

llvm-svn: 252474
2015-11-09 16:12:56 +00:00
Aaron Ballman 570100b306 Fixing SPHINX warnings with incorrect indentations.
llvm-svn: 252470
2015-11-09 15:24:09 +00:00
Renato Golin 4854d80c39 [EABI] Add Clang support for -meabi flag
The -meabi flag to control LLVM EABI version.

Without '-meabi' or with '-meabi default' imply LLVM triple default.
With '-meabi gnu' sets EABI GNU.
With '-meabi 4' or '-meabi 5' set EABI version 4 and 5 respectively.

A similar patch was introduced in LLVM.

Patch by Vinicius Tinti.

llvm-svn: 252463
2015-11-09 12:40:41 +00:00
Xinliang David Li 2d7ec5a970 [PGO] Code cleanup [NFC]
Use interfaces defined in LLVM to create FuncName
and FuncNameVar.

llvm-svn: 252434
2015-11-09 00:04:16 +00:00
Yaron Keren 30e4515a5f Replace tab with 8 spaces, NFC.
llvm-svn: 252426
2015-11-08 22:01:45 +00:00
Devin Coughlin 2cb767d32b [analyzer] Update SATestBuild.py to enable a 'download and patch' model for projects.
Currently the SATestBuild.py and SATestAdd.py buildbot scripts expect project
sources to be checked into the project repository. This commit changes these
scripts to additionally support a model where project sources are downloaded
rather than checked into the repository. Sometimes projects may need to be
modified (for example, to support a newer versions of clang), so the updated scripts
also allow for an optional patch file that will be applied to the downloaded
project source before analysis.

To support this workflow, this commit changes the expected layout of
a project in the repository. The project-specific helper scripts will stay
in the root of each project directory, but the benchmark source itself (if
checked into the repo) should now be stored in a subdirectory named
'CachedSource':

  project_name/
    cleanup_run_static_analyzer.sh [optional]
    run_static_analyzer.cmd [required]
    download_project.sh [optional]
    CachedSource/ [optional]
    changes_for_analyzer.patch [optional]

If the 'CachedSource' source directory is not present, the download script will
be executed. This script should download the project source into 'CachedSource'.
Then, if 'changes_for_analyzer.patch' is present its changes will
be applied to a copy of 'CachedSource' before analysis.

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

llvm-svn: 252410
2015-11-07 18:27:35 +00:00
Yaron Keren e02bcdca88 Remove spaces in empty line, NFC.
llvm-svn: 252405
2015-11-07 16:35:07 +00:00
Yaron Keren 5f813e8de3 Remove spaces at start of line, NFC.
llvm-svn: 252404
2015-11-07 16:24:52 +00:00
Craig Topper 681242c2be Make a couple methods static.
llvm-svn: 252400
2015-11-07 08:08:34 +00:00
Craig Topper 5ba2c50d9f Make SemaBuiltinCpuSupports a static function. NFC.
llvm-svn: 252399
2015-11-07 08:08:31 +00:00
Craig Topper 882bc8dfed Use makeArrayRef instead of explicitly mentioning the type. NFC
llvm-svn: 252398
2015-11-07 06:16:16 +00:00
Craig Topper a86e70dc0c Fix indentation. NFC
llvm-svn: 252397
2015-11-07 06:16:14 +00:00
Akira Hatanaka 48684b073e Use regex in test case.
This is a follow-up to r252369.

llvm-svn: 252376
2015-11-07 00:48:18 +00:00
Akira Hatanaka c866762272 Add support for function attribute 'not_tail_called'.
This attribute is used to prevent tail-call optimizations to the marked
function. For example, in the following piece of code, foo1 will not be
tail-call optimized: 

int __attribute__((not_tail_called)) foo1(int);

int foo2(int a) {
  return foo1(a); // Tail-call optimization is not performed.
}

The attribute has effect only on statically bound calls. It has no
effect on indirect calls. Also, virtual functions and objective-c
methods cannot be marked as 'not_tail_called'.

rdar://problem/22667622

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

llvm-svn: 252369
2015-11-06 23:56:15 +00:00
Duncan P. N. Exon Smith b126f6b6c8 StaticAnalyzer: Remove implicit ilist iterator conversions, NFC
Remove implicit ilist iterator conversions from clangStaticAnalyzer.

llvm-svn: 252360
2015-11-06 23:04:58 +00:00
Duncan P. N. Exon Smith 9f5260ab13 CodeGen: Remove implicit ilist iterator conversions, NFC
Make ilist iterator conversions explicit in clangCodeGen.  Eventually
I'll remove them everywhere.

llvm-svn: 252358
2015-11-06 23:00:41 +00:00
Aaron Ballman bde4c81ffe Fixing line endings; NFC.
llvm-svn: 252314
2015-11-06 15:34:03 +00:00
Kuba Brecka cc47f200ba Followup test failure fix for r252310 ("[tsan] Add Clang frontend support for TSan on OS X").
llvm-svn: 252311
2015-11-06 15:20:30 +00:00
Kuba Brecka 85e01c0bdc [tsan] Add Clang frontend support for TSan on OS X
We're currently in process of porting TSan to OS X, and quite a few of the initial support in the runtime library has already landed in trunk. This patch actually enables "-fsanitize=thread" in the frontend.

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

llvm-svn: 252310
2015-11-06 15:09:20 +00:00
Petar Jovanovic 73d1044abe Fix __builtin_signbit for ppcf128 type
Function__builtin_signbit returns wrong value for type ppcf128 on big endian
machines. This patch fixes how value is generated in that case.

Patch by Aleksandar Beserminji.

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

llvm-svn: 252307
2015-11-06 14:52:46 +00:00
Yury Gribov 22b4164e7d [analyzer] Add VforkChecker to find unsafe code in vforked process.
This checker looks for unsafe constructs in vforked process:
function calls (excluding whitelist), memory write and returns.
This was originally motivated by a vfork-related bug in xtables package.

Patch by Yury Gribov.

Differential revision: http://reviews.llvm.org/D14014

llvm-svn: 252285
2015-11-06 11:16:31 +00:00
Alexander Kornienko ad98885be1 Refactor: Simplify boolean conditional return statements in lib/ARCMigrate
Patch by Richard Thomson! (+a couple of modifications to address comments)

Differential revision: http://reviews.llvm.org/D10009

llvm-svn: 252261
2015-11-06 01:26:37 +00:00
Alexander Kornienko 090360d630 Refactor: simplify boolean conditional return statements in lib/Analysis
Patch by Richard Thomson!

Differential revision: http://reviews.llvm.org/D10008

llvm-svn: 252256
2015-11-06 01:08:38 +00:00
Keno Fischer 0e2d422254 Fix crash in EmitDeclMetadata mode
Summary: This fixes a bug that's easily encountered in LLDB
(https://llvm.org/bugs/show_bug.cgi?id=22875). The problem here is that we
mangle a name during debug info emission, but never actually emit the actual
Decl, so we run into problems in EmitDeclMetadata (which assumes such a Decl
exists). Fix that by just skipping metadata emissions for mangled names that
don't have associated Decls.

Reviewers: rjmccall

Subscribers: labath, cfe-commits

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

llvm-svn: 252229
2015-11-05 23:18:44 +00:00
Richard Smith ea26041bbb Better link for Library Fundamentals TS.
llvm-svn: 252223
2015-11-05 22:21:52 +00:00
Peter Collingbourne 0900fe0f1b CodeGen: Update for debug info API change.
Differential Revision: http://reviews.llvm.org/D14266

llvm-svn: 252220
2015-11-05 22:04:14 +00:00
Richard Smith 3f22bf947d Fix incorrect status for P0012R1.
llvm-svn: 252216
2015-11-05 21:42:32 +00:00
Richard Smith 60fc149e43 Fix CSS style name.
llvm-svn: 252215
2015-11-05 21:42:07 +00:00
Richard Smith 894835f611 Update C++ status page to match motions from Kona.
llvm-svn: 252214
2015-11-05 21:41:06 +00:00
Richard Smith d0637bd1c6 PR25368: Replace workaround for build failure with modules enabled with a fix
for the root cause. The 'using llvm::isa;' declaration in Basic/LLVM.h only
pulls the declarations of llvm::isa that were declared prior to it into
namespace clang. In a modules build, this is a hermetic set of just the
declarations from LLVM. In a non-modules build, we happened to also pull the
declaration from lib/CodeGen/Address.h into namespace clang, which made the
code in question accidentally compile.

llvm-svn: 252211
2015-11-05 21:16:22 +00:00
Richard Smith 85f93f34cb Improve macro dumping to preserve semantically-relevant spelling information.
llvm-svn: 252206
2015-11-05 20:55:14 +00:00
Dan Gohman 24f0a08c1b [WebAssembly] Update wasm builtin functions to match spec changes.
The page_size operator has been removed from the spec, and the resize_memory
operator has been changed to grow_memory.

llvm-svn: 252201
2015-11-05 20:16:37 +00:00
John McCall fbe5ed7807 After some discussion, promote -fobjc-weak to a driver option.
rdar://problem/23415863

llvm-svn: 252187
2015-11-05 19:19:56 +00:00
Devin Coughlin e949add687 [analyzer] Update RegionStoreManager::getBinding to handle BlockDataRegions
Update RegionStoreManager::getBinding() to return UnknownVal when trying to get
the binding for a BlockDataRegion. Previously, getBinding() would try to cast the
BlockDataRegion to a TypedValueRegion and crash. This happened when a block
was passed as a parameter to an inlined function for which
StackHintGeneratorForSymbol::getMessage() tried to generate a stack hint message.

rdar://problem/21291971

llvm-svn: 252185
2015-11-05 18:56:42 +00:00
Alexandros Lamprineas f6ecf96390 [ARM] Clang gives unintended warning message for 'mthumb' + M-profiles:
$ clang --target=armv7m-none-eabi -mthumb -march=armv7-m -c test.c
clang-3.8: warning: argument unused during compilation: '-mthumb'

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

llvm-svn: 252175
2015-11-05 17:11:55 +00:00
Manuel Klimek e8bd0db698 Allow use of private headers in different sub-modules.
llvm-svn: 252170
2015-11-05 15:24:47 +00:00
Andrey Bokhanko 94e1d5831b [x86] Additional small fix for MCU psABI support
This patch fixes one more thing in MCU psABI support: LongDoubleWidth should be set to 64.

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

llvm-svn: 252156
2015-11-05 12:43:09 +00:00
Xinliang David Li a026a43719 Use profile data template file for covmap func record (NFC)
llvm-svn: 252147
2015-11-05 05:46:39 +00:00
Alexander Kornienko 857b10f471 Make ArgumentAdjuster aware of the current file being processed.
Summary:
This is needed to handle per-project configurations when adding extra
arguments in clang-tidy for example.

Reviewers: klimek, djasper

Subscribers: djasper, cfe-commits, klimek

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

llvm-svn: 252134
2015-11-05 02:19:53 +00:00
NAKAMURA Takumi 3ee9b16b07 TestModuleFileExtension.cpp: Include <cstdio> explicitly for fprintf(3).
llvm-svn: 252128
2015-11-05 01:34:19 +00:00
Richard Smith edcc92a4c1 [modules] Don't merge an anonymous enum definition into a named enum definition.
llvm-svn: 252125
2015-11-05 01:30:19 +00:00
David Majnemer 18e9625edb Fix build break
llvm-svn: 252120
2015-11-05 01:10:42 +00:00
David Majnemer 5088cdf4d1 [Lex] Add __has_builtin support for __make_integer_seq
Differential Revision: http://reviews.llvm.org/D14349

llvm-svn: 252115
2015-11-05 01:01:47 +00:00
Richard Smith 8a308ec24d [modules] If we're given a module file, via -fmodule-file=, for a module, but
we can't load that file due to a configuration mismatch, and implicit module
building is disabled, and the user turns off the error-by-default warning for
that situation, then fall back to textual inclusion for the module rather than
giving an error if any of its headers are included.

llvm-svn: 252114
2015-11-05 00:54:55 +00:00
Reid Kleckner 0626919015 Fix nullptr crash in -Wthread-safety-beta
llvm-svn: 252107
2015-11-05 00:24:01 +00:00
Aaron Ballman b035cd7ea4 The control expression for a _Generic selection expression should have
its type decayed and qualifiers stripped when determining which
selection it matches. Fixes PR16340.

llvm-svn: 252104
2015-11-05 00:06:05 +00:00
Daniel Jasper 49dbbdb3b3 clang-format: Turn on wrapping before "else" for WebKit style.
llvm-svn: 252089
2015-11-04 22:49:32 +00:00
Eugene Zelenko d4304d2f9c Fix some Clang-tidy modernize warnings, other minor fixes.
Differential revision: http://reviews.llvm.org/D14311

llvm-svn: 252081
2015-11-04 21:37:17 +00:00
Devin Coughlin 0500c70beb [analyzer] Add 'optin' checker package and move localizability checkers into it.
This commit creates a new 'optin' top-level checker package and moves several of
the localizability checkers into it.

This package is for checkers that are not alpha and that would normally be on by
default but where the driver does not have enough information to determine when
they are applicable. The localizability checkers fit this criterion because the
driver cannot determine whether a project is localized or not -- this is best
determined at the IDE or build-system level.

This new package is *not* intended for checkers that are too noisy to be on by
default.

The hierarchy under 'optin' mirrors that in 'alpha': checkers under 'optin'
should be organized in the hierarchy they would have had if they were truly top
level (e.g., optin.osx.cocoa.MyOptInChecker).

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

llvm-svn: 252080
2015-11-04 21:33:41 +00:00