]> granicus.if.org Git - clang/log
clang
8 years ago[CodeGen] Fix a segfault caused by pass_object_size.
George Burgess IV [Thu, 16 Jun 2016 23:06:04 +0000 (23:06 +0000)]
[CodeGen] Fix a segfault caused by pass_object_size.

This patch fixes a bug where we'd segfault (in some cases) if we saw a
variadic function with one or more pass_object_size arguments.

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

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

8 years agoFix a few issues while skipping function bodies
Olivier Goffart [Thu, 16 Jun 2016 21:40:06 +0000 (21:40 +0000)]
Fix a few issues while skipping function bodies

 - In functions with try { } catch { }, only the try block would be
   skipped, not the catch blocks

 - The template functions would still be parsed.

 - The initializers within a constructor would still be parsed.

 - The inline functions within class would still be stored, only to be
   discared later.

 - Invalid code with try would assert (as in "int foo() try assert_here")

This attempt to do even less while skipping function bodies.

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

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

8 years agoKeep invalid functions as part of the AST
Olivier Goffart [Thu, 16 Jun 2016 21:39:55 +0000 (21:39 +0000)]
Keep invalid functions as part of the AST

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

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

8 years agoFunctions declared in a scope should not hide previous declaration in earlier scopes
Olivier Goffart [Thu, 16 Jun 2016 21:39:46 +0000 (21:39 +0000)]
Functions declared in a scope should not hide previous declaration in earlier scopes

This code should be an error:

 void foo(int);
 void f3() {
   int foo(float);
   {
     float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
   }
 }

the foo(float) function declared at function scope should not hide the float(int)
while trying to redeclare functions.

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

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

8 years agoMinor fixes for miamcpu-opt.c test
Artem Belevich [Thu, 16 Jun 2016 20:16:49 +0000 (20:16 +0000)]
Minor fixes for miamcpu-opt.c test

Added -no-canonical-prefixes to make cc1 binary name more predictable.
Added appropriate REQUIRES keywords.

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

8 years ago[DebugInfo] Put the vftable index in the debug info
Reid Kleckner [Thu, 16 Jun 2016 20:08:51 +0000 (20:08 +0000)]
[DebugInfo] Put the vftable index in the debug info

This won't always be enough info to call a virtual method from the
debugger, but it's a start.

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

8 years ago[x86] generate IR for AVX2 integer min/max builtins
Sanjay Patel [Thu, 16 Jun 2016 18:45:01 +0000 (18:45 +0000)]
[x86] generate IR for AVX2 integer min/max builtins
Sibling patch to r272932:
http://reviews.llvm.org/rL272932

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

8 years agoRe-apply r272900 - [OpenMP] Cast captures by copy when passed to fork call so that...
Samuel Antao [Thu, 16 Jun 2016 18:39:34 +0000 (18:39 +0000)]
Re-apply r272900 - [OpenMP] Cast captures by copy when passed to fork call so that they are compatible to what the runtime library expects.

An issue in one of the regression tests was fixed for 32-bit hosts.

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

8 years agoRevert r272900 - [OpenMP] Cast captures by copy when passed to fork call so that...
Samuel Antao [Thu, 16 Jun 2016 16:06:22 +0000 (16:06 +0000)]
Revert r272900 - [OpenMP] Cast captures by copy when passed to fork call so that they are compatible to what the runtime library expects.

Was causing trouble in one of the regression tests for a 32-bit address space.

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

8 years ago[OpenMP] Cast captures by copy when passed to fork call so that they are compatible...
Samuel Antao [Thu, 16 Jun 2016 15:09:31 +0000 (15:09 +0000)]
[OpenMP] Cast captures by copy when passed to fork call so that they are compatible to what the runtime library expects.

Summary:
This patch fixes an issue detected when firstprivate variables are passed to an OpenMP outlined function vararg list. Currently they are not compatible with what the runtime library expects causing malfunction in some targets.

This patch fixes the issue by moving the casting logic already in place for offloading to the common code that creates the outline function and arguments and updates the regression tests accordingly.

Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev

Subscribers: cfe-commits, caomhin

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

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

8 years ago[Builtin] Make __builtin_thread_pointer target-independent.
Marcin Koscielnicki [Thu, 16 Jun 2016 13:41:54 +0000 (13:41 +0000)]
[Builtin] Make __builtin_thread_pointer target-independent.

This is now supported for ARM, AArch64, PowerPC, SystemZ, SPARC, Mips.

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

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

8 years agoA follow-up fixing on cuda-march.cu: Don't match clang to other place.
Haojian Wu [Thu, 16 Jun 2016 13:27:02 +0000 (13:27 +0000)]
A follow-up fixing on cuda-march.cu: Don't match clang to other place.

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

8 years agoPatch "Compilation for Intel MCU (Part 2/3)" caused the clang-x64-ninja-win7
Andrey Turetskiy [Thu, 16 Jun 2016 12:26:20 +0000 (12:26 +0000)]
Patch "Compilation for Intel MCU (Part 2/3)" caused the clang-x64-ninja-win7
buildbot to fail because of inaccurate CHECK in the test. This is a quick fix
for the test to make it platform independent.

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

8 years agoCompilation for Intel MCU (Part 3/3)
Andrey Turetskiy [Thu, 16 Jun 2016 10:49:27 +0000 (10:49 +0000)]
Compilation for Intel MCU (Part 3/3)

This is the last patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).

When IAMCU triple is used:
 * Use IAMCU linker output format
 * Link with IAMCU crt objects
 * Link with IAMCU libraries

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

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

8 years agoCompilation for Intel MCU (Part 2/3)
Andrey Turetskiy [Thu, 16 Jun 2016 10:36:09 +0000 (10:36 +0000)]
Compilation for Intel MCU (Part 2/3)

This is the second patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).
When IAMCU triple is used:
 * Recognize and use IAMCU GCC toolchain
 * Set up include paths
 * Forbid C++

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

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

8 years agoclang/test/Driver/cuda-march.cu: Tweak not to match "clang" to other place like ...
NAKAMURA Takumi [Thu, 16 Jun 2016 06:08:09 +0000 (06:08 +0000)]
clang/test/Driver/cuda-march.cu: Tweak not to match "clang" to other place like "path-to-clang-foo".

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

8 years ago[Lex] Try to fix a 'comparison is always false' warning. NFC.
George Burgess IV [Thu, 16 Jun 2016 02:30:33 +0000 (02:30 +0000)]
[Lex] Try to fix a 'comparison is always false' warning. NFC.

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

8 years ago[DebugInfo] Enable generation of unique identifiers for externally visible MS ABI...
Reid Kleckner [Thu, 16 Jun 2016 01:21:28 +0000 (01:21 +0000)]
[DebugInfo] Enable generation of unique identifiers for externally visible MS ABI types

We implemented the mangling for this a long time ago.

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

8 years agoAllow 'nodebug' on local variables.
Paul Robinson [Thu, 16 Jun 2016 00:42:36 +0000 (00:42 +0000)]
Allow 'nodebug' on local variables.
Parameters and non-static members of aggregates are still excluded,
and probably should remain that way.

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

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

8 years ago[CUDA] Don't pass top-level -march down to device cc1 or ptxas.
Justin Lebar [Wed, 15 Jun 2016 23:46:11 +0000 (23:46 +0000)]
[CUDA] Don't pass top-level -march down to device cc1 or ptxas.

Summary:
Previously if you did e.g.

  $ clang -march=haswell -x cuda foo.cu

we would pass "-march=haswell -march=sm_20" down to the ptxas tool.
This causes it to assert, and rightly so!

Reviewers: tra

Subscribers: cfe-commits, echristo

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

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

8 years agoFix sanitizer-ld test.
Evgeniy Stepanov [Wed, 15 Jun 2016 23:29:26 +0000 (23:29 +0000)]
Fix sanitizer-ld test.

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

8 years agoFix linking of DFSan + coverage.
Evgeniy Stepanov [Wed, 15 Jun 2016 23:05:21 +0000 (23:05 +0000)]
Fix linking of DFSan + coverage.

Broken in r272717 because of no test coverage.

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

8 years ago[x86] translate SSE packed FP comparison builtins to IR
Sanjay Patel [Wed, 15 Jun 2016 21:20:04 +0000 (21:20 +0000)]
[x86] translate SSE packed FP comparison builtins to IR

As noted in the code comment, a potential follow-on would be to remove
the builtins themselves. Other than ord/unord, this already works as
expected. Eg:

  typedef float v4sf __attribute__((__vector_size__(16)));
  v4sf fcmpgt(v4sf a, v4sf b) { return a > b; }

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

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

8 years agoAdd support to clang-cl driver for /GS switch
Etienne Bergeron [Wed, 15 Jun 2016 20:34:33 +0000 (20:34 +0000)]
Add support to clang-cl driver for /GS switch

Summary:
This patch is adding command-line support for the MSVC buffer security check.

The buffer security check is turned on with the '/GS' compiler switch.
https://msdn.microsoft.com/en-us/library/8dbf701c.aspx

The MSVC buffer security check in implemented here:
http://reviews.llvm.org/D20346

Reviewers: hans, rnk

Subscribers: chrisha, cfe-commits, rnk, hans, thakis

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

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

8 years agoAdd a few Musl related tests that already pass.
Rafael Espindola [Wed, 15 Jun 2016 20:02:22 +0000 (20:02 +0000)]
Add a few Musl related tests that already pass.

Patch by Lei Zhang.

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

8 years agocc1_main: Do not print statistics twice in -disable_free mode.
Matthias Braun [Wed, 15 Jun 2016 19:24:55 +0000 (19:24 +0000)]
cc1_main: Do not print statistics twice in -disable_free mode.

llvm statistics are currently printed when the destructor of a "static
ManagedStatic<StatisticInfo> StatInfo" in llvm runs.  This destructor
currently runs in each case as part of llvm_shutdown() which is run even
in disable_free mode as part of main(). I assume that this hasn't always
been the case.

Removing the special code here avoids the statistics getting printed
twice.

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

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

8 years ago[x86] generate IR for SSE integer min/max builtins
Sanjay Patel [Wed, 15 Jun 2016 17:18:50 +0000 (17:18 +0000)]
[x86] generate IR for SSE integer min/max builtins
Sibling patch to r272806:
http://reviews.llvm.org/rL272806

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

8 years ago[Sparc] setjmp and longjmp intrinsic support update to add unit tests and remove...
Chris Dewhurst [Wed, 15 Jun 2016 16:08:13 +0000 (16:08 +0000)]
[Sparc] setjmp and longjmp intrinsic support update to add unit tests and remove accidentally checked-in code.

Related to revision r272782

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

8 years agoReverting r272777 because one of the tests
Ranjeet Singh [Wed, 15 Jun 2016 14:21:28 +0000 (14:21 +0000)]
Reverting r272777 because one of the tests
added in the llvm patch is causing an assertion
to fail.

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

8 years agoApply some suggestions from clang-tidy's performance-unnecessary-value-param.
Benjamin Kramer [Wed, 15 Jun 2016 14:20:56 +0000 (14:20 +0000)]
Apply some suggestions from clang-tidy's performance-unnecessary-value-param.

No functionality change intended.

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

8 years agoDon't use static variables in LambdaCapture
John Brawn [Wed, 15 Jun 2016 14:14:51 +0000 (14:14 +0000)]
Don't use static variables in LambdaCapture

When static variables are used in inline functions in header files anything that
uses that function ends up with a reference to the variable. Because
RecursiveASTVisitor uses the inline functions in LambdaCapture that use static
variables any AST plugin that uses RecursiveASTVisitor, such as the
PrintFunctionNames example, ends up with a reference to these variables. This is
bad on Windows when building with MSVC with LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON
as variables used across a DLL boundary need to be explicitly dllimported in
the DLL using them.

This patch avoids that by adjusting LambdaCapture to be similar to before
r263921, with a capture of either 'this' or a VLA represented by a null Decl
pointer in DeclAndBits with an extra flag added to the bits to distinguish
between the two. This requires the use of an extra bit, and while Decl does
happen to be sufficiently aligned to allow this it's done in a way that means
PointerIntPair doesn't realise it and gives an assertion failure. Therefore I
also adjust Decl slightly to use LLVM_ALIGNAS to allow this.

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

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

8 years ago[AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.
Craig Topper [Wed, 15 Jun 2016 14:06:34 +0000 (14:06 +0000)]
[AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.

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

8 years ago[Sparc] Change to let clang know that setjmp and longjmp intrinsics are implemented...
Chris Dewhurst [Wed, 15 Jun 2016 12:44:47 +0000 (12:44 +0000)]
[Sparc] Change to let clang know that setjmp and longjmp intrinsics are implemented in the back-end.

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

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

8 years ago[ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.
Ranjeet Singh [Wed, 15 Jun 2016 11:32:18 +0000 (11:32 +0000)]
[ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.

Patch adds intrinsics for mrrc/mrrc2. The
intrinsics for mrrc/mrrc2 return a single
uint64_t to represent two 32 bit values.

The mcrr/mcrr2 intrinsic was changed to
accept a single uint64_t instead of two
32 bit values as the input for consistency.

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

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

8 years agoRevert accidential "[MSVC] Late parsing of in-class defined member functions in template"
Alexey Bataev [Wed, 15 Jun 2016 11:24:54 +0000 (11:24 +0000)]
Revert accidential "[MSVC] Late parsing of in-class defined member functions in template"

This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a.

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

8 years ago[OPENMP] Fix crash for 'schedule|dist_schedule' clauses during
Alexey Bataev [Wed, 15 Jun 2016 11:20:48 +0000 (11:20 +0000)]
[OPENMP] Fix crash for 'schedule|dist_schedule' clauses during
instantiation.

Added checks for non-dependent context when trygin to capture
non-constant schedule chunk expression for proper codegen of outlined
functions.

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

8 years ago[MSVC] Late parsing of in-class defined member functions in template
Alexey Bataev [Wed, 15 Jun 2016 11:19:39 +0000 (11:19 +0000)]
[MSVC] Late parsing of in-class defined member functions in template
classes.

MSVC actively uses unqualified lookup in dependent bases, lookup at the
instantiation point (non-dependent names may be resolved on things
declared later) etc. and all this stuff is the main cause of
incompatibility between clang and MSVC.

Clang tries to emulate MSVC behavior but it may fail in many cases.
clang could store lexed tokens for member functions definitions within
ClassTemplateDecl for later parsing during template instantiation.

It will allow resolving many possible issues with lookup in dependent
base classes and removing many already existing MSVC-specific
hacks/workarounds from the clang code.

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

8 years agoAdd a "declared 'nonnull' here" note to warnings where an expression is checked again...
Nick Lewycky [Wed, 15 Jun 2016 05:18:39 +0000 (05:18 +0000)]
Add a "declared 'nonnull' here" note to warnings where an expression is checked against null.

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

8 years agoHeaders: tweak for MSVC[<1800]
Saleem Abdulrasool [Wed, 15 Jun 2016 00:28:15 +0000 (00:28 +0000)]
Headers: tweak for MSVC[<1800]

Earlier versions of MSVC did not include inttypes.h.  Ensure that we dont try to
include_next on those releases.

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

8 years agoFix sanitizer coverage support in the win32 driver.
Evgeniy Stepanov [Tue, 14 Jun 2016 23:21:19 +0000 (23:21 +0000)]
Fix sanitizer coverage support in the win32 driver.

--dependent-lib arguments for the sanitizer libraries must be emitted when
coverage is enabled w/o any sanitizers.

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

8 years ago[OpenCL] Enable -fblocks by default for OpenCL 2.0 and above.
Yaxun Liu [Tue, 14 Jun 2016 21:43:01 +0000 (21:43 +0000)]
[OpenCL] Enable -fblocks by default for OpenCL 2.0 and above.

Reviewed as part of http://reviews.llvm.org/D20444

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

8 years ago[sanitizer] Allow sanitize coverage w/o sanitizers.
Evgeniy Stepanov [Tue, 14 Jun 2016 21:33:40 +0000 (21:33 +0000)]
[sanitizer] Allow sanitize coverage w/o sanitizers.

The reason is that this (a) seems to work just fine and (b) useful when building stuff with
sanitizer+coverage, but need to exclude the sanitizer for a particular source file.

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

8 years agoUpdate clang for D20348
Peter Collingbourne [Tue, 14 Jun 2016 21:02:05 +0000 (21:02 +0000)]
Update clang for D20348

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

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

8 years agos/Intrin.h/intrin.h/, trying to fix the build after r272701
Hans Wennborg [Tue, 14 Jun 2016 20:14:24 +0000 (20:14 +0000)]
s/Intrin.h/intrin.h/, trying to fix the build after r272701

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

8 years agoRename Intrin.h to intrin.h, that's how all the documentation calls it.
Nico Weber [Tue, 14 Jun 2016 19:54:40 +0000 (19:54 +0000)]
Rename Intrin.h to intrin.h, that's how all the documentation calls it.

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

8 years agoFix documentation bot after r272656
Adam Nemet [Tue, 14 Jun 2016 19:33:16 +0000 (19:33 +0000)]
Fix documentation bot after r272656

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

8 years ago[perf-training] Ignore 'Profile Note' warnings from the runtime
Vedant Kumar [Tue, 14 Jun 2016 19:06:48 +0000 (19:06 +0000)]
[perf-training] Ignore 'Profile Note' warnings from the runtime

After r272599, -DLLVM_BUILD_INSTRUMENTED passes a default argument to
-fprofile-instr-generate. This confuses the perf-helper script because
the runtime emits a note stating that the default is overridden by the
LLVM_PROFILE_FILE environment variable.

Change the perf-helper script s.t it does not treat these notes as
failures.

This isn't a strictly NFC change, but I don't see a simple way to add a
test for it.

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

8 years ago[clang-format] do not add existing includes.
Eric Liu [Tue, 14 Jun 2016 14:09:21 +0000 (14:09 +0000)]
[clang-format] do not add existing includes.

Summary: do not add existing includes.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

8 years agoclang-format: [JS] Fix failing format with TypeScript casts.
Daniel Jasper [Tue, 14 Jun 2016 13:54:38 +0000 (13:54 +0000)]
clang-format: [JS] Fix failing format with TypeScript casts.

Before, this could be formatted at all (with BracketAlignmentStyle
AlwaysBreak):

  foo = <Bar[]>[
    1, /* */
    2
  ];

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

8 years ago[Clang][avx512][Intrinsics] adding prefetch gather intrinsics
Michael Zuckerman [Tue, 14 Jun 2016 13:45:17 +0000 (13:45 +0000)]
[Clang][avx512][Intrinsics] adding prefetch gather intrinsics

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

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

8 years agoStart adding support for Musl.
Rafael Espindola [Tue, 14 Jun 2016 12:47:24 +0000 (12:47 +0000)]
Start adding support for Musl.

The two patches together enable clang to support targets like
"x86_64-pc-linux-musl" and build binaries against musl-libc instead of
glibc. This make it easy for clang to work on some musl-based systems
like Alpine Linux and certain flavors of Gentoo.

Patch by Lei Zhang.

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

8 years ago[Clang][AVX512][intrinsics] Adding missing intrinsics div_pd and div_ps
Michael Zuckerman [Tue, 14 Jun 2016 12:38:58 +0000 (12:38 +0000)]
[Clang][AVX512][intrinsics] Adding missing intrinsics div_pd and div_ps

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

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

8 years agoAdd loop pragma for Loop Distribution
Adam Nemet [Tue, 14 Jun 2016 12:04:26 +0000 (12:04 +0000)]
Add loop pragma for Loop Distribution

Summary:
This is similar to other loop pragmas like 'vectorize'.  Currently it
only has state values: distribute(enable) and distribute(disable).  When
one of these is specified the corresponding loop metadata is generated:

  !{!"llvm.loop.distribute.enable", i1 true/false}

As a result, loop distribution will be attempted on the loop even if
Loop Distribution in not enabled globally.  Analogously, with 'disable'
distribution can be turned off for an individual loop even when the pass
is otherwise enabled.

There are some slight differences compared to the existing loop pragmas.

1. There is no 'assume_safety' variant which makes its handling slightly
different from 'vectorize'/'interleave'.

2. Unlike the existing loop pragmas, it does not have a corresponding
numeric pragma like 'vectorize' -> 'vectorize_width'.  So for the
consistency checks in CheckForIncompatibleAttributes we don't need to
check it against other pragmas.  We just need to check for duplicates of
the same pragma.

Reviewers: rsmith, dexonsmith, aaron.ballman

Subscribers: bob.wilson, cfe-commits, hfinkel

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

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

8 years agoclang-format: [JS] Support annotated classes.
Daniel Jasper [Tue, 14 Jun 2016 11:28:02 +0000 (11:28 +0000)]
clang-format: [JS] Support annotated classes.

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

8 years agoReverting "Warn when taking address of a packed member"
Roger Ferrer Ibanez [Tue, 14 Jun 2016 11:20:07 +0000 (11:20 +0000)]
Reverting "Warn when taking address of a packed member"

This new diagnostic is causing some false positives that have to be addressed.

This reverts commit 272552

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

8 years ago[mips] Defer validity check for CPU/ABI pairs and improve error message for invalid...
Daniel Sanders [Tue, 14 Jun 2016 08:58:50 +0000 (08:58 +0000)]
[mips] Defer validity check for CPU/ABI pairs and improve error message for invalid cases.

Summary:
The validity of ABI/CPU pairs is no longer checked on the fly but is
instead checked after initialization. As a result, invalid CPU/ABI pairs
can be reported as being known but invalid instead of being unknown. For
example, we now emit:
  error: ABI 'n32' is not supported on CPU 'mips32r2'
instead of:
  error: unknown target ABI 'n64'

Reviewers: atanasyan

Subscribers: sdardis, cfe-commits

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

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

8 years agoFix PR28100 - Allow redeclarations of deleted explicit specializations.
Faisal Vali [Tue, 14 Jun 2016 03:23:15 +0000 (03:23 +0000)]
Fix PR28100 - Allow redeclarations of deleted explicit specializations.

See https://llvm.org/bugs/show_bug.cgi?id=28100.

In r266561 when I implemented allowing explicit specializations of function templates to override deleted status, I mistakenly assumed (and hence introduced a violable assertion) that when an explicit specialization was being declared, the corresponding specialization of the most specialized function template that it would get linked to would always be the one that was implicitly generated - and so if it was marked as 'deleted' it must have inherited it from the primary template and so should be safe to reset its deleted status, and set it to being an explicit specialization.  Obviously during redeclaration of a deleted explicit specialization, in order to avoid a recursive reset, we need to check that the previous specialization is not an explicit specialization (instead of assuming and asserting it) and that it hasn't been referenced, and so only then is it safe to reset its 'deleted' status.

All regression tests pass.

Thanks to Zhendong Su for reporting the bug and David Majnemer for tracking it to my commit r266561, and promptly bringing it to my attention.

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

8 years ago[Parser] Handle __pragma(pack, etc. after type definitions
David Majnemer [Tue, 14 Jun 2016 03:20:28 +0000 (03:20 +0000)]
[Parser] Handle __pragma(pack, etc. after type definitions

Support certain MS pragmas right after the closing curly brace of a
class.  Clang did not expect __pragma in this position.

This fixes PR28094.

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

8 years agoDetect recursive default argument definition
Serge Pavlov [Tue, 14 Jun 2016 02:55:56 +0000 (02:55 +0000)]
Detect recursive default argument definition

If definition of default function argument uses itself, clang crashed,
because corresponding function parameter is not associated with the default
argument yet. With this fix clang emits appropriate error message.

This change fixes PR28105.

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

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

8 years agoRemove stray semi-colon in *.py file, NFC
Vedant Kumar [Tue, 14 Jun 2016 01:14:50 +0000 (01:14 +0000)]
Remove stray semi-colon in *.py file, NFC

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

8 years agoRemove nonsense and simplify. To forward a reference, we always just load the
Richard Smith [Tue, 14 Jun 2016 01:13:21 +0000 (01:13 +0000)]
Remove nonsense and simplify. To forward a reference, we always just load the
pointer-to-pointer representing the parameter. An aggregate rvalue representing
a pointer does not make sense.

We got away with this weirdness because CGCall happens to blindly load an
RValue in aggregate form in this case, without checking whether an RValue for
the type should be in scalar or aggregate form.

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

8 years agoAdd a test to ensure that pass_object_size is handled properly by a delegate constructor.
Richard Smith [Tue, 14 Jun 2016 00:48:35 +0000 (00:48 +0000)]
Add a test to ensure that pass_object_size is handled properly by a delegate constructor.

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

8 years ago[docs] Coverage: Document the profile merge pool specifier
Vedant Kumar [Tue, 14 Jun 2016 00:42:12 +0000 (00:42 +0000)]
[docs] Coverage: Document the profile merge pool specifier

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

8 years agoPatch for r272584 (http://reviews.llvm.org/rL272584) to address clang-x64-ninja-win7...
Taewook Oh [Mon, 13 Jun 2016 21:55:33 +0000 (21:55 +0000)]
Patch for r272584 (http://reviews.llvm.org/rL272584) to address clang-x64-ninja-win7 buildbot failure.

Patch by Eric Niebler

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

8 years ago[Parser] Only correct delayed typos when needed
Erik Pilkington [Mon, 13 Jun 2016 20:56:45 +0000 (20:56 +0000)]
[Parser] Only correct delayed typos when needed

ActOnBinOp corrects delayed typos when in C mode; don't correct them in that
case. Fixes PR26700.

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

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

8 years agoUse the name of the file on disk to issue a new diagnostic about non-portable #includ...
Taewook Oh [Mon, 13 Jun 2016 20:40:21 +0000 (20:40 +0000)]
Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths.

Differential Revision: http://reviews.llvm.org/D19843
Corresponding LLVM change: http://reviews.llvm.org/D19842

Re-commit of r272562 after addressing clang-x86-win2008-selfhost failure.

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

8 years agoclang-cl: Support -resource-dir option (PR28074)
Hans Wennborg [Mon, 13 Jun 2016 20:31:30 +0000 (20:31 +0000)]
clang-cl: Support -resource-dir option (PR28074)

It's useful e.g. for distributed build systems.

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

8 years agoAdd test for DR1359.
Richard Smith [Mon, 13 Jun 2016 19:04:44 +0000 (19:04 +0000)]
Add test for DR1359.

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

8 years agoTest fix -- use captured call result instead of hardcoded %2.
Artem Belevich [Mon, 13 Jun 2016 18:44:22 +0000 (18:44 +0000)]
Test fix -- use captured call result instead of hardcoded %2.

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

8 years agoRevert r272562 for build bot failure (clang-x86-win2008-selfhost)
Taewook Oh [Mon, 13 Jun 2016 18:32:30 +0000 (18:32 +0000)]
Revert r272562 for build bot failure (clang-x86-win2008-selfhost)

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

8 years ago[CUDA][OpenMP] Create generic offload toolchains
Samuel Antao [Mon, 13 Jun 2016 18:10:57 +0000 (18:10 +0000)]
[CUDA][OpenMP] Create generic offload toolchains

Summary:
This patch introduces the concept of offloading tool chain and offloading kind. Each tool chain may have associated an offloading kind that marks it as used in a given programming model that requires offloading.

It also adds the logic to iterate on the tool chains based on the kind. Currently, only CUDA is supported, but in general a programming model (an offloading kind) may have associated multiple tool chains that require supporting offloading.

This patch does not add tests - its goal is to keep the existing functionality.

This patch is the first of a series of three that attempts to make the current support of CUDA more generic and easier to extend to other programming models, namely OpenMP. It tries to capture the suggestions/improvements/concerns on the initial proposal in  http://lists.llvm.org/pipermail/cfe-dev/2016-February/047547.html. It only tackles the more consensual part of the proposal, i.e.does not address the problem of intermediate files bundling yet.

Reviewers: ABataev, jlebar, echristo, hfinkel, tra

Subscribers: guansong, Hahnfeld, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years agoclang-format: [JS] Initialize new configuration value.
Martin Probst [Mon, 13 Jun 2016 17:50:10 +0000 (17:50 +0000)]
clang-format: [JS] Initialize new configuration value.

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

8 years agoCapture the resource directory and use it for subsequent checks.
Paul Robinson [Mon, 13 Jun 2016 17:41:05 +0000 (17:41 +0000)]
Capture the resource directory and use it for subsequent checks.
This is the same tactic used in linux-header-search.cpp.

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

8 years ago[immintrin] Reimplement _bit_scan_{forward,reverse}
David Majnemer [Mon, 13 Jun 2016 17:26:16 +0000 (17:26 +0000)]
[immintrin] Reimplement _bit_scan_{forward,reverse}

There is no need to use a target-specific intrinsic to implement
_bit_scan_forward or _bit_scan_reverse, reimplementing them using
generic intrinsics makes it more likely that the middle end will
understand what's going on.

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

8 years agoUse the name of the file on disk to issue a new diagnostic about non-portable #includ...
Taewook Oh [Mon, 13 Jun 2016 17:03:18 +0000 (17:03 +0000)]
Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths.

Differential Revision: http://reviews.llvm.org/D19843
Corresponding LLVM change: http://reviews.llvm.org/D19842

Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures.

Patch by Eric Niebler

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

8 years agoclang-format: [JS] Indent namespaces in JavaScript/TS by default.
Martin Probst [Mon, 13 Jun 2016 16:41:28 +0000 (16:41 +0000)]
clang-format: [JS] Indent namespaces in JavaScript/TS by default.

Summary: There's no convention of avoiding the nested indentation.

Reviewers: djasper

Subscribers: klimek, alexeagle, cfe-commits

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

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

8 years agoclang-format: [JS] Introduce JavaScriptWrapImports option.
Martin Probst [Mon, 13 Jun 2016 16:39:50 +0000 (16:39 +0000)]
clang-format: [JS] Introduce JavaScriptWrapImports option.

Summary:
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing the entire import statement onto one line.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

8 years agoWarn when taking address of a packed member
Roger Ferrer Ibanez [Mon, 13 Jun 2016 15:41:40 +0000 (15:41 +0000)]
Warn when taking address of a packed member

This patch implements PR#22821.

Taking the address of a packed member is dangerous since the reduced
alignment of the pointee is lost. This can lead to memory alignment
faults in some architectures if the pointer value is dereferenced.

This change adds a new warning to clang emitted when taking the address
of a packed member. A packed member is either a field/data member
declared as attribute((packed)) or belonging to a struct/class
declared as such. The associated flag is -Waddress-of-packed-member

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

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

8 years ago[X86][AVX512F] bugfix - sqrtps should get __mask16 as mask parameter
Asaf Badouh [Mon, 13 Jun 2016 15:15:57 +0000 (15:15 +0000)]
[X86][AVX512F] bugfix - sqrtps should get __mask16 as mask parameter

CR: Michael Zuckerman

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

8 years agoclang-format: Restrict r272537 to function ref qualifiers.
Daniel Jasper [Mon, 13 Jun 2016 14:45:12 +0000 (14:45 +0000)]
clang-format: Restrict r272537 to function ref qualifiers.

Seems this isn't generally desirable.

Before:
  int const * a;

After:
  int const* a;

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

8 years agoFix unused variable warning
Simon Pilgrim [Mon, 13 Jun 2016 10:05:19 +0000 (10:05 +0000)]
Fix unused variable warning

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

8 years ago[Clang][X86] Convert non-temporal store builtins to generic __builtin_nontemporal_sto...
Simon Pilgrim [Mon, 13 Jun 2016 09:57:52 +0000 (09:57 +0000)]
[Clang][X86] Convert non-temporal store builtins to generic __builtin_nontemporal_store in headers

We can now use __builtin_nontemporal_store instead of target specific builtins for naturally aligned nontemporal stores which avoids the need for handling in CGBuiltin.cpp

The scalar integer nontemporal (unaligned) store builtins will have to wait as __builtin_nontemporal_store currently assumes natural alignment and doesn't accept the 'packed struct' trick that we use for normal unaligned load/stores.

The nontemporal loads require further backend support before we can safely convert them to __builtin_nontemporal_load

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

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

8 years agoclang-format: Fix incorrect function type detection.
Daniel Jasper [Mon, 13 Jun 2016 07:49:35 +0000 (07:49 +0000)]
clang-format: Fix incorrect function type detection.

Before:
  returnsFunction (&param1, &param2)(param);

After:
  returnsFunction(&param1, &param2)(param);

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

8 years agoclang-format: Don't merge const and &, e.g. in function ref qualifiers.
Daniel Jasper [Mon, 13 Jun 2016 07:49:28 +0000 (07:49 +0000)]
clang-format: Don't merge const and &, e.g. in function ref qualifiers.

Before (when aligning & to the right):
  SomeType MemberFunction(const Deleted &) const&;

After:
  SomeType MemberFunction(const Deleted &) const &;

This also applies to variable declarations, e.g.:
  int const * a;

However, this form is very uncommon (most people would write
"const int* a" instead) and contracting to "const*" might actually send
the wrong signal of what the const binds to.

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

8 years agoclang-format: Fix incorrect cast detection.
Daniel Jasper [Mon, 13 Jun 2016 07:49:09 +0000 (07:49 +0000)]
clang-format: Fix incorrect cast detection.

Before:
  auto s = sizeof...(Ts)-1;

After:
  auto s = sizeof...(Ts) - 1;

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

8 years agoclang-format: Don't indent lambda body relative to its return type.
Daniel Jasper [Mon, 13 Jun 2016 07:48:45 +0000 (07:48 +0000)]
clang-format: Don't indent lambda body relative to its return type.

Before:
  []()  //
      -> int {
        return 1;  //
      };

After:
  []()  //
      -> int {
    return 1;  //
  };

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

8 years agoMPIBugReporter.h: Fix a warning. [-Wdocumentation]
NAKAMURA Takumi [Mon, 13 Jun 2016 05:46:35 +0000 (05:46 +0000)]
MPIBugReporter.h: Fix a warning. [-Wdocumentation]

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

8 years ago[AVX512] Masked pcmpeqd, pcmpeqq, pcmpgtd, and pcmpgtq don't require avx512bw, just...
Craig Topper [Mon, 13 Jun 2016 04:15:11 +0000 (04:15 +0000)]
[AVX512] Masked pcmpeqd, pcmpeqq, pcmpgtd, and pcmpgtq don't require avx512bw, just avx512vl.

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

8 years agoImproved Visual Studio visualization of OpaquePtr
Mike Spertus [Mon, 13 Jun 2016 04:02:35 +0000 (04:02 +0000)]
Improved Visual Studio visualization of OpaquePtr

Create a special visualizer for OpaquePtr<QualType> because the
standard visualizer doesn't work with OpaquePtr<QualType>
due to QualType being heavily dependent on traits to be pointer-like.

Also, created an identical visualizer for UnionOpaquePtr

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

8 years ago[analyzer] Remove some list initialization from MPI Checker to make MSVC bots happy.
Devin Coughlin [Mon, 13 Jun 2016 03:58:58 +0000 (03:58 +0000)]
[analyzer] Remove some list initialization from MPI Checker to make MSVC bots happy.

This is a speculative attempt to fix the compiler error: "list initialization inside
member initializer list or non-static data member initializer is not implemented" with
r272529.

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

8 years ago[analyzer] Add checker to verify the correct usage of the MPI API
Devin Coughlin [Mon, 13 Jun 2016 03:22:41 +0000 (03:22 +0000)]
[analyzer] Add checker to verify the correct usage of the MPI API

This commit adds a static analysis checker to verify the correct usage of the MPI API in C
and C++. This version updates the reverted r271981 to fix a memory corruption found by the
ASan bots.

Three path-sensitive checks are included:
- Double nonblocking: Double request usage by nonblocking calls without intermediate wait
- Missing wait: Nonblocking call without matching wait.
- Unmatched wait: Waiting for a request that was never used by a nonblocking call

Examples of how to use the checker can be found at https://github.com/0ax1/MPI-Checker

A patch by Alexander Droste!

Reviewers: zaks.anna, dcoughlin

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

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

8 years agoclang-format: [JS] post-fix non-null assertion operator.
Martin Probst [Mon, 13 Jun 2016 00:49:54 +0000 (00:49 +0000)]
clang-format: [JS] post-fix non-null assertion operator.

Summary:
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoVisual Studio Visualizer for PackExpansionType
Mike Spertus [Sun, 12 Jun 2016 22:54:46 +0000 (22:54 +0000)]
Visual Studio Visualizer for PackExpansionType

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

8 years agoVisual Studio native visualizer for ParsedTemplateArgument
Mike Spertus [Sun, 12 Jun 2016 22:21:56 +0000 (22:21 +0000)]
Visual Studio native visualizer for ParsedTemplateArgument

Does a good job with type and non-type template arguments
and lays the groundwork for template template arguments to
visualize well once there is a TemplateName visualizer.
Also fixed what looks like an incorrect comment in the
header for ParsedTemplate.h.

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

8 years agoAdd some std::move where the value is only read otherwise.
Benjamin Kramer [Sun, 12 Jun 2016 20:05:23 +0000 (20:05 +0000)]
Add some std::move where the value is only read otherwise.

This mostly affects smart pointers. No functionality change intended.

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

8 years agoRudimentary support for Visual Studio Stmt visualizer
Mike Spertus [Sun, 12 Jun 2016 18:42:04 +0000 (18:42 +0000)]
Rudimentary support for Visual Studio Stmt visualizer

Better than nothing...

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

8 years ago[CodeGen] Update to use an ArrayRef of uint32_t instead of int in calls to CreateShuf...
Craig Topper [Sun, 12 Jun 2016 00:41:24 +0000 (00:41 +0000)]
[CodeGen] Update to use an ArrayRef of uint32_t instead of int in calls to CreateShuffleVector to match llvm interface change.

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

8 years ago[X86][BMI] Improved bmi intrinsics checks
Simon Pilgrim [Sat, 11 Jun 2016 22:40:01 +0000 (22:40 +0000)]
[X86][BMI] Improved bmi intrinsics checks

Ready for matching with llvm/test/CodeGen/X86/bmi-intrinsics-fast-isel.ll (to be added shortly)

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

8 years agoVisual Studio Visualizers for ActionResult, LocInfoType, and and TypeSourceInfo
Mike Spertus [Sat, 11 Jun 2016 20:15:19 +0000 (20:15 +0000)]
Visual Studio Visualizers for ActionResult, LocInfoType, and and TypeSourceInfo

Created a visualizer for ActionResult that displayed the validity and the pointer,
but many of them initially displayed poorly. It turns out that the primary culprit
is that LocInfoType is often passed in an action result, but it is not the same
as other types. For example, LocInfoType is not in TypeNodes.def and clang::Type::TypeClass
does not have a LocInfoType enum. After adding a special visualizer for LocInfoType,
the display was more useful

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

8 years agoFix cv-qualification of '*this' captures and nasty bug PR27507
Faisal Vali [Sat, 11 Jun 2016 16:41:54 +0000 (16:41 +0000)]
Fix cv-qualification of '*this' captures and nasty bug PR27507

The bug report by Gonzalo (https://llvm.org/bugs/show_bug.cgi?id=27507 -- which results in clang crashing when generic lambdas that capture 'this' are instantiated in contexts where the Functionscopeinfo stack is not in a reliable state - yet getCurrentThisType expects it to be) - unearthed some additional bugs in regards to maintaining proper cv qualification through 'this' when performing by value captures of '*this'.

This patch attempts to correct those bugs and makes the following changes:

   o) when capturing 'this', we do not need to remember the type of 'this' within the LambdaScopeInfo's Capture - it is never really used for a this capture - so remove it.
   o) teach getCurrentThisType to walk the stack of lambdas (even in scenarios where we run out of LambdaScopeInfo's such as when instantiating call operators) looking for by copy captures of '*this' and resetting the type of 'this' based on the constness of that capturing lambda's call operator.

This patch has been baking in review-hell for > 6 weeks - all the comments so far have been addressed and the bug (that it addresses in passing, and I regret not submitting as a separate patch initially) has been reported twice independently, so is frequent and important for us not to just sit on. I merged the cv qualification-fix and the PR-fix initially in one patch, since they resulted from my initial implementation of star-this and so were related. If someone really feels strongly, I can put in the time to revert this - separate the two out - and recommit.  I won't claim it's immunized against all bugs, but I feel confident enough about the fix to land it for now.

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