]> granicus.if.org Git - clang/log
clang
8 years agoMerging r271801: release_38 origin/release_38
Joerg Sonnenberger [Thu, 11 Aug 2016 18:47:43 +0000 (18:47 +0000)]
Merging r271801:
------------------------------------------------------------------------
r271801 | joerg | 2016-06-04 22:03:26 +0200 (Sa, 04 Jun 2016) | 3 lines

Add PIE magic for NetBSD. Add tests for the correct flags for
non-shared, PIE and shared output mode.

------------------------------------------------------------------------

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

8 years agoMerging r262838:
Joerg Sonnenberger [Tue, 24 May 2016 19:36:54 +0000 (19:36 +0000)]
Merging r262838:
------------------------------------------------------------------------
r262838 | joerg | 2016-03-07 18:19:15 +0100 (Mon, 07 Mar 2016) | 2 lines

Implement __builtin_eh_return_data_regno for SPARC and SPARC64.

------------------------------------------------------------------------

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

8 years agoMerging r261717:
Tom Stellard [Wed, 18 May 2016 21:15:48 +0000 (21:15 +0000)]
Merging r261717:

------------------------------------------------------------------------
r261717 | jyknight | 2016-02-23 18:59:33 -0800 (Tue, 23 Feb 2016) | 27 lines

Default vaarg lowering should support indirect struct types.

Fixes PR11517 for SPARC.

On most targets, clang lowers va_arg itself, eschewing the use of the
llvm vaarg instruction. This is necessary (at least for now) as the type
argument to the vaarg instruction cannot represent all the ABI
information that is needed to support complex calling conventions.

However, on targets with a simpler varrags ABIs, the LLVM instruction
can work just fine, and clang can simply lower to it. Unfortunately,
even on such targets, vaarg with a struct argument would fail, because
the default lowering to vaarg was naive: it didn't take into account the
ABI attribute computed by classifyArgumentType. In particular, for the
DefaultABIInfo, structs are supposed to be passed indirectly and so
llvm's vaarg instruction should be emitted with a pointer argument.

Now, vaarg instruction emission is able to use computed ABIArgInfo for
the provided argument type, which allows the default ABI support to work
for structs too.

I haven't touched the EmitVAArg implementation for PPC32_SVR4 or XCore,
although I believe both are now redundant, and could be switched over to
use the default implementation as well.

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

------------------------------------------------------------------------

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

9 years agoAdd clang-tidy release notes.
Alexander Kornienko [Thu, 17 Mar 2016 14:58:32 +0000 (14:58 +0000)]
Add clang-tidy release notes.

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

9 years agoReleaseNotes: Alignment; by John McCall
Hans Wennborg [Mon, 7 Mar 2016 17:17:19 +0000 (17:17 +0000)]
ReleaseNotes: Alignment; by John McCall

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

9 years agoReleaseNotes: tidy up
Hans Wennborg [Wed, 2 Mar 2016 23:49:46 +0000 (23:49 +0000)]
ReleaseNotes: tidy up

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

9 years agoReleaseNotes: -fstrict-vtable-pointers, by Piotr Padlewski
Hans Wennborg [Wed, 2 Mar 2016 21:46:21 +0000 (21:46 +0000)]
ReleaseNotes: -fstrict-vtable-pointers, by Piotr Padlewski

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

9 years agoReleaseNotes: fix build failure
Hans Wennborg [Tue, 1 Mar 2016 19:10:09 +0000 (19:10 +0000)]
ReleaseNotes: fix build failure

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

9 years agoMerging r261669:
Hans Wennborg [Tue, 23 Feb 2016 21:20:39 +0000 (21:20 +0000)]
Merging r261669:
------------------------------------------------------------------------
r261669 | aaronballman | 2016-02-23 10:55:15 -0800 (Tue, 23 Feb 2016) | 1 line

Amends r252104 to evaluate the controlling expression in an unevaluated context. This eliminates false-positive diagnostics about null pointer dereferences (etc) in the controlling expression.
------------------------------------------------------------------------

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

9 years agoMerging r261422:
Hans Wennborg [Mon, 22 Feb 2016 18:48:10 +0000 (18:48 +0000)]
Merging r261422:
------------------------------------------------------------------------
r261422 | rdivacky | 2016-02-20 00:31:24 -0800 (Sat, 20 Feb 2016) | 10 lines

Fix handling of vaargs on PPC32 when going from regsave to overflow.

It can happen that when we only have 1 more register left in the regsave
area we need to store a value bigger than 1 register and therefore we
go to the overflow area. In this case we have to leave the last slot
in the regsave area unused and keep using overflow area. Do this
by storing a limit value to the used register counter in the overflow block.

Issue diagnosed by and solution tested by Mark Millard!

------------------------------------------------------------------------

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

9 years ago[OpenMP] Update 3.8 release notes support for OpenMP
Michael Wong [Mon, 22 Feb 2016 14:58:44 +0000 (14:58 +0000)]
[OpenMP] Update 3.8 release notes support for OpenMP
http://reviews.llvm.org/D17323

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

9 years agoMerge r261310: Add test for ARM: fix VFP asm constraints
Renato Golin [Fri, 19 Feb 2016 19:36:35 +0000 (19:36 +0000)]
Merge r261310: Add test for ARM: fix VFP asm constraints

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

9 years agoMerge r261309: ARM: fix VFP asm constraints
Renato Golin [Fri, 19 Feb 2016 17:40:14 +0000 (17:40 +0000)]
Merge r261309: ARM: fix VFP asm constraints

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

9 years agoMerging r261209:
Hans Wennborg [Thu, 18 Feb 2016 20:51:23 +0000 (20:51 +0000)]
Merging r261209:
------------------------------------------------------------------------
r261209 | abataev | 2016-02-18 05:48:15 -0800 (Thu, 18 Feb 2016) | 4 lines

[OPENMP] Fix codegen for lastprivate loop counters.

Patch fixes bug with codegen for lastprivate loop counters. Also it may
improve performance for lastprivates calculations in some cases.
------------------------------------------------------------------------

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

9 years agoMerging r261080:
Hans Wennborg [Thu, 18 Feb 2016 20:49:41 +0000 (20:49 +0000)]
Merging r261080:
------------------------------------------------------------------------
r261080 | abataev | 2016-02-17 02:29:05 -0800 (Wed, 17 Feb 2016) | 3 lines

[OPENMP] Fix handling loop-based directives with arrays.
Patch fixes possible problems with correct handling arrays as
expressions in initialization, conditions etc in loop-based constructs.
------------------------------------------------------------------------

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

9 years agoMerging r257763:
Hans Wennborg [Thu, 18 Feb 2016 16:49:14 +0000 (16:49 +0000)]
Merging r257763:
------------------------------------------------------------------------
r257763 | djasper | 2016-01-14 05:36:46 -0800 (Thu, 14 Jan 2016) | 8 lines

clang-format: Fix incorrectly enforced linebreak with ColumnLimit 0.

Before:
  aaaa[bbbb]
      .cccc();

After:
  aaaa[bbbb].cccc();
------------------------------------------------------------------------

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

9 years agoMerging r259874:
Hans Wennborg [Wed, 17 Feb 2016 21:28:41 +0000 (21:28 +0000)]
Merging r259874:
------------------------------------------------------------------------
r259874 | compnerd | 2016-02-04 20:12:40 -0800 (Thu, 04 Feb 2016) | 8 lines

CodeGen: correct Windows ARM C++ assertion

Because the Decl is explicitly passed as nullptr further up the call chain, it
is possible to invoke isa on a nullptr, which will assert.  Guard against the
nullptr.

Take the opportunity to reuse the helper method rather than re-implementing this
logic.
------------------------------------------------------------------------

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

9 years agoMerging r260851:
Dimitry Andric [Tue, 16 Feb 2016 19:56:48 +0000 (19:56 +0000)]
Merging r260851:
------------------------------------------------------------------------
r260851 | dim | 2016-02-14 17:08:20 +0100 (Sun, 14 Feb 2016) | 13 lines

As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
C++ programs compiled for profiling (using `-pg`) should be linked with
`-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not
with the regular C++ libraries.

Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add
a test case for it.  While here, extend the test case for the proper
passing of -lm and -lm_p.

Reviewers: compnerd, davide, dws, emaste
Reviewed By: compnerd
Differential Revision: http://reviews.llvm.org/D16264

------------------------------------------------------------------------

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

9 years agoMerging r260370:
Hans Wennborg [Tue, 16 Feb 2016 19:47:16 +0000 (19:47 +0000)]
Merging r260370:
------------------------------------------------------------------------
r260370 | abataev | 2016-02-10 02:50:12 -0800 (Wed, 10 Feb 2016) | 1 line

Fix PR26543: add a check for definition in CXXRecordDecl.
------------------------------------------------------------------------

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

9 years agoReleaseNotes: CUDA support; by Artem Belevich
Hans Wennborg [Tue, 16 Feb 2016 19:25:09 +0000 (19:25 +0000)]
ReleaseNotes: CUDA support; by Artem Belevich

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

9 years agoReleaseNotes: -Wmicrosoft was split up; by Nico Weber
Hans Wennborg [Tue, 16 Feb 2016 19:12:16 +0000 (19:12 +0000)]
ReleaseNotes: -Wmicrosoft was split up; by Nico Weber

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

9 years agoReleaseNotes: OpenCL section
Hans Wennborg [Tue, 16 Feb 2016 18:43:16 +0000 (18:43 +0000)]
ReleaseNotes: OpenCL section

By Anastasia Stulova!

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

9 years agoReleaseNotes: fix typo reported by Eugene
Hans Wennborg [Tue, 16 Feb 2016 17:37:41 +0000 (17:37 +0000)]
ReleaseNotes: fix typo reported by Eugene

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

9 years agoMerging r260616:
Hans Wennborg [Fri, 12 Feb 2016 22:51:41 +0000 (22:51 +0000)]
Merging r260616:
------------------------------------------------------------------------
r260616 | joerg | 2016-02-11 15:18:36 -0800 (Thu, 11 Feb 2016) | 4 lines

Now that Sparc/Sparc64 backend is mostly usable, provide the same
linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and
libc++ as STL.

------------------------------------------------------------------------

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

9 years agoReleaseNotes: autoconf deprecation, by Chris Bieneman
Hans Wennborg [Fri, 12 Feb 2016 20:21:39 +0000 (20:21 +0000)]
ReleaseNotes: autoconf deprecation, by Chris Bieneman

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

9 years agoReleaseNotes: static analyzer, by Anna Zaks
Hans Wennborg [Fri, 12 Feb 2016 20:20:26 +0000 (20:20 +0000)]
ReleaseNotes: static analyzer, by Anna Zaks

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

9 years agoReleaseNotes: __builtin_object_size and overloadable; by George Burgess IV
Hans Wennborg [Fri, 12 Feb 2016 01:54:57 +0000 (01:54 +0000)]
ReleaseNotes: __builtin_object_size and overloadable; by George Burgess IV

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

9 years agoMerging r260637:
Hans Wennborg [Fri, 12 Feb 2016 01:04:08 +0000 (01:04 +0000)]
Merging r260637:
------------------------------------------------------------------------
r260637 | hans | 2016-02-11 17:01:37 -0800 (Thu, 11 Feb 2016) | 1 line

UsersManual: update clang-cl commands
------------------------------------------------------------------------

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

9 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Fri, 12 Feb 2016 00:50:11 +0000 (00:50 +0000)]
Generate docs/AttributeReference.rst

I ran:
$ bin/clang-tblgen -gen-attr-docs -I../cfe.src/include ../cfe.src/include/clang/Basic/Attr.td -o ../cfe.src/docs/AttributeReference.rst

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

9 years agoReleaseNotes: drop in-progress warning and svn checkout note
Hans Wennborg [Fri, 12 Feb 2016 00:48:28 +0000 (00:48 +0000)]
ReleaseNotes: drop in-progress warning and svn checkout note

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

9 years agoMerging r259931:
Hans Wennborg [Fri, 5 Feb 2016 22:15:03 +0000 (22:15 +0000)]
Merging r259931:
------------------------------------------------------------------------
r259931 | uweigand | 2016-02-05 13:34:28 -0800 (Fri, 05 Feb 2016) | 33 lines

[SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros

Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ.

This fixes a miscompile of GCC C++11 standard library headers
due to use of those macros in an ABI-changing manner.

See e.g. /usr/include/c++/4.8.5/ext/concurrence.h:

  // Compile time constant that indicates prefered locking policy in
  // the current configuration.
  static const _Lock_policy __default_lock_policy =
#ifdef __GTHREADS
#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
     && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
  _S_atomic;
#else
  _S_mutex;
#endif
#else
  _S_single;
#endif

A different choice of __default_lock_policy causes different
sizes of several of the C++11 data structures, which are then
incompatible when inlined in clang-compiled code with what the
(GCC-compiled) external library expects.

This in turn leads to various crashes when using std::thread
in code compiled with clang, as see e.g. via the ThreadPool
unit tests.  See PR 26473 for an example.

------------------------------------------------------------------------

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

9 years agoMerging r259183:
Hans Wennborg [Thu, 4 Feb 2016 18:20:19 +0000 (18:20 +0000)]
Merging r259183:
------------------------------------------------------------------------
r259183 | uweigand | 2016-01-29 02:45:23 -0800 (Fri, 29 Jan 2016) | 8 lines

Add target triple to CodeGenOpenCL/pipe_types.cl test case

The test is failing on SystemZ since different IR is being
generated due to platform ABI differences.  Add a target triple.

Fix suggested by Anastasia Stulova.

------------------------------------------------------------------------

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

9 years agoMerging r259598:
Hans Wennborg [Tue, 2 Feb 2016 23:26:23 +0000 (23:26 +0000)]
Merging r259598:
------------------------------------------------------------------------
r259598 | rsmith | 2016-02-02 15:11:49 -0800 (Tue, 02 Feb 2016) | 7 lines

Work around build failure due to GCC 4.8.1 bug. We don't completely understand
the details of the bug, but avoiding overloading llvm::cast with another
function template sidesteps it.

See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more
backgound on how it manifested in Clang. Patch by Igor Sugak!

------------------------------------------------------------------------

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

9 years agoMerging r257831, r257838, r257853, r257861, r257869, r257870, r257871.
Hans Wennborg [Mon, 1 Feb 2016 22:13:54 +0000 (22:13 +0000)]
Merging r257831, r257838, r257853, r257861, r257869, r257870, r257871.

------------------------------------------------------------------------
r257831 | rtrieu | 2016-01-14 14:56:39 -0800 (Thu, 14 Jan 2016) | 13 lines

Refactor template type diffing

1) Instead of using pairs of From/To* fields, combine fields into a struct
TemplateArgInfo and have two in each DiffNode.
2) Use default initialization in DiffNode so that the constructor shows the
only field that is initialized differently on construction.
3) Use Set and Get functions per each DiffKind to make sure all fields for the
diff is set.  In one case, the Expr fields were not set.
4) Don't print boolean literals for boolean template arguments.  This prevents
printing 'false aka 0'

Only #3 has a functional change, which is reflected in the test change.
------------------------------------------------------------------------

------------------------------------------------------------------------
r257838 | rtrieu | 2016-01-14 15:30:12 -0800 (Thu, 14 Jan 2016) | 6 lines

Change the TSTiterator in Template Type Diffing.

Modify the TSTiterator to have two internal iterators, which will walk
the provided sugared type and the desugared type.  This will provide better
access to the template argument information.  No functional changes.
------------------------------------------------------------------------

------------------------------------------------------------------------
r257853 | rtrieu | 2016-01-14 17:08:56 -0800 (Thu, 14 Jan 2016) | 11 lines

Make template type diffing use the new desguared iterator.

If available, use the canonical template argument to fill in information for
template type diffing instead of attempting to special case and evaluate Expr's
for the value.  Since those are the values used in template instantiation,
we don't have to worry about difference between our evaluator and theirs.  Also
move the nullptr template arguments from DiffKind::Expression to
DiffKind::Declaration and allow DiffKind::Declaration to set an Expr.  The only
effect that should result is that a named nullptr will show up as
'ptr aka nullptr' in diagnostics.
------------------------------------------------------------------------

------------------------------------------------------------------------
r257861 | rtrieu | 2016-01-14 18:55:17 -0800 (Thu, 14 Jan 2016) | 7 lines

Save the integer type for integral template arguments.

Save the integer type when diffing integers in template type diffing.  When
integers are different sizes, print out the type along with the integer value.
Also with the type information, print true and false instead of 1 and 0 for
boolean values.
------------------------------------------------------------------------

------------------------------------------------------------------------
r257869 | rtrieu | 2016-01-14 21:01:53 -0800 (Thu, 14 Jan 2016) | 6 lines

Add new diff modes to template type diffing.

Remove an old assertion that does not hold.  It is possible for a template
argument to be a declaration in one instantiation and an integer in another.
Create two new diff kinds for these (decl vs int and int vs decl).
------------------------------------------------------------------------

------------------------------------------------------------------------
r257870 | rtrieu | 2016-01-14 21:48:38 -0800 (Thu, 14 Jan 2016) | 10 lines

Fixing more issues with template type diffing

1) Print qualifiers for templates with zero arguments
2) Add a few more tests for the template type diffing refactoring.
Specifically, PR24587 has been fixed and has a test case from
http://reviews.llvm.org/D15384
3) Adds asserts to check the DiffTree is in correct state when moving nodes
4) Rename the field FromType and ToType since it is heavily used within
member functions.
------------------------------------------------------------------------

------------------------------------------------------------------------
r257871 | jyknight | 2016-01-14 21:57:41 -0800 (Thu, 14 Jan 2016) | 1 line

Fix a -Wparentheses warning in ASTDiagnostic.cpp.
------------------------------------------------------------------------

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

9 years agoMerging r258396:
Hans Wennborg [Mon, 1 Feb 2016 21:43:22 +0000 (21:43 +0000)]
Merging r258396:
------------------------------------------------------------------------
r258396 | abataev | 2016-01-21 04:54:48 -0800 (Thu, 21 Jan 2016) | 2 lines

Fix crash for typedefs for arrays of runtime bounds in Lambdas/Captured Statements, used in sizeof() expression only.

------------------------------------------------------------------------

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

9 years agoMerging r257710:
Hans Wennborg [Mon, 1 Feb 2016 21:40:38 +0000 (21:40 +0000)]
Merging r257710:
------------------------------------------------------------------------
r257710 | gbiv | 2016-01-13 15:36:34 -0800 (Wed, 13 Jan 2016) | 8 lines

[Sema] Suppress diags in overload resolution.

We were emitting diagnostics from our shiny new C-only overload
resolution mode. This patch attempts to silence all such diagnostics.

This fixes PR26085.
Differential Revision: http://reviews.llvm.org/D16159

------------------------------------------------------------------------

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

9 years agoMerging r259260:
Hans Wennborg [Mon, 1 Feb 2016 17:10:12 +0000 (17:10 +0000)]
Merging r259260:
------------------------------------------------------------------------
r259260 | samsonov | 2016-01-29 15:07:14 -0800 (Fri, 29 Jan 2016) | 1 line

[UBSan] Add documentation for runtime issue suppression.
------------------------------------------------------------------------

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

9 years agoMerging r258307 and r258495:
Alexey Bataev [Fri, 29 Jan 2016 05:14:10 +0000 (05:14 +0000)]
Merging r258307 and r258495:
------------------------------------------------------------------------
r258307 | abataev | 2016-01-20 15:29:47 +0300 (Wed, 20 Jan 2016) | 3 lines

[OPENMP 4.0] Fix for codegen of 'cancel' directive within 'sections' directive.
Allow to emit code for 'cancel' directive within 'sections' directive with single sub-section.

------------------------------------------------------------------------
r258495 | abataev | 2016-01-22 11:56:50 +0300 (Fri, 22 Jan 2016) | 3 lines

[OPENMP] Generalize codegen for 'sections'-based directive.
If 'sections' directive has only one sub-section, the code for 'single'-based directive was emitted. Removed this codegen, because it causes crashes in different cases.

------------------------------------------------------------------------

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

9 years agoMerging r257947:
Hans Wennborg [Mon, 25 Jan 2016 20:35:13 +0000 (20:35 +0000)]
Merging r257947:
------------------------------------------------------------------------
r257947 | joerg | 2016-01-15 14:29:34 -0800 (Fri, 15 Jan 2016) | 2 lines

Avoid self-assignment of SmallString, trigger UB behavior down the road.

------------------------------------------------------------------------

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

9 years agoMerging r258110:
Dimitry Andric [Fri, 22 Jan 2016 20:43:39 +0000 (20:43 +0000)]
Merging r258110:
------------------------------------------------------------------------
r258110 | faisalv | 2016-01-19 04:58:55 +0100 (Tue, 19 Jan 2016) | 15 lines

Fix PR26134: When substituting into default template arguments, keep CurContext unchanged.

Or, do not set Sema's CurContext to the template declaration's when substituting into default template arguments of said template declaration.
If we do push the template declaration context on to Sema, and the template declaration is at namespace scope, Sema can get confused and try and do odr analysis when substituting into default template arguments, even though the substitution could be occurring within a dependent context.
I'm not sure why this was being done, perhaps there was concern that if a default template argument referred to a previous template parameter, it might not be found during substitution - but all regression tests pass, and I can't craft a test that would cause it to fails (if some one does, please inform me, and i'll craft a different fix for the PR).

This patch removes a single line of code, but unfortunately adds more than it removes, because of the tests.  Some day I still hope to commit a patch that removes far more lines than it adds, while leaving clang better for it ;)

Sorry that r253590 ("Change the expression evaluation context from Unevaluated to ConstantEvaluated while substituting into non-type template argument defaults") caused the PR!

------------------------------------------------------------------------

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

9 years agoMerging r258394:
Alexey Bataev [Fri, 22 Jan 2016 04:07:48 +0000 (04:07 +0000)]
Merging r258394:
------------------------------------------------------------------------
r258394 | abataev | 2016-01-21 15:35:58 +0300 (Thu, 21 Jan 2016) | 3 lines

[OPENMP] Fix crash on reduction for complex variables.
reworked codegen for reduction operation for complex types to avoid crash

------------------------------------------------------------------------

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

9 years agoMerging r257652 and r257695:
Hans Wennborg [Wed, 13 Jan 2016 23:48:11 +0000 (23:48 +0000)]
Merging r257652 and r257695:
------------------------------------------------------------------------
r257652 | hans | 2016-01-13 11:14:03 -0800 (Wed, 13 Jan 2016) | 1 line

Update cxx_dr_status.html after the 3.8 branch
------------------------------------------------------------------------

------------------------------------------------------------------------
r257695 | rsmith | 2016-01-13 14:51:59 -0800 (Wed, 13 Jan 2016) | 2 lines

Update make_cxx_dr_status after the 3.8 branch.

------------------------------------------------------------------------

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

9 years agoRelease note for debugger tuning
Paul Robinson [Wed, 13 Jan 2016 19:24:51 +0000 (19:24 +0000)]
Release note for debugger tuning

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

9 years agoCreating release_38 branch off revision 257626
Hans Wennborg [Wed, 13 Jan 2016 17:34:59 +0000 (17:34 +0000)]
Creating release_38 branch off revision 257626

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

9 years agoclang-format: [ObjC+JS] Allow bin-packing of array literals.
Daniel Jasper [Wed, 13 Jan 2016 16:41:34 +0000 (16:41 +0000)]
clang-format: [ObjC+JS] Allow bin-packing of array literals.

After reading the style guides again, they don't actually say how to
pack or not pack array literals. Based on some user reports, array
initializers can unnecessarily get quite long if they contain many
small elements. Array literals with trailing commas are still formatted
one per line so that users have a way to opt out of the packing.

Before:
  var array = [
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa
  ];

After:
  var array = [
    aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa,
    aaaaaa, aaaaaa
  ];

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

9 years agoRevert r257602 because it breaks integrated-as.s on mips hosts.
Scott Egerton [Wed, 13 Jan 2016 16:19:33 +0000 (16:19 +0000)]
Revert r257602 because it breaks integrated-as.s on mips hosts.

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

9 years agoRevert "[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion."
Artem Dergachev [Wed, 13 Jan 2016 15:52:25 +0000 (15:52 +0000)]
Revert "[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion."

This reverts commit r257605.

The test fails on architectures that use unsigned int as size_t.
SymbolManager.h fails with compile errors on some platforms.

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

9 years ago[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion.
Artem Dergachev [Wed, 13 Jan 2016 15:13:48 +0000 (15:13 +0000)]
[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion.

Provide separate visitor templates for the three hierarchies, and also
the `FullSValVisitor' class, which is a union of all three visitors.

Additionally, add a particular example visitor, `SValExplainer', in order to
test the visitor templates. This visitor is capable of explaining the SVal,
SymExpr, or MemRegion in a natural language.

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

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

9 years ago[mips] Added support for -Wa,-mips32 and similar.
Scott Egerton [Wed, 13 Jan 2016 14:27:59 +0000 (14:27 +0000)]
[mips] Added support for -Wa,-mips32 and similar.

Reviewers: vkalintiris, dsanders

Subscribers: cfe-commits

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

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

9 years ago[analyzer] Fix SVal/SymExpr/MemRegion class and enum names for consistency.
Artem Dergachev [Wed, 13 Jan 2016 13:49:29 +0000 (13:49 +0000)]
[analyzer] Fix SVal/SymExpr/MemRegion class and enum names for consistency.

The purpose of these changes is to simplify introduction of definition files
for the three hierarchies.

1. For every sub-class C of these classes, its kind in the relevant enumeration
is changed to "CKind" (or C##Kind in preprocessor-ish terms), eg:

  MemRegionKind   -> MemRegionValKind
  RegionValueKind -> SymbolRegionValueKind
  CastSymbolKind  -> SymbolCastKind
  SymIntKind      -> SymIntExprKind

2. MemSpaceRegion used to be inconsistently used as both an abstract base and
a particular region. This region class is now an abstract base and no longer
occupies GenericMemSpaceRegionKind. Instead, a new class, CodeSpaceRegion,
is introduced for handling the unique use case for MemSpaceRegion as
"the generic memory space" (when it represents a memory space that holds all
executable code).

3. BEG_ prefixes in memory region kind ranges are renamed to BEGIN_ for
consisitency with symbol kind ranges.

4. FunctionTextRegion and BlockTextRegion are renamed to FunctionCodeRegion and
BlockCodeRegion, respectively. The term 'code' is less jargony than 'text' and
we already refer to BlockTextRegion as a 'code region' in BlockDataRegion.

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

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

9 years ago[OPENMP] Fix for declarative/standalone directives use.
Alexey Bataev [Wed, 13 Jan 2016 11:18:54 +0000 (11:18 +0000)]
[OPENMP] Fix for declarative/standalone directives use.
Fixes processing of declarative directives and standalone executable directives. Declarative directives should not be allowed as an immediate statements and standalone executable directives are allowed to be used in case-stmt constructs.

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

9 years agoInstall scan-build and scan-view only if Static Analyzer was enabled.
Eugene Zelenko [Wed, 13 Jan 2016 02:03:50 +0000 (02:03 +0000)]
Install scan-build and scan-view only if Static Analyzer was enabled.

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

9 years ago[Bugfix] Fix ICE on constexpr vector splat.
George Burgess IV [Wed, 13 Jan 2016 01:52:39 +0000 (01:52 +0000)]
[Bugfix] Fix ICE on constexpr vector splat.

In {CG,}ExprConstant.cpp, we weren't treating vector splats properly.
This patch makes us treat splats more properly.

Additionally, this patch adds a new cast kind which allows a bool->int
cast to result in -1 or 0, instead of 1 or 0 (for true and false,
respectively), so we can sanely model OpenCL bool->int casts in the AST.

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

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

9 years ago[CUDA] Rename check-prefixes in cuda-options.cu and cuda-unused-arg-warning.cu.
Justin Lebar [Wed, 13 Jan 2016 01:24:35 +0000 (01:24 +0000)]
[CUDA] Rename check-prefixes in cuda-options.cu and cuda-unused-arg-warning.cu.

Summary:
Rename the args to be more human-readable.  Among other things, this
lets us get rid of a bunch of comments (e.g. "ensure we don't run the
linker"), greatly shortening these tests.

Also apply consistent formatting and fix some English nits while we're
at it.

Reviewers: tra

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

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

9 years agoGeneralize r256026 to apply to all MachO targets, not just Darwin targets.
Bob Wilson [Wed, 13 Jan 2016 01:19:02 +0000 (01:19 +0000)]
Generalize r256026 to apply to all MachO targets, not just Darwin targets.

The PIC default is set for the MachO toolchain, not just the Darwin toolchain,
so this treats those the same. The behavior with -static should be the same
for all MachO targets. rdar://24152327

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

9 years ago[CUDA] Report an error if code tries to mix incompatible CUDA attributes.
Justin Lebar [Wed, 13 Jan 2016 01:07:35 +0000 (01:07 +0000)]
[CUDA] Report an error if code tries to mix incompatible CUDA attributes.

Summary: Thanks to jhen for helping me figure this out.

Reviewers: tra, echristo

Subscribers: jhen

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

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

9 years ago[Darwin] Fix deployment target detection
Frederic Riss [Tue, 12 Jan 2016 23:47:59 +0000 (23:47 +0000)]
[Darwin] Fix deployment target detection

There was a thinko in the deployment target detection code that
made the -isysroot parsing have precedence over the environment
variable for tvOS. This patch makes this logic symetric for all
platforms (the env variable must have precedence).

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

9 years agoFollow-up to r257537: add test that majnemer asked about
Hans Wennborg [Tue, 12 Jan 2016 23:31:58 +0000 (23:31 +0000)]
Follow-up to r257537: add test that majnemer asked about

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

9 years agoclang-cl: Support /Dfoo#bar (PR25984)
Hans Wennborg [Tue, 12 Jan 2016 23:17:03 +0000 (23:17 +0000)]
clang-cl: Support /Dfoo#bar (PR25984)

Such flags will now be translated to -Dfoo=bar.

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

9 years agoD9600: Add scan-build python implementation
Laszlo Nagy [Tue, 12 Jan 2016 22:38:41 +0000 (22:38 +0000)]
D9600: Add scan-build python implementation

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

9 years ago[CUDA] Add explicit mapping from sm_XX to compute_YY.
Justin Lebar [Tue, 12 Jan 2016 22:23:04 +0000 (22:23 +0000)]
[CUDA] Add explicit mapping from sm_XX to compute_YY.

Summary: This is used by D16082 when it invokes fatbinary.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

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

9 years agoImprove AST dumping:
Richard Smith [Tue, 12 Jan 2016 21:59:26 +0000 (21:59 +0000)]
Improve AST dumping:

 1) When dumping a declaration that declares a name for a type, also dump the named type.
 2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in
    the current context.

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

9 years agoProperly track the end location of an exception specification.
Aaron Ballman [Tue, 12 Jan 2016 21:04:22 +0000 (21:04 +0000)]
Properly track the end location of an exception specification.

Patch by Adrian ZgorzaÅ‚ek

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

9 years agoModule debugging: Make the module format part of the module hash instead
Adrian Prantl [Tue, 12 Jan 2016 21:01:56 +0000 (21:01 +0000)]
Module debugging: Make the module format part of the module hash instead
of the file name. This is consistent with how other HeaderSearchOptions
are handled.

Due to the other inputs of the module hash (revision number) this is not
really testable in a meaningful way.

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

9 years agoDon't store CGOpenMPRegionInfo::CodeGen as a reference (PR26078)
Hans Wennborg [Tue, 12 Jan 2016 20:54:36 +0000 (20:54 +0000)]
Don't store CGOpenMPRegionInfo::CodeGen as a reference (PR26078)

The referenced llvm::function_ref<void(CodeGenFunction &)> object can go
away before CodeGen is used, resulting in a crash.

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

9 years ago[modules] Don't diagnose a conflict between two using-declarations that name equivale...
Richard Smith [Tue, 12 Jan 2016 20:34:32 +0000 (20:34 +0000)]
[modules] Don't diagnose a conflict between two using-declarations that name equivalent internal linkage entities.

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

9 years agoAdd a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).
Dimitry Andric [Tue, 12 Jan 2016 19:40:55 +0000 (19:40 +0000)]
Add a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).

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

9 years agofunction names start with a lower case letter ; NFC
Sanjay Patel [Tue, 12 Jan 2016 18:03:41 +0000 (18:03 +0000)]
function names start with a lower case letter ; NFC

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

9 years agoRevert r253898 and r253899, this breaks mingw compilation on openSUSE.
Ismail Donmez [Tue, 12 Jan 2016 10:41:20 +0000 (10:41 +0000)]
Revert r253898 and r253899, this breaks mingw compilation on openSUSE.
Will re-apply after llvm 3.8 is branched.

Original commit message:

Driver: fallback to the location of clang if no sysroot,

hard coding /usr makes little sense for mingw-w64.
If we have portable toolchains having /usr breaks that.
If the clang we use is in /usr/bin or /usr/sbin etc this will
still detect as though it was hard coded to /usr

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

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

9 years ago[analyzer] Fix RangeConstraintManager's pinning of single value ranges.
Pierre Gousseau [Tue, 12 Jan 2016 10:40:45 +0000 (10:40 +0000)]
[analyzer] Fix RangeConstraintManager's pinning of single value ranges.

This fix a bug in RangeSet::pin causing single value ranges to be considered non conventionally ordered.

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

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

9 years ago[analyzer] Evaluate integral casts as cast symbols if truncations are detected.
Pierre Gousseau [Tue, 12 Jan 2016 10:07:56 +0000 (10:07 +0000)]
[analyzer] Evaluate integral casts as cast symbols if truncations are detected.

The current workaround for truncations not being modelled is that the evaluation of integer to integer casts are simply bypassed and so the original symbol is used as the new casted symbol (cf SimpleSValBuilder::evalCastFromNonLoc).
This lead to the issue described in PR25078, as the RangeConstraintManager associates ranges with symbols.

The new evalIntegralCast method added by this patch wont bypass the cast if it finds the range of the symbol to be greater than the maximum value of the target type.

The fix to RangeSet::pin mentioned in the initial review will be committed separately.

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

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

9 years agoPR18513: make gcc compatible layout for bit-fields with explicit aligned attribute...
Alexey Bataev [Tue, 12 Jan 2016 09:12:20 +0000 (09:12 +0000)]
PR18513: make gcc compatible layout for bit-fields with explicit aligned attribute, by Dmitry Polukhin
Fix binary compatibility issue with GCC.
Differential Revision: http://reviews.llvm.org/D14980

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

9 years agoFix infinite recursion for invalid declaration, by Dmitry Polukhin
Alexey Bataev [Tue, 12 Jan 2016 09:01:25 +0000 (09:01 +0000)]
Fix infinite recursion for invalid declaration, by Dmitry Polukhin
Fix for a case found by fuzzing PR23057 (comment #25 https://llvm.org/bugs/show_bug.cgi?id=23057#c25).
Differential Revision: http://reviews.llvm.org/D16065

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

9 years agoclang-format: [JS] Support exporting abstract classes.
Daniel Jasper [Tue, 12 Jan 2016 06:24:38 +0000 (06:24 +0000)]
clang-format: [JS] Support exporting abstract classes.

Before:
  export abstract class X {y: number;}
(and all sorts of other havoc in more complicated cases).

After:
  export abstract class X { y: number; }

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

9 years ago[CUDA] Reject values for --cuda-gpu-arch that are not of the form /sm_\d+/.
Justin Lebar [Mon, 11 Jan 2016 23:27:13 +0000 (23:27 +0000)]
[CUDA] Reject values for --cuda-gpu-arch that are not of the form /sm_\d+/.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

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

9 years agoAdd an Action* member to InputInfo.
Justin Lebar [Mon, 11 Jan 2016 23:15:21 +0000 (23:15 +0000)]
Add an Action* member to InputInfo.

Summary:
The CUDA toolchain needs to know which Actions created which InputInfos,
because it needs to attach GPU archs to the various InputInfos.

Reviewers: echristo

Subscribers: jfb, dschuff, jhen, tra, cfe-commits

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

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

9 years agoMake Driver::BuildJobsForAction return an InputInfo, instead of using an outparam.
Justin Lebar [Mon, 11 Jan 2016 23:09:32 +0000 (23:09 +0000)]
Make Driver::BuildJobsForAction return an InputInfo, instead of using an outparam.

Summary: Explicit is better than implicit.

Reviewers: echristo

Subscribers: llvm-commits

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

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

9 years agoMove ownership of Action objects into Compilation.
Justin Lebar [Mon, 11 Jan 2016 23:07:27 +0000 (23:07 +0000)]
Move ownership of Action objects into Compilation.

Summary:
This makes constructing Action graphs which are DAGs much simpler.  It
also just simplifies in general the ownership semantics of Actions.

Depends on D15910.

Reviewers: echristo

Subscribers: klimek, cfe-commits

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

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

9 years agoclang-format: [JS] Teach clang-format about "export interface".
Daniel Jasper [Mon, 11 Jan 2016 22:57:40 +0000 (22:57 +0000)]
clang-format: [JS] Teach clang-format about "export interface".

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

9 years agoWhen a tag is declared in prototype scope in C, if we've decided that it
Richard Smith [Mon, 11 Jan 2016 22:41:53 +0000 (22:41 +0000)]
When a tag is declared in prototype scope in C, if we've decided that it
redeclares an existing tag but are creating a new declaration anyway (because
it has attributes or changes the visibility of the name), don't warn that it
won't be visible outside the current scope. That's not true.

Also narrow down the set of cases where we create these extra declarations when
building modules; previously, all tag declarations but the first in a module
header would get this treatment if -fmodules-local-submodule-visibility. (This
isn't a functional change, but we try to avoid creating these extra
declarations whenever we can.)

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

9 years agoPR26087: Use nonstandard MSVC extension for VS2015 as well.
James Y Knight [Mon, 11 Jan 2016 22:00:22 +0000 (22:00 +0000)]
PR26087: Use nonstandard MSVC extension for VS2015 as well.

In r256564, I had conditioned the workaround in has_getDecl to only be
used for MSVC before the 2015 release, believing that 2015 could handle
the standard code. But, that was incorrect.

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

9 years agoFix -Wmicrosoft-enum-value warning
Reid Kleckner [Mon, 11 Jan 2016 20:55:16 +0000 (20:55 +0000)]
Fix -Wmicrosoft-enum-value warning

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

9 years ago[Sema] Issue a warning for integer overflow in struct initializer
Akira Hatanaka [Mon, 11 Jan 2016 17:22:01 +0000 (17:22 +0000)]
[Sema] Issue a warning for integer overflow in struct initializer

Clang wasn't issuing a warning when compiling the following code:

struct s {
  unsigned x;
} s = {
  .x = 4 * 1024 * 1024 * 1024
};

rdar://problem/23399683

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

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

9 years ago[clang-format] Fix comment aligning when there are changes within the comment
Benjamin Kramer [Mon, 11 Jan 2016 16:27:16 +0000 (16:27 +0000)]
[clang-format] Fix comment aligning when there are changes within the comment

As soon as a comment had whitespace changes inside of the token, we
couldn't identify the whole comment as a trailing comment anymore and
alignment stopped working. Add a new boolean to Change for this special
case and fix trailing comment identification to use it.

This also changes WhitespaceManager to sum the length of all Changes
inside of a token into the first Change.

Before this fix

  int xy;  // a
  int z;   //b

became

  int xy;  // a
  int z;  // b

with this patch we immediately get to:

  int xy;  // a
  int z;   // b

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

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

9 years agoclang-format: Fix overloading "operator," definitions more thoroughly.
Daniel Jasper [Mon, 11 Jan 2016 12:55:33 +0000 (12:55 +0000)]
clang-format: Fix overloading "operator," definitions more thoroughly.

Before:
  aaaaaaaaaaaaaaaaaaaaaa operator,(aaaaaaaaaaaaaaaaaaaaa &
                                   aaaaaaaaaaaaaaaaaaaaaaaaaa) const;
After:
  aaaaaaaaaaaaaaaaaaaaaa operator,(
      aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaaaaaaaaaaaaaaaaaaa) const;

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

9 years ago[WebAssembly] Fix a typo in a comment.
Dan Gohman [Mon, 11 Jan 2016 11:49:44 +0000 (11:49 +0000)]
[WebAssembly] Fix a typo in a comment.

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

9 years agoFix assert hit when tree-transforming template template parameter packs.
Manuel Klimek [Mon, 11 Jan 2016 11:39:00 +0000 (11:39 +0000)]
Fix assert hit when tree-transforming template template parameter packs.

Covers significantly more code in the template template pack argument
test and fixes the resulting assert problem.

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

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

9 years agoclang-format: Slightly row back on r257257.
Daniel Jasper [Mon, 11 Jan 2016 11:01:05 +0000 (11:01 +0000)]
clang-format: Slightly row back on r257257.

r257257 change the way clang-format enforces line breaks after a
templated type has been line-wrapped. This was to fix an incorrect line
break if BinPackParameters is set to false. However, it also leads to
an unwanted line break in a different case. Thus, for now, only do this
when BinPackParameters is false. This isn't ideal yet, but helps us
until we have a better solution.

With BinPackParameters:
Before:
  void fffffffffff(aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaa,
                                               aaaaaaaaaaaaaaaaaaaa);

After:
  void fffffffffff(
      aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaa);

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

9 years agoclang-format: [JS] Improve line-flow when calling functions on array literals.
Daniel Jasper [Mon, 11 Jan 2016 11:00:58 +0000 (11:00 +0000)]
clang-format: [JS] Improve line-flow when calling functions on array literals.

Before:
  return [
    aaaaaaaaaaaaaaaaaaaaaa
  ].aaaaaaa(function() {
     //
   })
   .bbbbbb();

After:
  return [aaaaaaaaaaaaaaaaaaaaaa]
      .aaaaaaa(function() {
//
      })
      .bbbbbb();

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

9 years agoAnalysisConsumer: use canonical decl for both lookup and store of
Yury Gribov [Mon, 11 Jan 2016 09:38:48 +0000 (09:38 +0000)]
AnalysisConsumer: use canonical decl for both lookup and store of
visited decls.

Due to redeclarations, the function may have different declarations used
in CallExpr and in the definition. However, we need to use a unique
declaration for both store and lookup in VisitedCallees. This patch
fixes issues with analysis in topological order. A simple test is
included.

Patch by Alex Sidorin!

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

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

9 years agoAccidentally removed part of the file header. Restoring it back.
Ekaterina Romanova [Sun, 10 Jan 2016 16:18:09 +0000 (16:18 +0000)]
Accidentally removed part of the file header. Restoring it back.

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

9 years agoSimplify test code with initializer lists.
Benjamin Kramer [Sun, 10 Jan 2016 10:45:19 +0000 (10:45 +0000)]
Simplify test code with initializer lists.

No functional change intended.

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

9 years agoMake test work on windows by turning \ in paths back into /.
Benjamin Kramer [Sun, 10 Jan 2016 10:36:59 +0000 (10:36 +0000)]
Make test work on windows by turning \ in paths back into /.

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

9 years agoclang-format: Fix the counting of leading whitespace in tok::unknown tokens
Daniel Jasper [Sat, 9 Jan 2016 21:12:45 +0000 (21:12 +0000)]
clang-format: Fix the counting of leading whitespace in tok::unknown tokens

Previously, all whitespace characters would increase the starting
column, which doesn't make sense. This fixes a problem, e.g. with the
length calculation in JS template strings.

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

9 years ago[vfs] Normalize working directory if requested.
Benjamin Kramer [Sat, 9 Jan 2016 16:33:16 +0000 (16:33 +0000)]
[vfs] Normalize working directory if requested.

FixedCompilationDatabase sets the working dir to "." by default. For
chdir(".") this is a noop but this lead to InMemoryFileSystem to create
bogus paths. Fixes PR25327.

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

9 years agoMake clang::format::reformat work with non 0-terminated strings.
Daniel Jasper [Sat, 9 Jan 2016 15:56:57 +0000 (15:56 +0000)]
Make clang::format::reformat work with non 0-terminated strings.

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

9 years agoclang-format: Improve selective comment formatting.
Daniel Jasper [Sat, 9 Jan 2016 15:56:53 +0000 (15:56 +0000)]
clang-format: Improve selective comment formatting.

Starting here:
  int x; // Format this line only.
  int xx; //
  int xxxxx; //

Before:
  int x;     // Format this line only.
  int xx; //
  int xxxxx; //

After:
  int x;  // Format this line only.
  int xx; //
  int xxxxx; //

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

9 years agoclang-format: Fix incorrect line break in certain configurations.
Daniel Jasper [Sat, 9 Jan 2016 15:56:47 +0000 (15:56 +0000)]
clang-format: Fix incorrect line break in certain configurations.

Before:
  void aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                          vector<int>
                              bbbbbbbbbbbbbbb);

After:
  void aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                          vector<int> bbbbbbbbbbbbbbb);

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

9 years agoclang-format: Support definitions/declarations of operator,.
Daniel Jasper [Sat, 9 Jan 2016 15:56:40 +0000 (15:56 +0000)]
clang-format: Support definitions/declarations of operator,.

Before:
  bool operator, ();

After:
  bool operator,();

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

9 years agoclang-format: [JS] Support semicolons in TypeScript's TypeMemberLists.
Daniel Jasper [Sat, 9 Jan 2016 15:56:28 +0000 (15:56 +0000)]
clang-format: [JS] Support semicolons in TypeScript's TypeMemberLists.

Before:
  var x: {
    a: string;
    b: number;
  }
  = {};

After:
  var x: {a: string; b: number;} = {};

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