]> granicus.if.org Git - clang/log
clang
8 years ago[OPENMP] Avoid useless recursive calls in getDSA if it is called in a loop, NFC
Dmitry Polukhin [Fri, 1 Apr 2016 09:52:30 +0000 (09:52 +0000)]
[OPENMP] Avoid useless recursive calls in getDSA if it is called in a loop, NFC

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

8 years ago[OPENMP 4.5] Allow data members as loop counters in loop-based
Alexey Bataev [Fri, 1 Apr 2016 09:23:34 +0000 (09:23 +0000)]
[OPENMP 4.5] Allow data members as loop counters in loop-based
directives.

OpenMP 4.5 allows privatization of non-static data members in non-static
member functions. Patch allows to use and implicit privatization of data
members used as counters in loop-based directives.

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

8 years agoRevert "[OPENMP] Allow skip expression after comma in clauses with lists."
Alexey Bataev [Fri, 1 Apr 2016 08:43:42 +0000 (08:43 +0000)]
Revert "[OPENMP] Allow skip expression after comma in clauses with lists."

This reverts commit http://reviews.llvm.org/rL265003. After some
thoughts decided to emit errors here.

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

8 years agoVisual Studio native visualizers for clang::TemplateSpecializationType
Mike Spertus [Fri, 1 Apr 2016 03:31:43 +0000 (03:31 +0000)]
Visual Studio native visualizers for clang::TemplateSpecializationType

Displays a template specialization as, say, A<int, double>. Does not
yet handle UncommonTemplateNameStorage, QualifiedTemplateName, or
DependentTemplateName, but still more than worthwhile

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

8 years ago[analyzer] Prefer accessor method in extension over category in CallEvent.
Devin Coughlin [Fri, 1 Apr 2016 03:24:13 +0000 (03:24 +0000)]
[analyzer] Prefer accessor method in extension over category in CallEvent.

In ObjCMethodCall:getRuntimeDefinition(), if the method is an accessor in a
category, and it doesn't have a self declaration, first try to find the method
in a class extension. This works around a bug in Sema where multiple accessors
are synthesized for properties in class extensions that are redeclared in a
category. The implicit parameters are not filled in for the method on the
category, which causes a crash when trying to synthesize a getter for the
property in BodyFarm. The Sema bug is tracked as rdar://problem/25481164.

rdar://problem/25056531

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

8 years ago[CUDA] Fix typo in __clang_cuda_runtime_wrapper.h.
Justin Lebar [Fri, 1 Apr 2016 00:25:42 +0000 (00:25 +0000)]
[CUDA] Fix typo in __clang_cuda_runtime_wrapper.h.

We're #including the wrong file!

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

8 years agoAdapt to LLVM API change in r265077.
Adrian Prantl [Thu, 31 Mar 2016 23:57:45 +0000 (23:57 +0000)]
Adapt to LLVM API change in r265077.
EmissionKind moved from DIBuilder to DICompileUnit.

<rdar://problem/25427165>

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

8 years ago[index] Fix regression where ObjC method declarations may mistakenly get indexed...
Argyrios Kyrtzidis [Thu, 31 Mar 2016 20:18:22 +0000 (20:18 +0000)]
[index] Fix regression where ObjC method declarations may mistakenly get indexed as definition.

rdar://25372906

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

8 years agoDiagnostics: remove dodgy handler for bitcode inlineasm diagnostics.
Tim Northover [Thu, 31 Mar 2016 19:19:24 +0000 (19:19 +0000)]
Diagnostics: remove dodgy handler for bitcode inlineasm diagnostics.

Whatever crash it was there to present appears to have been fixed in the
backend now, and it had the nasty side-effect of causing clang to exit(0) and
leave a .o containing goodness knows what even when an error hit.

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

8 years ago[PGO] Avoid instrumenting constants at value sites
Betul Buyukkurt [Thu, 31 Mar 2016 18:41:34 +0000 (18:41 +0000)]
[PGO] Avoid instrumenting constants at value sites

Value profiling should not profile constants and/or constant
expressions when they appear as callees in call instructions.
Constant expressions form when a direct callee has bitcasts or
inttoptr(ptrtint (callee)) nests surrounding it. Value profiling
should avoid instrumenting such cases. Mostly NFC.

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

8 years agoFix the comment for the function added in r264998.
Akira Hatanaka [Thu, 31 Mar 2016 18:32:38 +0000 (18:32 +0000)]
Fix the comment for the function added in r264998.

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

8 years ago[OpenCL] Added nosvm attribute for OpenCL v2.0.
Anastasia Stulova [Thu, 31 Mar 2016 11:07:22 +0000 (11:07 +0000)]
[OpenCL] Added nosvm attribute for OpenCL v2.0.

It is not widely used and removed from OpenCL v2.1.

This change modifies Clang to parse the attribute for OpenCL
but ignores it afterwards.

Patch by Liu Yaxun (Sam)!

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

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

8 years ago[OPENMP] Support dumping OpenMP specific constructs.
Alexey Bataev [Thu, 31 Mar 2016 09:30:50 +0000 (09:30 +0000)]
[OPENMP] Support dumping OpenMP specific constructs.

Add proper dumping support for OpenMP declarations, directives and
clauses.

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

8 years ago[OPENMP] Allow skip expression after comma in clauses with lists.
Alexey Bataev [Thu, 31 Mar 2016 09:13:44 +0000 (09:13 +0000)]
[OPENMP] Allow skip expression after comma in clauses with lists.

Compatibility fix for better compatibility with the existing software.

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

8 years ago[CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte
Akira Hatanaka [Thu, 31 Mar 2016 06:36:07 +0000 (06:36 +0000)]
[CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte
alignment on Darwin.

Itanium C++ ABI specifies that _Unwind_Exception should be double-word
aligned (16B). To conform to the ABI, libraries implementing exception
handling declare the struct with __attribute__((aligned)), which aligns
the unwindHeader field (and the end of __cxa_exception) to the default
target alignment (which is typically 16-bytes).

struct __cxa_exception {
  ...
  // struct is declared with __attribute__((aligned)).
  _Unwind_Exception unwindHeader;
};

Based on the assumption that _Unwind_Exception is declared with
__attribute__((aligned)), ItaniumCXXABI::getAlignmentOfExnObject returns
the target default alignment for __attribute__((aligned)). It turns out
that libc++abi, which is used on Darwin, doesn't declare the struct with
the attribute and therefore doesn't guarantee that unwindHeader is
aligned to the alignment specified by the ABI, which in some cases
causes the program to crash because of unaligned memory accesses.

This commit avoids crashes due to unaligned memory accesses by having
getAlignmentOfExnObject return an 8-byte alignment on Darwin. I've only
fixed the problem for Darwin, but we should also figure out whether other
platforms using libc++abi need similar fixes.

rdar://problem/25314277

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

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

8 years agoVisual Studio native visualization for clang::TemplateDecl
Mike Spertus [Thu, 31 Mar 2016 06:09:56 +0000 (06:09 +0000)]
Visual Studio native visualization for clang::TemplateDecl

With this change, TemplateDecls display in the Locals Window something like

  template<typename T, typename U> struct A;

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

8 years agoFix -Wdynamic-class-memaccess to skip invalid classes.
Richard Trieu [Thu, 31 Mar 2016 04:18:07 +0000 (04:18 +0000)]
Fix -Wdynamic-class-memaccess to skip invalid classes.

This warning sometimes will infinitely recurse on CXXRecordDecl's from
ill-formed recursive classes that have fields of themselves.  Skip processing
these classes to prevent this from happening.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27142

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

8 years ago[DarwinDriver] Increase the number of valid digits for ld64 version string.
Bruno Cardoso Lopes [Thu, 31 Mar 2016 02:45:46 +0000 (02:45 +0000)]
[DarwinDriver] Increase the number of valid digits for ld64 version string.

Previously only 3 digits were valid. Increase it to 5.

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

rdar://problem/24843016

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

8 years ago[Sema] Fix PR27122: ICE with enable_if+ill-formed call.
George Burgess IV [Thu, 31 Mar 2016 00:16:25 +0000 (00:16 +0000)]
[Sema] Fix PR27122: ICE with enable_if+ill-formed call.

In some cases, when we encounter a direct function call with an
incorrect number of arguments, we'll emit a diagnostic, and pretend that
the call to the function was valid. For example, in C:

int foo();
int a = foo(1);

Prior to this patch, we'd get an ICE if foo had an enable_if attribute,
because CheckEnableIf assumes that the number of arguments it gets
passed is valid for the function it's passed. Now, we check that the
number of args looks valid prior to checking enable_if conditions.

This fix was not done inside of CheckEnableIf because the problem
presently can only occur in one caller of CheckEnableIf (ActOnCallExpr).
Additionally, checking inside of CheckEnableIf would make us emit
multiple diagnostics for the same error (one "enable_if failed", one
"you gave this function the wrong number of arguments"), which seems
worse than just complaining about the latter.

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

8 years ago[CrashReproducer] Add a module map callback for added headers
Bruno Cardoso Lopes [Wed, 30 Mar 2016 23:54:25 +0000 (23:54 +0000)]
[CrashReproducer] Add a module map callback for added headers

The current ModuleDependencyCollector has a AST listener to collect
header files present in loaded modules, but this isn't enough to collect
all headers needed in the crash reproducer. One of the reasons is that
the AST writer doesn't write symbolic link header paths in the pcm modules,
this makes the listeners on the reader only able to collect the real files.

Since the module maps could contain submodules that use headers which
are symbolic links, not collecting those forbid the reproducer scripts
to regen the modules.

For instance:

usr/include/module.map:
  ...
  module pthread {
    header "pthread.h"
    export *

    module impl {
      header "pthread_impl.h"
      export *
    }
  }
  ...

usr/include/pthread/pthread_impl.h
usr/include/pthread_impl.h -> pthread/pthread_impl.h

The AST dump for the module above:

  <SUBMODULE_HEADER abbrevid=6/> blob data = 'pthread_impl.h'
  <SUBMODULE_TOPHEADER abbrevid=7/> blob data = '/<path_to_sdk>/usr/include/pthread/pthread_impl.h'

Note that we don't have "usr/include/pthread_impl.h" which is requested
by the module.map in case we want to reconstruct the module in the
reproducer. The reason the original symbolic link path isn't used is
because the headers are kept by name and requested through the
FileManager, which unique files and returns the real path only.

To fix that, add a callback to be invoked everytime a header is added
while parsing module maps and hook that up to the module dependecy
collector. This callback is only registered when generating the
reproducer.

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

rdar://problem/24499339

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

8 years ago[VFS] Handle empty entries in directory traversal
Bruno Cardoso Lopes [Wed, 30 Mar 2016 23:54:00 +0000 (23:54 +0000)]
[VFS] Handle empty entries in directory traversal

The VFS YAML files contain empty directory entries to describe that it's
returning from a subdirectory before describing new files in the parent.
In the future, we should properly sort and write YAML files avoiding
such empty dirs and mitigate the extra recurson cost. However, since
this is used by previous existing YAMLs, make the traversal work in
their presence.

rdar://problem/24499339

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

8 years ago[CUDA] Add -disable-llvm-passes to CodeGenCUDA/link-device-bitcode.cu. NFC
Justin Lebar [Wed, 30 Mar 2016 23:45:38 +0000 (23:45 +0000)]
[CUDA] Add -disable-llvm-passes to CodeGenCUDA/link-device-bitcode.cu.  NFC

We already have this flag in most of the file, but we need it everywhere
else, to disable the NVVMReflect pass, which we're explicitly checking
doesn't run here.  (Upcoming changes to llvm will cause it to be run.)

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

8 years agoFix deduction of __atomic_load's parameter types.
Eric Fiselier [Wed, 30 Mar 2016 23:39:56 +0000 (23:39 +0000)]
Fix deduction of __atomic_load's parameter types.

Summary:
__atomic_load's allows it's first argument to be a pointer to a const type. However the second argument is an output parameter and must be a pointer to non-const.
This patch fixes the signature of __atomic_load generated by clang so that it respects the above requirements.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

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

8 years ago[CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.
Justin Lebar [Wed, 30 Mar 2016 23:30:25 +0000 (23:30 +0000)]
[CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.

Summary:
This prevents errors when you invoke clang with a flag that the NVPTX
toolchain doesn't support.  For example, on x86-64,

  clang -mthread-model single -x c++ /dev/null -o /dev/null

should output just one error about "invalid thread model 'single' in
'-mthread-model single' for this target"; x86-64 doesn't support
-mthread-model, but we shouldn't also instantiate a NVPTX target!

Reviewers: echristo

Subscribers: tra, sunfish, cfe-commits

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

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

8 years ago[CUDA] Make unattributed constexpr functions implicitly host+device.
Justin Lebar [Wed, 30 Mar 2016 23:30:21 +0000 (23:30 +0000)]
[CUDA] Make unattributed constexpr functions implicitly host+device.

With this patch, by a constexpr function is implicitly host+device
unless:

 a) it's a variadic function (variadic functions are not allowed on the
    device side), or
 b) it's preceeded by a __device__ overload in a system header.

The restriction on overloading __host__ __device__ functions on the
basis of their CUDA attributes remains in place, but we use (b) to allow
us to define __device__ overloads for constexpr functions in cmath,
which would otherwise be __host__ __device__ and thus not overloadable.

You can disable this behavior with -fno-cuda-host-device-constexpr.

Reviewers: tra, rnk, rsmith

Subscribers: cfe-commits

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

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

8 years ago[CUDA] Add math forward declares to CUDA header wrapper.
Justin Lebar [Wed, 30 Mar 2016 23:30:14 +0000 (23:30 +0000)]
[CUDA] Add math forward declares to CUDA header wrapper.

Summary:
This is necessary for a future patch which will make all constexpr
functions implicitly host+device.  cmath may declare constexpr
functions, but these we do *not* want to be host+device.  The forward
declares added in this patch prevent this (because the rule will be,
constexpr functions become implicitly host+device unless they're
preceeded by a decl with __device__).

Reviewers: tra

Subscribers: cfe-commits, rnk, rsmith

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

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

8 years agoAMDGPU: Add frexp_mant + frexp_exp builtins
Matt Arsenault [Wed, 30 Mar 2016 22:57:40 +0000 (22:57 +0000)]
AMDGPU: Add frexp_mant + frexp_exp builtins

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

8 years agoUpdate copyright year to 2016.
Paul Robinson [Wed, 30 Mar 2016 22:38:44 +0000 (22:38 +0000)]
Update copyright year to 2016.

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

8 years agoDocs: keep copyright years up-to-date.
Paul Robinson [Wed, 30 Mar 2016 22:24:57 +0000 (22:24 +0000)]
Docs: keep copyright years up-to-date.

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

8 years agoFix Clang crash with template type diffing.
Richard Trieu [Wed, 30 Mar 2016 22:23:00 +0000 (22:23 +0000)]
Fix Clang crash with template type diffing.

Fixes https://llvm.org/bugs/show_bug.cgi?id=27129 which is crash involving type
aliases and template type diffing.  Template arguments for type aliases and
template arguments for the underlying desugared type may not have one-to-one
relations, which could mess us the attempt to get more information from the
desugared type.  For type aliases, ignore the iterator over the desugared type.

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

8 years agoAdd -emit-llvm-only to the regression test for PR21547.
Vassil Vassilev [Wed, 30 Mar 2016 22:22:50 +0000 (22:22 +0000)]
Add -emit-llvm-only to the regression test for PR21547.

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

8 years agoCanonicalize UnaryTransformType types when they don't have a known underlying type.
Vassil Vassilev [Wed, 30 Mar 2016 22:18:29 +0000 (22:18 +0000)]
Canonicalize UnaryTransformType types when they don't have a known underlying type.

Fixes https://llvm.org/bugs/show_bug.cgi?id=26014

Reviewed by Richard Smith.

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

8 years agoSilencing warnings from MSVC 2015 Update 2. Both of these changes silence "C4334...
Aaron Ballman [Wed, 30 Mar 2016 21:33:34 +0000 (21:33 +0000)]
Silencing warnings from MSVC 2015 Update 2. Both of these changes silence "C4334 '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)". NFC.

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

8 years agoAMDGPU: Remove separate r600 double data layout
Matt Arsenault [Wed, 30 Mar 2016 21:32:37 +0000 (21:32 +0000)]
AMDGPU: Remove separate r600 double data layout

This is identical to the other r600 datalayout string.

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

8 years ago[Clang][ARM] __va_list declaration is not saved in ASTContext causing compilation...
Oleg Ranevskyy [Wed, 30 Mar 2016 21:30:30 +0000 (21:30 +0000)]
[Clang][ARM] __va_list declaration is not saved in ASTContext causing compilation error or crash

Summary:
When the code is compiled for arm32 and the builtin `__va_list` declaration is created by `CreateAAPCSABIBuiltinVaListDecl`, the declaration is not saved in the `ASTContext` which may lead to a compilation error or crash.

Minimal reproducer I was able to find:
**header.h**
```
#include <stdarg.h>
typedef va_list va_list_1;
```

**test.cpp**
```
typedef __builtin_va_list va_list_2;
void foo(const char* format, ...) { va_list args; va_start( args, format ); }
```

Steps to reproduce:
```
clang -x c++-header --target=armv7l-linux-eabihf header.h
clang -c -include header.h --target=armv7l-linux-eabihf test.cpp
```

Compilation error:
```
error: non-const lvalue reference to type '__builtin_va_list'
      cannot bind to a value of unrelated type 'va_list' (aka '__builtin_va_list')
```

Compiling the same code as a C source leads to a crash:
```
clang --target=armv7l-linux-eabihf header.h
clang -c -x c -include header.h --target=armv7l-linux-eabihf test.cpp
```

Reviewers: logan, rsmith

Subscribers: cfe-commits, asl, aemerson, rengolin

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

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

8 years ago[Sema] s/UseUsingDeclRules/UseMemberUsingDeclRules/
Justin Lebar [Wed, 30 Mar 2016 20:41:05 +0000 (20:41 +0000)]
[Sema] s/UseUsingDeclRules/UseMemberUsingDeclRules/

Summary:
IsOverload has a param named UseUsingDeclRules.  But as far as I can
tell, it should be called UseMemberUsingDeclRules.  That is, it only
applies to "using" declarations inside classes or structs.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

8 years ago[modules] Write out identifiers if the ID is local, too.
Vassil Vassilev [Wed, 30 Mar 2016 20:16:03 +0000 (20:16 +0000)]
[modules] Write out identifiers if the ID is local, too.

In some cases a slot for an identifier is requested but it gets written to
another module, causing an assertion.

At the point when we start serializing Rtypes, we have no imported IdentifierID
for float_round_style. We start serializing stuff and allocate an ID for it.
Then, during the serialization process, we pull in the identifier info for it
from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier
has not changed since it was deserialized, so doesn't emit it.

Fixes https://llvm.org/bugs/show_bug.cgi?id=27041

Discussed on IRC with Richard Smith. Agreed on post commit review if needed.

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

8 years ago[modules] Add a regression test for PR21547.
Vassil Vassilev [Wed, 30 Mar 2016 20:10:07 +0000 (20:10 +0000)]
[modules] Add a regression test for PR21547.

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

8 years ago[c-index-test] Delete dead function, NFC
Vedant Kumar [Wed, 30 Mar 2016 16:03:02 +0000 (16:03 +0000)]
[c-index-test] Delete dead function, NFC

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

8 years ago[SystemZ] Specify required features for builtins.
Jonas Paulsson [Wed, 30 Mar 2016 15:51:24 +0000 (15:51 +0000)]
[SystemZ] Specify required features for builtins.

BuiltinsSystemZ.def is extended to include the required processor
features per intrinsic.

New test test/CodeGen/builtins-systemz-error2.c that checks for
expected errors when instrinsics are used with a subtarget that does
not support the required feature (e.g. vector support).

Reviewed by Ulrich Weigand.

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

8 years agoPrepare tests for change to emit Module SourceFileName to LLVM assembly
Teresa Johnson [Wed, 30 Mar 2016 13:59:49 +0000 (13:59 +0000)]
Prepare tests for change to emit Module SourceFileName to LLVM assembly

Modify these tests to ignore the source file name when looking for the
expected string. It was already catching the source file name once via
the ModuleID, and will catch it another time with an impending change to
LLVM to serialize out the module's SourceFileName.

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

8 years ago[ASTMatchers] Existing matcher hasAnyArgument fixed
Gabor Horvath [Wed, 30 Mar 2016 11:22:14 +0000 (11:22 +0000)]
[ASTMatchers] Existing matcher hasAnyArgument fixed

Summary: A checker (will be uploaded after this patch) needs to check implicit casts. The checker needs matcher hasAnyArgument but it ignores implicit casts and parenthesized expressions which disables checking of implicit casts for arguments in the checker. However the documentation of the matcher contains a FIXME that this should be removed once separate matchers for ignoring implicit casts and parenthesized expressions are ready. Since these matchers were already there the fix could be executed. Only one Clang checker was affected which was also fixed (ignoreParenImpCasts added) and is separately uploaded. Third party checkers (not in the Clang repository) may be affected by this fix so the fix must be emphasized in the release notes.

Reviewers: klimek, sbenza, alexfh

Subscribers: alexfh, klimek, xazax.hun, cfe-commits

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

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

8 years ago[OPENMP 4.0] Initial support for '#pragma omp declare simd' directive.
Alexey Bataev [Wed, 30 Mar 2016 10:43:55 +0000 (10:43 +0000)]
[OPENMP 4.0] Initial support for '#pragma omp declare simd' directive.

Initial parsing/sema/serialization/deserialization support for '#pragma
omp declare simd' directive.
The 'declare simd' construct can be applied to a function to enable the
creation of one or more versions that can process multiple arguments
using SIMD instructions from a single invocation from a SIMD loop.
If the function has any declarations, then the declare simd construct
for any declaration that has one must be equivalent to the one specified
 for the definition. Otherwise, the result is unspecified.
This pragma can be applied many times to the same declaration.
Internally this pragma is represented as an attribute. But we need special processing for this pragma because it must be used before function declaration, this directive is applied to.
Differential Revision: http://reviews.llvm.org/D10599

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

8 years ago[analyzer] Fix an assertion fail in hash generation.
Gabor Horvath [Wed, 30 Mar 2016 10:08:59 +0000 (10:08 +0000)]
[analyzer] Fix an assertion fail in hash generation.

In case the (uniqueing) location of the diagnostic is in a line that only
contains whitespaces there was an assertion fail during issue hash generation.

Unfortunately I am unable to reproduce this error with the built in checkers,
so no there is no failing test case with this patch. It would be possible to
write a debug checker for that purpuse but it does not worth the effort.

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

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

8 years agoFor MS ABI, emit dllexport friend functions defined inline in class
Stephan Bergmann [Wed, 30 Mar 2016 06:27:31 +0000 (06:27 +0000)]
For MS ABI, emit dllexport friend functions defined inline in class

...as that is apparently what MSVC does.  This is an updated version of r263738,
which had to be reverted in r263740 due to test failures.  The original version
had erroneously emitted functions that are defined in class templates, too (see
the updated "Handle friend functions" code in EmitDeferredDecls,
lib/CodeGen/ModuleBuilder.cpp).  (The updated tests needed to be split out into
their own dllexport-ms-friend.cpp because of the CHECK-NOTs which would have
interfered with subsequent CHECK-DAGs in dllexport.cpp.)

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

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

8 years ago[OpenCL] Fix pipe builtin bugs
Xiuli Pan [Wed, 30 Mar 2016 04:46:32 +0000 (04:46 +0000)]
[OpenCL] Fix pipe builtin bugs

Summary:
1. Diag should be output if types are not the same.
2. Should compare using canonical type.
3. Refine the diag to be more clear.

Reviewers: yaxunl, Anastasia

Subscribers: MatsPetersson, pekka.jaaskelainen, cfe-commits

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

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

8 years ago[Driver] Quote clang full version in dwarf producer when invoking cc1as
Bruno Cardoso Lopes [Wed, 30 Mar 2016 00:25:57 +0000 (00:25 +0000)]
[Driver] Quote clang full version in dwarf producer when invoking cc1as

Convenience to allow easy copy-n-paste from clang -v output when
reproducing cc1as comandline.

rdar://problem/23959295

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

8 years ago[CrashReproducer] Cleanup and move functionality around in ModuleDependencyCollector...
Bruno Cardoso Lopes [Tue, 29 Mar 2016 23:47:40 +0000 (23:47 +0000)]
[CrashReproducer] Cleanup and move functionality around in ModuleDependencyCollector. NFC

- Make ModuleDependencyCollector use the DependencyCollector interface
- Move some methods from ModuleDependencyListener to ModuleDependencyCollector
in order to share common functionality with other future possible
callbacks.

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

8 years agoFixing PR26558: remove the adx target attribute requirement from adc builtins.
Yunzhong Gao [Tue, 29 Mar 2016 22:59:20 +0000 (22:59 +0000)]
Fixing PR26558: remove the adx target attribute requirement from adc builtins.

The addcarry and subborrow variants of the builtins do not require the adx
target attribute; only the addcarryx variants require them.

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

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

8 years ago[PGO] Test case fix for r264783
Betul Buyukkurt [Tue, 29 Mar 2016 22:17:52 +0000 (22:17 +0000)]
[PGO] Test case fix for r264783

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

8 years ago[Sema] Attempt [3] to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 21:30:58 +0000 (21:30 +0000)]
[Sema] Attempt [3] to fix tests for utf-8 invalid format string specifiers

Make the tests darwin only. The bots complaining already output UTF-8
invalid specifiers, test the output as we expect on darwin systems.

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

8 years agoEnable the SafeStack sanitizer on CloudABI by default.
Ed Schouten [Tue, 29 Mar 2016 21:13:53 +0000 (21:13 +0000)]
Enable the SafeStack sanitizer on CloudABI by default.

Over the last month we've been testing SafeStack extensively. As far as
we know, it works perfectly fine. That why I'd like to see us having
this enabled by default for CloudABI.

This change introduces a getDefaultSanitizers() function that toolchains
can use to specify which sanitizers are enabled by default. Once all
flags are processed, only flags that had no -fno-sanitize overrides are
enabled.

Extend the thests for CloudABI to test both the default case and the
case in which we want to explicitly disable SafeStack.

Reviewed by: eugenis, pcc
Differential Revision: http://reviews.llvm.org/D18505

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

8 years ago[Sema] Attempt [2] to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 20:47:09 +0000 (20:47 +0000)]
[Sema] Attempt [2] to fix tests for utf-8 invalid format string specifiers

Some buildbots still complain. Followup from r264752 and 264765.

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

8 years ago[PGO] Move the instrumentation point closer to the value site.
Betul Buyukkurt [Tue, 29 Mar 2016 20:44:09 +0000 (20:44 +0000)]
[PGO] Move the instrumentation point closer to the value site.

For terminator instructions, the value profiling instrumentation
happens in a basic block other than where the value site resides.
This CR moves the instrumentation point prior to the value site.
Mostly NFC.

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

8 years agoclang-cl: Silently ignore /d2FastFail flag.
Nico Weber [Tue, 29 Mar 2016 19:41:02 +0000 (19:41 +0000)]
clang-cl: Silently ignore /d2FastFail flag.

It's some debugging flag for cl.exe related to how it writes crash dumps.

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

8 years ago[Sema] Attempt to fix tests for utf-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 18:38:44 +0000 (18:38 +0000)]
[Sema] Attempt to fix tests for utf-8 invalid format string specifiers

Followup from r264752.

Attempt to appease buildbots:
 http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2882
 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2619

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

8 years agoRemoved class FormatStyle, which is a struct, forward declaration from Refactoring...
Eric Liu [Tue, 29 Mar 2016 18:17:11 +0000 (18:17 +0000)]
Removed class FormatStyle, which is a struct, forward declaration from Refactoring.h to avoid compilation error.

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

8 years ago[Order Files] Fix order file usage
Chris Bieneman [Tue, 29 Mar 2016 17:51:08 +0000 (17:51 +0000)]
[Order Files] Fix order file usage

The CMake EXISTS operator needs to have the variable expanded. Not expanding this was causing the if statement to always be false, which made it impossible to pass linker order files in.

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

8 years ago[Sema] Handle UTF-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 17:35:02 +0000 (17:35 +0000)]
[Sema] Handle UTF-8 invalid format string specifiers

Improve invalid format string specifier handling by printing out
invalid specifiers characters with \x, \u and \U. Previously clang
would print gargabe whenever the character is unprintable.

Example, before:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier ' [-Wformat-invalid-specifier]
after:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier '\u25b9' [-Wformat-invalid-specifier]

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

rdar://problem/24672159

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

8 years agoAdded formatAndApplyAllReplacements that works on multiple files in libTooling.
Eric Liu [Tue, 29 Mar 2016 16:31:53 +0000 (16:31 +0000)]
Added formatAndApplyAllReplacements that works on multiple files in libTooling.

Summary:
formatAndApplyAllReplacements takes a set of Replacements, applies them on a
Rewriter, and reformats the changed code.

Reviewers: klimek, djasper

Subscribers: ioeric, klimek, cfe-commits

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

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

8 years ago[CUDA] Add missing #undef __DEVICE__ to CUDA shim header.
Justin Lebar [Tue, 29 Mar 2016 16:24:23 +0000 (16:24 +0000)]
[CUDA] Add missing #undef __DEVICE__ to CUDA shim header.

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

8 years ago[CUDA] Fix order of overloading preferences in comment.
Justin Lebar [Tue, 29 Mar 2016 16:24:22 +0000 (16:24 +0000)]
[CUDA] Fix order of overloading preferences in comment.

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

8 years ago[CUDA] Make CUDA description strings in langopts into noun phrases. NFC
Justin Lebar [Tue, 29 Mar 2016 16:24:20 +0000 (16:24 +0000)]
[CUDA] Make CUDA description strings in langopts into noun phrases.  NFC

rsmith quoth in D18380:

> This should be a noun phrase -- this string appears in contexts like
> "support for %0 is enabled" -- so this should be "treating
> unattributed [...]".

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

8 years ago[CUDA] Remove three obsolete CUDA cc1 flags.
Justin Lebar [Tue, 29 Mar 2016 16:24:16 +0000 (16:24 +0000)]
[CUDA] Remove three obsolete CUDA cc1 flags.

Summary:
* -fcuda-target-overloads

  Previously unconditionally set to true by the driver.  Necessary for
  correct functioning of the compiler -- our CUDA headers wrapper won't
  compile without this.

* -fcuda-disable-target-call-checks

  Previously unconditionally set to true by the driver.  Necessary to
  compile almost any external CUDA code -- almost all libraries assume
  that host+device code can call host or device functions.

* -fcuda-allow-host-calls-from-host-device

  No effect when target overloading is enabled.

Reviewers: tra

Subscribers: rsmith, cfe-commits

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

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

8 years ago[AMDGPU] Switch linker to amdphdrs + update test
Konstantin Zhuravlyov [Tue, 29 Mar 2016 15:54:09 +0000 (15:54 +0000)]
[AMDGPU] Switch linker to amdphdrs + update test

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

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

8 years agoAdd additional Hi/Lo registers to Clang MipsTargetInfoBase
Hrvoje Varga [Tue, 29 Mar 2016 12:46:16 +0000 (12:46 +0000)]
Add additional Hi/Lo registers to Clang MipsTargetInfoBase
Differential Revision: http://reviews.llvm.org/D17378

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

8 years ago[OPENMP 4.5] Allow data members in 'aligned' clause.
Alexey Bataev [Tue, 29 Mar 2016 10:59:56 +0000 (10:59 +0000)]
[OPENMP 4.5] Allow data members in 'aligned' clause.

OpenMP 4.5 allows privatization of data members OpenMP clauses. Patch
adds support for data members in 'aligned' clause.

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

8 years agoVisual Studio native visualization for TemplateParameterList and TemplateTypeParmDecl
Mike Spertus [Tue, 29 Mar 2016 10:57:24 +0000 (10:57 +0000)]
Visual Studio native visualization for TemplateParameterList and TemplateTypeParmDecl

With this change, a TemplateParameterList will suggestively display in the locals window something like:
  <typename T, int i>

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

8 years agoVisual Studio native visualizer for InjectedClassNameType
Mike Spertus [Tue, 29 Mar 2016 09:24:45 +0000 (09:24 +0000)]
Visual Studio native visualizer for InjectedClassNameType

Also fixes some omissions for TemplateSpecializationType

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

8 years ago[OPENMP] Remove extra code transformation.
Alexey Bataev [Tue, 29 Mar 2016 08:58:54 +0000 (08:58 +0000)]
[OPENMP] Remove extra code transformation.

For better support of some specific GNU extensions some extra
transformation of AST nodes were introduced. These transformations are
very hard to handle. The code is improved in handling of these
extensions by using captured expressions construct.

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

8 years ago[OPENMP] Allow runtime insert its own code inside OpenMP regions.
Alexey Bataev [Tue, 29 Mar 2016 05:34:15 +0000 (05:34 +0000)]
[OPENMP] Allow runtime insert its own code inside OpenMP regions.

Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
 (required) code to support target specific codegen.

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

8 years ago[analyzer] Use BodyFarm-synthesized body even when actual body available.
Devin Coughlin [Mon, 28 Mar 2016 23:55:58 +0000 (23:55 +0000)]
[analyzer] Use BodyFarm-synthesized body even when actual body available.

Change body autosynthesis to use the BodyFarm-synthesized body even when
an actual body exists. This enables the analyzer to use the simpler,
analyzer-provided body to model the behavior of the function rather than trying
to understand the actual body. Further, this makes the analyzer robust against
changes in headers that expose the implementations of those bodies.

rdar://problem/25145950

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

8 years ago[PGO] More comments how function pointers for indirect calls are mapped
Adam Nemet [Mon, 28 Mar 2016 22:18:53 +0000 (22:18 +0000)]
[PGO] More comments how function pointers for indirect calls are mapped
to function names

Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: davidxl, cfe-commits

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

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

8 years agoImprovements to the ASTImporter to support LLDB top-level Clang expressions.
Sean Callanan [Mon, 28 Mar 2016 21:43:01 +0000 (21:43 +0000)]
Improvements to the ASTImporter to support LLDB top-level Clang expressions.

The testcase for this is in LLDB, adeed by r264662.

This patch adds support for a variety of new expression types to the AST
importer, mostly related to C++.  It also adds support for importing lambdas
correctly, and adds support for importing the attributes attached to any Decl.

Finally, the patch adds a new templated function to ASTNodeImporter that imports
arbitrary arrays of importable things into a bump-allocated array attached to
getToContext().  This is a pattern we see at many places in ASTNodeImporter;
rather than do it slightly differently at each point, this function does it one
way.

<rdar://problem/22864976>

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

8 years ago[modules] If both a module file and a module map for the same module are
Richard Smith [Mon, 28 Mar 2016 21:31:09 +0000 (21:31 +0000)]
[modules] If both a module file and a module map for the same module are
explicitly provided, and the module map lists a header that does not exist,
unmark the module as 'unavailable' when loading its .pcm file. (Use of the
module might still fail if the relevant headers aren't embedded, but this
behavior is now consistent with how we behave if the module map is not
provided, and with the desired behavior for embedding headers in modules.)

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

8 years ago[lanai] Add Lanai backend to clang driver.
Jacques Pienaar [Mon, 28 Mar 2016 21:02:54 +0000 (21:02 +0000)]
[lanai] Add Lanai backend to clang driver.

Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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

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

8 years agoUpdate the description of Clang's MSVC compatibility flags
Reid Kleckner [Mon, 28 Mar 2016 20:42:41 +0000 (20:42 +0000)]
Update the description of Clang's MSVC compatibility flags

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

8 years ago[analyzer] Nullability: Don't warn along paths where null returned from non-null.
Devin Coughlin [Mon, 28 Mar 2016 20:30:25 +0000 (20:30 +0000)]
[analyzer] Nullability: Don't warn along paths where null returned from non-null.

Change the nullability checker to not warn along paths where null is returned from
a method with a non-null return type, even when the diagnostic for this return
has been suppressed. This prevents warning from methods with non-null return types
that inline methods that themselves return nil but that suppressed the diagnostic.

Also change the PreconditionViolated state component to be called "InvariantViolated"
because it is set when a post-condition is violated, as well.

rdar://problem/25393539

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

8 years agoPaper over the Windows-only enum initialization test failure until the bug is fixed
Reid Kleckner [Mon, 28 Mar 2016 20:13:55 +0000 (20:13 +0000)]
Paper over the Windows-only enum initialization test failure until the bug is fixed

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

8 years agoThis file was accidentally committed with bad line endings. Fixed...
Mike Spertus [Mon, 28 Mar 2016 19:08:27 +0000 (19:08 +0000)]
This file was accidentally committed with bad line endings. Fixed...

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

8 years agoConvert to Unix line endings due to previous commit error.
Mike Spertus [Mon, 28 Mar 2016 18:24:22 +0000 (18:24 +0000)]
Convert to Unix line endings due to previous commit error.

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

8 years agoUse VS2015 Project Support for Natvis to eliminate the need to manually install clang...
Mike Spertus [Mon, 28 Mar 2016 18:03:37 +0000 (18:03 +0000)]
Use VS2015 Project Support for Natvis to eliminate the need to manually install clang native visualizer

This is the clang equivalent to llvm commit 264601. When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations.
Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013).

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

8 years agoWindows: Shrink sizeof(MacroInfo) from 256 to 248, MacroDirective 24 to 16
Nico Weber [Mon, 28 Mar 2016 17:28:06 +0000 (17:28 +0000)]
Windows: Shrink sizeof(MacroInfo) from 256 to 248, MacroDirective 24 to 16

In the Microsoft ABI, only bitfields with identical types get packed together,
so use consistently use one of the two instead of a mix.
Saves 457kB when parsing windows.h.

No intended behavior change.

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

8 years agoReduce size of DefinitionData from 120 to 96 bytes on Windows.
Nico Weber [Mon, 28 Mar 2016 14:55:24 +0000 (14:55 +0000)]
Reduce size of DefinitionData from 120 to 96 bytes on Windows.

In the Microsoft ABI, only bitfields with identical types get
packed together, so use unsigned consistently instead of a
bool / unsigned mix.

No intended behavior change.

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

8 years agoRevert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
Alexey Bataev [Mon, 28 Mar 2016 12:58:34 +0000 (12:58 +0000)]
Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."

Reverting because of failed tests.

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

8 years ago[OPENMP] Allow runtime insert its own code inside OpenMP regions.
Alexey Bataev [Mon, 28 Mar 2016 12:52:58 +0000 (12:52 +0000)]
[OPENMP] Allow runtime insert its own code inside OpenMP regions.

Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
 (required) code to support target specific codegen.

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

8 years ago[CLANG][avx512][BUILTIN] Adding fixupimm{pd|ps|sd|ss}
Michael Zuckerman [Mon, 28 Mar 2016 12:23:09 +0000 (12:23 +0000)]
[CLANG][avx512][BUILTIN] Adding fixupimm{pd|ps|sd|ss}
getexp{sd|ss} getmant{sd|ss} kunpck{di|si} loada{pd|ps} loaddqu{di|hi|qi|si} max{sd|ss} min{sd|ss} kmov16 builtins to clang

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

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

8 years agoRevert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
Alexey Bataev [Mon, 28 Mar 2016 10:12:03 +0000 (10:12 +0000)]
Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."

This reverts commit 3ee791165100607178073f14531a0dc90c622b36.

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

8 years ago[OPENMP] Allow runtime insert its own code inside OpenMP regions.
Alexey Bataev [Mon, 28 Mar 2016 09:53:43 +0000 (09:53 +0000)]
[OPENMP] Allow runtime insert its own code inside OpenMP regions.

Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
  (required) code to support target specific codegen.

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

8 years agoP0138R2: Allow direct-list-initialization of an enumeration from an integral
Richard Smith [Mon, 28 Mar 2016 06:08:37 +0000 (06:08 +0000)]
P0138R2: Allow direct-list-initialization of an enumeration from an integral
value that can convert to the enum's underlying type.

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

8 years agoFix serialization/deserialization for __uuidof
David Majnemer [Mon, 28 Mar 2016 03:19:50 +0000 (03:19 +0000)]
Fix serialization/deserialization for __uuidof

I broke this back in r264529 because I forgot to serialize the UuidAttr
member.  Fix this by replacing the UuidAttr with a StringRef which is
properly serialized and deserialized.

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

8 years ago[modules] When encoding SourceLocations in bitcode, rotate the 'is macro' flag
Richard Smith [Sun, 27 Mar 2016 20:13:24 +0000 (20:13 +0000)]
[modules] When encoding SourceLocations in bitcode, rotate the 'is macro' flag
bit from the top bit to the bottom bit, so that we don't need 6 VBR6 hunks for
each macro location. Reduces libstdc++ module size by about 1%.

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

8 years agoEncapsulate a couple of on-disk structures a little more.
Richard Smith [Sun, 27 Mar 2016 07:28:06 +0000 (07:28 +0000)]
Encapsulate a couple of on-disk structures a little more.

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

8 years agoRemove unused support for replacing declarations from chained AST files.
Richard Smith [Sun, 27 Mar 2016 05:52:25 +0000 (05:52 +0000)]
Remove unused support for replacing declarations from chained AST files.

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

8 years agoUse the correct alignment for uuid descriptors
David Majnemer [Sun, 27 Mar 2016 04:46:14 +0000 (04:46 +0000)]
Use the correct alignment for uuid descriptors

The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit
builds: we should do the same if the linker picks the "wrong" COMDAT.

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

8 years agoImprove the representation of CXXUuidofExpr
David Majnemer [Sun, 27 Mar 2016 04:46:07 +0000 (04:46 +0000)]
Improve the representation of CXXUuidofExpr

Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to.
This makes translating from __uuidof to the underlying constant a lot
more straightforward.

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

8 years ago[NFC] Tweak diagnostic for template template arguments, to include template aliases.
Faisal Vali [Sat, 26 Mar 2016 20:46:45 +0000 (20:46 +0000)]
[NFC] Tweak diagnostic for template template arguments, to include template aliases.

The prior diagnostic (err_template_arg_not_class_template) would state that the template argument to a template template parameter can only be a class template, when it can also be a template alias.  The newly renamed diagnostic (err_template_arg_not_valid_template) mentions template aliases.

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

8 years agoCheck if a path is already absolute before trying to make it so.
Bob Wilson [Sat, 26 Mar 2016 18:55:13 +0000 (18:55 +0000)]
Check if a path is already absolute before trying to make it so.

The FileSystem::makeAbsolute function has been calculating the current
working directory unconditionally, even when it is not needed. This calls
down to llvm::sys::fs::current_path, which is relatively expensive
because it stats two directories, regardless of whether those paths are
already in the stat cache. The net effect is that when using the
VFS, every stat during header search turns into three stats. With this
change, we get back to a single stat for absolute directory paths.

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

8 years ago[Cxx1z-constexpr-lambda-P0170R1] Support parsing of constexpr specifier (and its...
Faisal Vali [Sat, 26 Mar 2016 16:11:37 +0000 (16:11 +0000)]
[Cxx1z-constexpr-lambda-P0170R1]  Support parsing of constexpr specifier (and its inference) on lambda expressions

Support the constexpr specifier on lambda expressions - and support its inference from the lambda call operator's body.

i.e.
  auto L = [] () constexpr { return 5; };
  static_assert(L() == 5); // OK
  auto Implicit = [] (auto a) { return a; };
  static_assert(Implicit(5) == 5);

We do not support evaluation of lambda's within constant expressions just yet.

Implementation Strategy:
  - teach ParseLambdaExpressionAfterIntroducer to expect a constexpr specifier and mark the invented function call operator's declarator's decl-specifier with it; Have it emit fixits for multiple decl-specifiers (mutable or constexpr) in this location.
  - for cases where constexpr is not explicitly specified, have buildLambdaExpr check whether the invented function call operator satisfies the requirements of a constexpr function, by calling CheckConstexprFunctionDecl/Body.

Much obliged to Richard Smith for his patience and his care, in ensuring the code is clang-worthy.

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

8 years agoDon't warn on "use" of undefined inline function that isn't actually an ODR
Richard Smith [Fri, 25 Mar 2016 22:29:27 +0000 (22:29 +0000)]
Don't warn on "use" of undefined inline function that isn't actually an ODR
use. In order for this to fire, the function needed to be a templated function
marked 'constexpr' and declared but not defined. This weird pattern appears in
libstdc++'s alloc_traits.h.

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