]> granicus.if.org Git - clang/log
clang
8 years agoMerging r228118: release_36 origin/release_36
Tom Stellard [Mon, 22 Jun 2015 20:39:00 +0000 (20:39 +0000)]
Merging r228118:

------------------------------------------------------------------------
r228118 | sameer.sahasrabuddhe | 2015-02-04 01:38:18 -0500 (Wed, 04 Feb 2015) | 8 lines

OpenCL: handle ternary operator when the condition is a vector

When the condition is a vector, OpenCL specifies additional
requirements on the operand types, and also the operations
required to determine the result type of the operator. This is a
combination of OpenCL v1.1 s6.3.i and s6.11.6, and the semantics
remain unchanged in later versions of OpenCL.

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

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

9 years agoMerging r235931:
Tom Stellard [Tue, 5 May 2015 16:00:41 +0000 (16:00 +0000)]
Merging r235931:

------------------------------------------------------------------------
r235931 | aaron | 2015-04-27 18:31:12 -0400 (Mon, 27 Apr 2015) | 2 lines

Check whether the operand to a noexcept expression is valid or not. Fixes PR15842.

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

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

9 years agoMerging r232786:
Tom Stellard [Mon, 4 May 2015 18:23:59 +0000 (18:23 +0000)]
Merging r232786:

------------------------------------------------------------------------
r232786 | david.majnemer | 2015-03-19 20:02:27 -0400 (Thu, 19 Mar 2015) | 7 lines

Don't crash-on-valid when an inline function is friend of class template

We assumed that the most recent declaration of an inline function would
also be inline.  However, a more recent declaration can come from a
friend declaration in a class template that is instantiated at the
definition of the function.

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

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

9 years agoMerging r232675:
Tom Stellard [Mon, 4 May 2015 18:23:57 +0000 (18:23 +0000)]
Merging r232675:

------------------------------------------------------------------------
r232675 | rtrieu | 2015-03-18 17:52:47 -0400 (Wed, 18 Mar 2015) | 9 lines

When cloning LocalInstantiationScope's, don't update the current scope in Sema.

Construction of LocalInstantiationScope automatically updates the current scope
inside Sema.  However, when cloning a scope, the current scope does not change.
Change the cloning function to preserve the current scope.

Review: http://reviews.llvm.org/D8407
BUG: https://llvm.org/bugs/show_bug.cgi?id=22931

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

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

9 years agoMerging r232425:
Tom Stellard [Mon, 4 May 2015 18:23:54 +0000 (18:23 +0000)]
Merging r232425:

------------------------------------------------------------------------
r232425 | rtrieu | 2015-03-16 17:49:43 -0400 (Mon, 16 Mar 2015) | 4 lines

Take the non-reference type when constructing a dummy expression.

Otherwise, Expr will assert during construction with a reference type.

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

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

9 years agoMerging r230603:
Tom Stellard [Mon, 4 May 2015 18:23:52 +0000 (18:23 +0000)]
Merging r230603:

------------------------------------------------------------------------
r230603 | rtrieu | 2015-02-25 21:40:48 -0500 (Wed, 25 Feb 2015) | 8 lines

Update assumption in template diffing about integer template arguments.

Fix for PR22017.  Integer template arguments are automatically bit extended to
the size of the integer type.  In template diffing, evaluated expressions were
not having their results extending, leading to comparing two APSInt's with
different widths.  Apply the proper bit extending when evaluating template
arguments.  This mainly affected bool template arguments.

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

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

9 years agoMerging r226983:
Tom Stellard [Mon, 4 May 2015 18:23:50 +0000 (18:23 +0000)]
Merging r226983:

------------------------------------------------------------------------
r226983 | rtrieu | 2015-01-23 21:48:32 -0500 (Fri, 23 Jan 2015) | 16 lines

When checking the template argument list, use a copy of that list for changes
and only update the orginal list on a valid arugment list.  When checking an
individual expression template argument, and conversions are required, update
the expression in the template argument.  Since template arguments are
speculatively checked, the copying of the template argument list prevents
updating the template arguments when the list does not match the template.

Additionally, clean up the integer checking code in the template diffing code.
The code performs unneccessary conversions from APSInt to APInt.

Fixes PR21758.

This essentially reverts r224770 to recommits r224667 and r224668 with extra
changes to prevent the template instantiation problems seen in PR22006.
A test to catch the discovered problem is also added.

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

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

9 years agoRevert "Merging r232439:"
Tom Stellard [Mon, 4 May 2015 18:23:43 +0000 (18:23 +0000)]
Revert "Merging r232439:"

This reverts commit r236305.

This commit requires an ABI change to LLVM, which is not allowed for
stable releases.

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

9 years agoMerging r232439:
Tom Stellard [Fri, 1 May 2015 03:17:44 +0000 (03:17 +0000)]
Merging r232439:

------------------------------------------------------------------------
r232439 | mail | 2015-03-16 19:52:21 -0400 (Mon, 16 Mar 2015) | 7 lines

GCOV: Expose the -coverage-exit-block-before-body flag in clang -cc1

This exposes the optional exit block placement logic from r232438 as a
clang -cc1 option. There is a test on the llvm side, but there isn't
really a way to inspect the gcov options from clang to test it here as
well.

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

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

9 years agoMerging r233508:
Daniel Sanders [Mon, 27 Apr 2015 08:15:56 +0000 (08:15 +0000)]
Merging r233508:
------------------------------------------------------------------------
r233508 | petarj | 2015-03-30 01:43:56 +0100 (Mon, 30 Mar 2015) | 23 lines

Add check for kind of UnqualifiedId in Declarator::isStaticMember()

Method CXXMethodDecl::isStaticOverloadedOperator expects Operator field
from the struct OperatorFunctionId, which is a member of the union in
the class UnqualifiedId. If the kind of UnqualifiedId is not checked,
there is no guarantee that the value that this method receives will be
correct, because it can be the value of another union member and not
OperatorFunctionId.

This bug manifests itself when running make check-all on mips64 BE.

This fix resolves the following regression tests:
Clang :: CXX/special/class.dtor/p9.cpp
Clang :: CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp
Clang :: CodeGenCXX/ctor-dtor-alias.cpp
Clang :: CodeGenCXX/debug-info-windows-dtor.cpp
Clang :: CodeGenCXX/dllexport-members.cpp
Clang :: CodeGenCXX/dllexport.cpp

Patch by Violeta Vukobrat.

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

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

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

9 years agoMerging r230253:
Daniel Sanders [Mon, 27 Apr 2015 08:14:57 +0000 (08:14 +0000)]
Merging r230253:
------------------------------------------------------------------------
r230253 | zjovanovic | 2015-02-23 20:20:49 +0000 (Mon, 23 Feb 2015) | 2 lines

Fixed typo.

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

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

9 years agoMerging r229680:
Daniel Sanders [Mon, 27 Apr 2015 08:14:13 +0000 (08:14 +0000)]
Merging r229680:
------------------------------------------------------------------------
r229680 | zjovanovic | 2015-02-18 15:21:35 +0000 (Wed, 18 Feb 2015) | 3 lines

Change representation of member function pointers for MIPS targets
Differential Revision: http://reviews.llvm.org/D7148

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

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

9 years agoMerging r230469:
Daniel Sanders [Mon, 27 Apr 2015 08:13:25 +0000 (08:13 +0000)]
Merging r230469:
------------------------------------------------------------------------
r230469 | atanasyan | 2015-02-25 07:31:12 +0000 (Wed, 25 Feb 2015) | 4 lines

[Mips] Support mips-r6 path suffix for Adnroid MIPS toolchain

This path suffix is used if user provides the -mips32r6 command line
options.
------------------------------------------------------------------------

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

9 years agoMerging r228918:
Daniel Sanders [Mon, 27 Apr 2015 08:12:42 +0000 (08:12 +0000)]
Merging r228918:
------------------------------------------------------------------------
r228918 | vkalintiris | 2015-02-12 11:36:56 +0000 (Thu, 12 Feb 2015) | 5 lines

[mips] Partially revert r223927: Removing __SIZEOF_INT128__ macro for MIPS64

Partially revert r223927 because LLVM gained support for 128-bit integers
in r227089. Modify and keep the tests that verify the definition of the
macro __SIZEOF_INT128__ for MIPS64 BE & LE in the preprocessor.
------------------------------------------------------------------------

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

9 years agoMerging r231451:
Tom Stellard [Mon, 20 Apr 2015 15:17:50 +0000 (15:17 +0000)]
Merging r231451:

------------------------------------------------------------------------
r231451 | nicolasweber | 2015-03-06 01:01:06 -0500 (Fri, 06 Mar 2015) | 5 lines

Don't crash on non-public referenced dtors in toplevel classes.

Fixes PR22793, a bug that caused self-hosting to fail after the innocuous
r231254. See the bug for details.

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

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

9 years agoMerge r234636:
Joerg Sonnenberger [Tue, 14 Apr 2015 14:47:56 +0000 (14:47 +0000)]
Merge r234636:
Create the correct profiling symbol on NetBSD.

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

9 years agoMerge r234629:
Joerg Sonnenberger [Tue, 14 Apr 2015 14:39:34 +0000 (14:39 +0000)]
Merge r234629:
Create correct platform-specific target for NetBSD PPC64LE.

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

9 years agoMerge r233819 into the release 36 branch with some modifications
Reid Kleckner [Wed, 1 Apr 2015 17:09:33 +0000 (17:09 +0000)]
Merge r233819 into the release 36 branch with some modifications

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

9 years agoMerging r232389:
Joerg Sonnenberger [Tue, 17 Mar 2015 23:24:18 +0000 (23:24 +0000)]
Merging r232389:
Global inline assembler blocks are merged before parsing, so no specific
location data is available. If pragma handling wants to look up the
position, it finds the LLVM buffer and wants to compare it with the
special built-in buffer, failing badly. Extend to the special handling
of the built-in buffer to also check for the inline asm buffer. Expect
only a single asm buffer. Sort it between the built-in buffers and the
normal file buffers.

Fixes the assert part of PR 22576.

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

9 years agoMerge r230255,231245,231280,231986:
Joerg Sonnenberger [Thu, 12 Mar 2015 11:14:45 +0000 (11:14 +0000)]
Merge r230255,231245,231280,231986:
Only lower __builtin_setjmp / __builtin_longjmp to
llvm.eh.sjlj.setjmp / llvm.eh.sjlj.longjmp, if the backend is known to
support them outside the Exception Handling context. The default
handling in LLVM codegen doesn't work and will create incorrect code.
The ARM backend on the other hand will assert if the intrinsics are
used.
--
Adjust the changes from r230255 to bail out if the backend can't lower
__builtin_setjmp/__builtin_longjmp and don't fall back to the libc
functions.
--
Fix test/CodeGen/builtins.c for platforms that don't lower sjlj

Opt in Win64 to supporting sjlj lowering. We have the backend lowering,
so I think this was just an oversight because WinX86_64TargetCodeGenInfo
doesn't inherit from X86_64TargetCodeGenInfo.
--
Under duress, move check for target support of __builtin_setjmp/
__builtin_longjmp to Sema as requested by John McCall.

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

9 years agoReleaseNotes: final touch-ups
Hans Wennborg [Tue, 24 Feb 2015 17:22:54 +0000 (17:22 +0000)]
ReleaseNotes: final touch-ups

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

9 years agoAdd release notes about the unroll pragmas.
Mark Heffernan [Tue, 24 Feb 2015 01:14:35 +0000 (01:14 +0000)]
Add release notes about the unroll pragmas.

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

9 years agoDocument the -fpic option change.
Rafael Espindola [Fri, 20 Feb 2015 01:11:40 +0000 (01:11 +0000)]
Document the -fpic option change.

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

9 years agoReleaseNotes: smarter typo correction
Hans Wennborg [Fri, 20 Feb 2015 00:56:15 +0000 (00:56 +0000)]
ReleaseNotes: smarter typo correction

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

9 years agoA few release note updates for C and C++ frontend changes.
Richard Smith [Fri, 20 Feb 2015 00:28:54 +0000 (00:28 +0000)]
A few release note updates for C and C++ frontend changes.

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

9 years agoAdd some info on Windows and MSVC support to the Clang 3.6 release notes
Reid Kleckner [Thu, 19 Feb 2015 17:50:24 +0000 (17:50 +0000)]
Add some info on Windows and MSVC support to the Clang 3.6 release notes

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

9 years agoMerging r229719:
Hans Wennborg [Wed, 18 Feb 2015 21:03:07 +0000 (21:03 +0000)]
Merging r229719:
------------------------------------------------------------------------
r229719 | d0k | 2015-02-18 10:45:54 -0800 (Wed, 18 Feb 2015) | 8 lines

Driver: Fix use of dangling std::string temporary

What's going on here is that the ternary operator produces a std::string rvalue
that the StringRef points to. I'd hoped bugs like this were a thing of the past
with our asan testing but apparently this code path is only used when LLVM is
configured with a custom --with-c-include-dirs setting.

Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely!
------------------------------------------------------------------------

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

9 years agoRelease notes: remove in-progress warnings
Hans Wennborg [Wed, 18 Feb 2015 18:22:16 +0000 (18:22 +0000)]
Release notes: remove in-progress warnings

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

9 years agoReleaseNotes: fix non-ASCII char, trailing spaces, and minor stuff like that
Hans Wennborg [Tue, 17 Feb 2015 22:41:43 +0000 (22:41 +0000)]
ReleaseNotes: fix non-ASCII char, trailing spaces, and minor stuff like that

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

9 years agoMerging r229408:
Hans Wennborg [Tue, 17 Feb 2015 21:31:25 +0000 (21:31 +0000)]
Merging r229408:
------------------------------------------------------------------------
r229408 | spatel | 2015-02-16 09:26:51 -0800 (Mon, 16 Feb 2015) | 10 lines

x86-64 ABI: unwrap single element structs / arrays of 256-bit vectors to pass and return in registers

This is a patch for PR22563 ( http://llvm.org/bugs/show_bug.cgi?id=22563 ).

We were not correctly unwrapping a single 256-bit AVX vector that was defined as an array of 1 inside a struct.

We would generate a <4 x float> param/return value instead of <8 x float> and lose half of the vector.

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

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

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

9 years agoMerging r228792:
Hans Wennborg [Wed, 11 Feb 2015 03:32:18 +0000 (03:32 +0000)]
Merging r228792:
------------------------------------------------------------------------
r228792 | rsmith | 2015-02-10 18:41:33 -0800 (Tue, 10 Feb 2015) | 5 lines

Add a warning for direct-list-initialization of a variable with a deduced type
(or of a lambda init-capture, which is sort-of such a variable). The semantics
of such constructs will change when we implement N3922, so we intend to warn on
this in Clang 3.6 then change the semantics in Clang 3.7.

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

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

9 years agoMerging r228785:
Hans Wennborg [Wed, 11 Feb 2015 02:20:59 +0000 (02:20 +0000)]
Merging r228785:
------------------------------------------------------------------------
r228785 | rsmith | 2015-02-10 17:48:47 -0800 (Tue, 10 Feb 2015) | 2 lines

PR21857: weaken an incorrect assertion.

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

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

9 years agoPort r226896 to the 3.6 branch.
Rafael Espindola [Tue, 10 Feb 2015 12:57:14 +0000 (12:57 +0000)]
Port r226896 to the 3.6 branch.

Original message:

[pr22293] Don't crash during codegen of a recursive destructor.

 In ItaniumCXXABI::EmitCXXDestructors we first emit the base destructor
and then try to emit the complete one as an alias.

If in the base ends up calling the complete destructor, the GD for the
complete will be in the list of deferred decl by the time we replace
it with an alias and delete the original GV.

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

9 years agoupdate with Clang OpenMP release notes for 3.6 by Michael Wong
Michael Wong [Mon, 9 Feb 2015 08:37:27 +0000 (08:37 +0000)]
update with Clang OpenMP release notes for 3.6 by Michael Wong

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

9 years agoMerging r228464:
Hans Wennborg [Fri, 6 Feb 2015 23:50:15 +0000 (23:50 +0000)]
Merging r228464:
------------------------------------------------------------------------
r228464 | rsmith | 2015-02-06 15:20:21 -0800 (Fri, 06 Feb 2015) | 2 lines

PR22405: don't lose implicit-deleted-ness across AST write / read.

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

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

9 years agoRelease notes: add blurb about C++17 support
Hans Wennborg [Wed, 4 Feb 2015 23:32:33 +0000 (23:32 +0000)]
Release notes: add blurb about C++17 support

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

9 years agoMerging r227861:
Hans Wennborg [Wed, 4 Feb 2015 20:44:15 +0000 (20:44 +0000)]
Merging r227861:
------------------------------------------------------------------------
r227861 | jholewinski | 2015-02-02 13:05:49 -0800 (Mon, 02 Feb 2015) | 15 lines

When generating llvm.used, we may need an addrspacecast instead of a bitcast.

Summary:
This is especially important for targets that use multiple address spaces,
and commonly place global variables in address spaces other than zero.

Fixes PR22383

Test Plan: New test case added: llvm-used.cu

Reviewers: jingyue

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7345
------------------------------------------------------------------------

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

9 years agoMention __super in the release notes.
Hans Wennborg [Wed, 4 Feb 2015 18:33:23 +0000 (18:33 +0000)]
Mention __super in the release notes.

From Nikola Smiljanic!

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

9 years agoMerging r228053:
Hans Wennborg [Wed, 4 Feb 2015 00:00:36 +0000 (00:00 +0000)]
Merging r228053:
------------------------------------------------------------------------
r228053 | dblaikie | 2015-02-03 14:37:17 -0800 (Tue, 03 Feb 2015) | 29 lines

DebugInfo: Ensure calls to functions with default arguments which themselves have default arguments, still have locations.

To handle default arguments in C++ in the debug info, we disable code
updating the debug location during the emission of default arguments.

This code was buggy in the case of default arguments which, themselves,
have default arguments - the inner default argument would re-enable
debug info when it was finished, but before the outer default argument
was finished.

This was already a bug, but got worse (because a crasher instead of just
a quality bug) with the recent improvements to debug info line quality
because... The ApplyDebugLocation scoped device would find the debug
info disabled and not save any debug location. But then in
~ApplyDebugLocation it would find the debug info had been enabled and
would then apply the no-location. Then the outer function call would be
emitted without any location. That's bad.

Arguably we could /also/ fix the ApplyDebugLocation to assert on this
situation (where debug info was disabled in the ctor and enabled in the
dtor, or the other way around) but this is at least the necessary fix
regardless.

(also, I imagine this disabling behavior might need to be in-place for
CGExprComplex and CGExprAgg too, maybe... ?)

And I seem to recall seeing some weird default arg stepping behavior
recently which might be related to this too... I'll have to look into
it.
------------------------------------------------------------------------

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

9 years agoMerging r226384:
Hans Wennborg [Tue, 3 Feb 2015 23:58:19 +0000 (23:58 +0000)]
Merging r226384:
------------------------------------------------------------------------
r226384 | dblaikie | 2015-01-17 16:37:04 -0800 (Sat, 17 Jan 2015) | 1 line

Refactor test so it's not lazily emitted on a global, simplifying ordering when more test cases are added
------------------------------------------------------------------------

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

9 years agoMerging r227979:
Hans Wennborg [Tue, 3 Feb 2015 22:57:34 +0000 (22:57 +0000)]
Merging r227979:
------------------------------------------------------------------------
r227979 | rafael | 2015-02-03 08:33:53 -0800 (Tue, 03 Feb 2015) | 3 lines

Use CLANG_LIBDIR_SUFFIX when looking for the gold plugin.

Patch by ?\196?\176smail D?\195?\182nmez!
------------------------------------------------------------------------

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

9 years agoMerging r226382:
Hans Wennborg [Mon, 2 Feb 2015 21:02:01 +0000 (21:02 +0000)]
Merging r226382:
------------------------------------------------------------------------
r226382 | dblaikie | 2015-01-17 16:12:58 -0800 (Sat, 17 Jan 2015) | 7 lines

DebugInfo: Correct the debug location of non-static data member initializers

This was causing some trouble for otherwise dead code removed in r225085
(reverted in r225361). The location being set for function arguments was
leaking out to the call which wasn't setting its own location (so a
quality bug turned into a crasher with r225085). Fix this so r225085 can
be recommitted.
------------------------------------------------------------------------

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

9 years agoMerging r227393:
Hans Wennborg [Wed, 28 Jan 2015 23:52:21 +0000 (23:52 +0000)]
Merging r227393:
------------------------------------------------------------------------
r227393 | joerg | 2015-01-28 15:30:39 -0800 (Wed, 28 Jan 2015) | 5 lines

For the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.
Those used the old Big Endian support on ARM and don't need flags.
Refactor the logic in a separate common function, which also looks at
-march. Add corresponding logic for the Linux toolchain.

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

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

9 years agoMerging r227088:
Hans Wennborg [Wed, 28 Jan 2015 23:49:42 +0000 (23:49 +0000)]
Merging r227088:
------------------------------------------------------------------------
r227088 | joerg | 2015-01-26 04:30:16 -0800 (Mon, 26 Jan 2015) | 3 lines

For NetBSD/ARM-EB, link with --be8. Support for the older BE32 is
currently not planned.

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

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

9 years agoMerging r227368:
Hans Wennborg [Wed, 28 Jan 2015 21:59:15 +0000 (21:59 +0000)]
Merging r227368:
------------------------------------------------------------------------
r227368 | rikka | 2015-01-28 13:10:46 -0800 (Wed, 28 Jan 2015) | 9 lines

Revert a change from r222797 that is no longer needed and can cause
infinite recursion.

Also guard against said infinite recursion by adding an assert that will
trigger if CorrectDelayedTyposInExpr is called before a previous call to
CorrectDelayedTyposInExpr returns (i.e. if the TreeTransform run by
CorrectDelayedTyposInExpr calls a sequence of methods that
end up calling CorrectDelayedTyposInExpr, as the new test case had done
prior to this commit). Fixes PR22292.
------------------------------------------------------------------------

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

9 years agoMerging r227295:
Hans Wennborg [Wed, 28 Jan 2015 19:18:37 +0000 (19:18 +0000)]
Merging r227295:
------------------------------------------------------------------------
r227295 | majnemer | 2015-01-27 21:48:06 -0800 (Tue, 27 Jan 2015) | 5 lines

Sema: Ensure that __c11_atomic_fetch_add has a pointer to complete type

Pointer arithmetic is only makes sense if the pointee type is complete.

This fixes PR22361.
------------------------------------------------------------------------

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

9 years agoMerging r227278:
Hans Wennborg [Wed, 28 Jan 2015 01:08:23 +0000 (01:08 +0000)]
Merging r227278:
------------------------------------------------------------------------
r227278 | rikka | 2015-01-27 16:46:09 -0800 (Tue, 27 Jan 2015) | 6 lines

Use the real CXXScopeSpec when setting the correction SourceRange.

Otherwise, in the most important case and the only case where SS and
TempSS are different (which is when the CXXScopeSpec should be dropped,
and TempSS is NULL) the wrong SourceRange will be used in the fixit for
the typo correction. Fixes the remaining issue in PR20626.
------------------------------------------------------------------------

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

9 years agoMerging r227251:
Hans Wennborg [Tue, 27 Jan 2015 23:12:34 +0000 (23:12 +0000)]
Merging r227251:
------------------------------------------------------------------------
r227251 | rikka | 2015-01-27 14:01:39 -0800 (Tue, 27 Jan 2015) | 17 lines

Fix a think-o in handling ambiguous corrections for a TypoExpr.

Under certain circumstances, the identifier mentioned in the diagnostic
won't match the intended correction even though the replacement
expression and the note pointing to the decl are both correct.
Basically, the TreeTransform assumes the TypoExpr's Consumer points to
the correct TypoCorrection, but the handling of typos that appear to be
ambiguous from the point of view of TransformTypoExpr would cause that
assumption to be violated by altering the Consumer's correction stream.
This fix allows the Consumer's correction stream to be reset to the
right TypoCorrection after successfully resolving the percieved ambiguity.

Included is a fix to suppress correcting the RHS of an assignment to the
LHS of that assignment for non-C++ code, to prevent a regression in
test/SemaObjC/provisional-ivar-lookup.m.

This fixes PR22297.
------------------------------------------------------------------------

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

9 years agoMerging r227220:
Hans Wennborg [Tue, 27 Jan 2015 20:53:43 +0000 (20:53 +0000)]
Merging r227220:
------------------------------------------------------------------------
r227220 | rikka | 2015-01-27 10:26:18 -0800 (Tue, 27 Jan 2015) | 7 lines

Properly handle typos in the conditional of ?: expressions in C.

In particular, remove the OpaqueExpr transformation from r225389 and
move the correction of the conditional from CheckConditionalOperands to
ActOnConditionalOp before the OpaqueExpr is created. This fixes the
typo correction behavior in C code that uses the GNU extension for a
binary ?: (without an expression between the "?" and the ":").
------------------------------------------------------------------------

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

9 years agoMerging r227062:
Hans Wennborg [Mon, 26 Jan 2015 23:17:18 +0000 (23:17 +0000)]
Merging r227062:
------------------------------------------------------------------------
r227062 | rengolin | 2015-01-25 15:17:48 -0800 (Sun, 25 Jan 2015) | 10 lines

Allows Clang to use LLVM's fixes-x18 option

This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.

This uses llvm r226664 to allow this register to be reserved.

Patch by Andrew Turner.
------------------------------------------------------------------------

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

9 years agoMerge r227127 doc link fix into 36 release branch
Reid Kleckner [Mon, 26 Jan 2015 19:56:36 +0000 (19:56 +0000)]
Merge r227127 doc link fix into 36 release branch

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

9 years agoMerging r226863:
Hans Wennborg [Fri, 23 Jan 2015 17:17:04 +0000 (17:17 +0000)]
Merging r226863:
------------------------------------------------------------------------
r226863 | joerg | 2015-01-22 13:01:00 -0800 (Thu, 22 Jan 2015) | 3 lines

When reporting constraints that should be constant, the type doesn't
really help. Improve diagnostics.

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

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

9 years agoMerging r226877:
Hans Wennborg [Fri, 23 Jan 2015 02:24:17 +0000 (02:24 +0000)]
Merging r226877:
------------------------------------------------------------------------
r226877 | atanasyan | 2015-01-22 15:16:48 -0800 (Thu, 22 Jan 2015) | 3 lines

[Mips] Fix type of 64-bit integer in case of MIPS N64 ABI

Differential Revision: http://reviews.llvm.org/D7127
------------------------------------------------------------------------

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

9 years agoMerging r226707:
Hans Wennborg [Thu, 22 Jan 2015 19:38:14 +0000 (19:38 +0000)]
Merging r226707:
------------------------------------------------------------------------
r226707 | rnk | 2015-01-21 14:18:17 -0800 (Wed, 21 Jan 2015) | 13 lines

Add the "thunk" attribute to MS ABI virtual member pointers

This attribute implies indicates that the function musttail calls
another function and returns whatever it returns. The return type of the
thunk is meaningless, as the thunk can dynamically call different
functions with different return types. So long as the callers bitcast
the thunk with the correct type, behavior is well defined.

This attribute was necessary to fix PR20944, where the indirect call
combiner noticed that the thunk returned void and replaced the results
of the indirect call instruction with undef.

Over-the-shoulder reviewed by David Majnemer.
------------------------------------------------------------------------

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

9 years agoMerging r226754:
Hans Wennborg [Thu, 22 Jan 2015 16:44:22 +0000 (16:44 +0000)]
Merging r226754:
------------------------------------------------------------------------
r226754 | hans | 2015-01-21 16:45:20 -0800 (Wed, 21 Jan 2015) | 9 lines

Fix compiler_builtins.m test to not rely on including system stdlib.h and malloc.h

Importing _Builtin_intrinsics.sse and avx would transitively pull in those
headers, and the test would fail when building in an environment where
they were not available on the include path.

This fixes PR20995 for me.

Differential Revision: http://reviews.llvm.org/D7112
------------------------------------------------------------------------

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

9 years agoRevert r225705 from the branch.
Rafael Espindola [Wed, 21 Jan 2015 20:37:18 +0000 (20:37 +0000)]
Revert r225705 from the branch.

There were a few followup commits to this one, but only this one made it to
the branch.

Also, there are still some open issues (pr22285), so it is probably better
to leave this out of 3.6.

original message:

--------------------------------------------------------------------------
[patch][pr19848] Produce explicit comdats in clang.

The llvm IR until recently had no support for comdats. This was a problem when
targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of
dead bits to remain on the executable (unless -ffunction-sections,
-fdata-sections and --gc-sections were used).

To fix the problem, llvm's codegen will just assume that any weak or linkonce
that is not in an explicit comdat should be output in one with the same name as
the global.

This unfortunately breaks cases like pr19848 where a weak symbol is not
xpected to be part of any comdat.

Now that we have explicit comdats in the IR, we can finally get both cases
right.

This first patch just makes clang give explicit comdats to GlobalValues where
t is allowed to.

A followup patch to llvm will then stop implicitly producing comdats.
------------------------------------------------------------------------

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

9 years agoAdd some ReleaseNote items from Nico
Hans Wennborg [Wed, 21 Jan 2015 19:43:19 +0000 (19:43 +0000)]
Add some ReleaseNote items from Nico

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

9 years agoAdd some items to the 3.6 release notes.
Rafael Espindola [Wed, 21 Jan 2015 19:13:26 +0000 (19:13 +0000)]
Add some items to the 3.6 release notes.

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

9 years agoMerging r226624:
Hans Wennborg [Wed, 21 Jan 2015 01:49:01 +0000 (01:49 +0000)]
Merging r226624:
------------------------------------------------------------------------
r226624 | rikka | 2015-01-20 16:04:19 -0800 (Tue, 20 Jan 2015) | 6 lines

Correct all typos in the initialization arguments, even if one could not
be corrected.

This fixes PR22250, which exposed the bug where if there's more than one
TypoExpr in the arguments, once one failed to be corrected none of the
TypoExprs after it would be handled at all thanks to an early return.
------------------------------------------------------------------------

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

9 years agoRevert "r222906 - Create a new 'flag_enum' attribute."
Hans Wennborg [Tue, 20 Jan 2015 19:27:49 +0000 (19:27 +0000)]
Revert "r222906 - Create a new 'flag_enum' attribute."

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

9 years agoMerging r226282:
Hans Wennborg [Fri, 16 Jan 2015 17:59:14 +0000 (17:59 +0000)]
Merging r226282:
------------------------------------------------------------------------
r226282 | alexfh | 2015-01-16 07:57:15 -0800 (Fri, 16 Jan 2015) | 2 lines

Attempt to fix the build with XCode 5.0.2 (and probably 5.1.1).

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

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

9 years agoMerging r226136:
Daniel Sanders [Fri, 16 Jan 2015 08:53:53 +0000 (08:53 +0000)]
Merging r226136:
------------------------------------------------------------------------
r226136 | atanasyan | 2015-01-15 07:04:48 +0000 (Thu, 15 Jan 2015) | 1 line

[Mips] Define macros `__mips_isa_rev` in case of mips32r6/mips64r6 options
------------------------------------------------------------------------

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

9 years agoMerging r226049:
Duncan P. N. Exon Smith [Thu, 15 Jan 2015 04:03:26 +0000 (04:03 +0000)]
Merging r226049:
------------------------------------------------------------------------
r226049 | dexonsmith | 2015-01-14 14:28:03 -0800 (Wed, 14 Jan 2015) | 3 lines

IR: Move MDLocation into place (clang testcases)

Update testcases to match LLVM change in r226048.
------------------------------------------------------------------------

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

9 years agoMerging r226008:
Hans Wennborg [Wed, 14 Jan 2015 22:31:21 +0000 (22:31 +0000)]
Merging r226008:
------------------------------------------------------------------------
r226008 | hans | 2015-01-14 10:14:00 -0800 (Wed, 14 Jan 2015) | 1 line

Update cxx_dr_status.html after 3.6 branch
------------------------------------------------------------------------

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

9 years agoCreating release_36 branch off revision 225991
Hans Wennborg [Wed, 14 Jan 2015 16:41:45 +0000 (16:41 +0000)]
Creating release_36 branch off revision 225991

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

9 years agoclang-format: Disable flag for Google's Java and Javascript styles.
Daniel Jasper [Wed, 14 Jan 2015 12:24:59 +0000 (12:24 +0000)]
clang-format: Disable flag for Google's Java and Javascript styles.

Disable AlwaysBreakBeforeMultilineString, as the style guides don't
really say to do so.

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

9 years ago[mips] Handle transparent unions correctly.
Daniel Sanders [Wed, 14 Jan 2015 12:00:12 +0000 (12:00 +0000)]
[mips] Handle transparent unions correctly.

Summary:
This fixes MultiSource/Applications/lemon on big-endian N32 by correcting the
handling of the argument to wait(). glibc defines it as a transparent union of
void* and int*. Such unions are passed according to the rules of the first
member so the argument must be passed as if it were a void* (sign extended from
i32 to i64) and not as a union (shifted to the upper bits of an i64).

wait() already behaves correctly on big-endian O32 and N64 since the union is
already the same size as an argument slot.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

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

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

9 years ago[cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py
Chandler Carruth [Wed, 14 Jan 2015 11:29:14 +0000 (11:29 +0000)]
[cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py

Sorry for the noise, I managed to miss a bunch of recent regressions of
include orderings here. This should actually sort all the includes for
Clang. Again, no functionality changed, this is just a mechanical
cleanup that I try to run periodically to keep the #include lines as
regular as possible across the project.

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

9 years ago[cleanup] Re-sort the #include lines using llvm/utils/sort_includes.py
Chandler Carruth [Wed, 14 Jan 2015 11:23:58 +0000 (11:23 +0000)]
[cleanup] Re-sort the #include lines using llvm/utils/sort_includes.py

No functionality changed, this is a purely mechanical cleanup to ensure
the #include order remains consistent across the project.

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

9 years agoclang-format: [Java] Support try blocks with resources.
Daniel Jasper [Wed, 14 Jan 2015 10:48:41 +0000 (10:48 +0000)]
clang-format: [Java] Support try blocks with resources.

Before:
  try
    (SomeResource rs = someFunction()) {
      Something();
    }

After:
  try (SomeResource rs = someFunction()) {
    Something();
  }

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

9 years agoclang-format: [Java] Prefer not to break in parameter annotations.
Daniel Jasper [Wed, 14 Jan 2015 10:36:31 +0000 (10:36 +0000)]
clang-format: [Java] Prefer not to break in parameter annotations.

Before:
  boolean someFunction(@Param(aaaaaaaaaaaaaaaa)
                       String aaaaa,
      String bbbbbbbbbbbbbbb) {}

After:
  boolean someFunction(
      @Param(aaaaaaaaaaaaaaaa) String aaaaa,
      String bbbbbbbbbbbbbbb) {}

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

9 years agoclang-format: [Java] Understand "import static".
Daniel Jasper [Wed, 14 Jan 2015 10:02:49 +0000 (10:02 +0000)]
clang-format: [Java] Understand "import static".

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

9 years agoclang-format: [Java] Don't let annotations confuse return type analysis.
Daniel Jasper [Wed, 14 Jan 2015 10:00:20 +0000 (10:00 +0000)]
clang-format: [Java] Don't let annotations confuse return type analysis.

Before:
  @Test
  ReturnType
  doSomething(String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}

After:
  @Test
  ReturnType doSomething(
      String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}

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

9 years agoclang-format: [Java] Don't line-wrap before annotations' l_parens.
Daniel Jasper [Wed, 14 Jan 2015 09:51:32 +0000 (09:51 +0000)]
clang-format: [Java] Don't line-wrap before annotations' l_parens.

Before:
  @SomeAnnotation
  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
  int i;

After:
  @SomeAnnotation(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
  int i;

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

9 years agoclang-format: [Java] Don't get confused by leading annotations.
Daniel Jasper [Wed, 14 Jan 2015 09:47:57 +0000 (09:47 +0000)]
clang-format: [Java] Don't get confused by leading annotations.

Before:
  @Test(a)
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa);

After:
  @Test(a)
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa);

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

9 years agoThe assembler is now enabled by default.
Brad Smith [Wed, 14 Jan 2015 08:23:49 +0000 (08:23 +0000)]
The assembler is now enabled by default.

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

9 years agoSema: It's cheaper to ask LookupResult::empty than to calculate linkage
David Majnemer [Wed, 14 Jan 2015 08:08:52 +0000 (08:08 +0000)]
Sema: It's cheaper to ask LookupResult::empty than to calculate linkage

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

9 years agoUse the integrated assembler by default on 32-bit PowerPC and SPARC.
Brad Smith [Wed, 14 Jan 2015 07:55:36 +0000 (07:55 +0000)]
Use the integrated assembler by default on 32-bit PowerPC and SPARC.

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

9 years agoReapply r225000 (reverted in r225555): DebugInfo: Generalize debug info location...
David Blaikie [Wed, 14 Jan 2015 07:38:27 +0000 (07:38 +0000)]
Reapply r225000 (reverted in r225555): DebugInfo: Generalize debug info location handling (and follow-up commits).

Several pieces of code were relying on implicit debug location setting
which usually lead to incorrect line information anyway. So I've fixed
those (in r225955 and r225845) separately which should pave the way for
this commit to be cleanly reapplied.

The reason these implicit dependencies resulted in crashes with this
patch is that the debug location would no longer implicitly leak from
one place to another, but be set back to invalid. Once a call with
no/invalid location was emitted, if that call was ever inlined it could
produce invalid debugloc chains and assert during LLVM's codegen.

There may be further cases of such bugs in this patch - they're hard to
flush out with regression testing, so I'll keep an eye out for reports
and investigate/fix them ASAP if they come up.

Original commit message:

Reapply "DebugInfo: Generalize debug info location handling"

Originally committed in r224385 and reverted in r224441 due to concerns
this change might've introduced a crash. Turns out this change fixes the
crash introduced by one of my earlier more specific location handling
changes (those specific fixes are reverted by this patch, in favor of
the more general solution).

Recommitted in r224941 and reverted in r224970 after it caused a crash
when building compiler-rt. Looks to be due to this change zeroing out
the debug location when emitting default arguments (which were meant to
inherit their outer expression's location) thus creating call
instructions without locations - these create problems for inlining and
must not be created. That is fixed and tested in this version of the
change.

Original commit message:

This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.

This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.

I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.

Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.

I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.

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

9 years agoDebugInof: Correct the location of exception cleanups in global ctors/dtors and ObjC...
David Blaikie [Wed, 14 Jan 2015 07:10:46 +0000 (07:10 +0000)]
DebugInof: Correct the location of exception cleanups in global ctors/dtors and ObjC methods

Without setting the CurEHLocation these cleanups would be attributed to
whatever the last active debug line location was (the 'fn' call in the
included test cases). By setting CurEHLocation correctly the line
information is improved/corrected.

This quality bug turned into a crasher with r225000 when, instead of
allowing the last location to persist, it would be zero'd out. This
could lead to a function call (such as the dtor) being made without a
debug location - if that call was subsequently inlined (and the caller
and callee had debug info, just not the call instruction) the inliner
would violate important constraints about the debug location chains by
not updating the inlined instructions to chain up to the callee
locations.

So, by fixing this bug, I am addressing the assertion failures
introduced by r225000 and should be able to recommit that patch with
impunity...

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

9 years agoRevert "Insert random noops to increase security against ROP attacks (clang)"
JF Bastien [Wed, 14 Jan 2015 05:24:11 +0000 (05:24 +0000)]
Revert "Insert random noops to increase security against ROP attacks (clang)"

This reverts commit:
http://reviews.llvm.org/D3393

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

9 years agoSema: Relax parsing of '#' in constraints
David Majnemer [Wed, 14 Jan 2015 05:11:09 +0000 (05:11 +0000)]
Sema: Relax parsing of '#' in constraints

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

9 years agoSema: Check type compatibility with the most recent decl when merging
David Majnemer [Wed, 14 Jan 2015 02:27:38 +0000 (02:27 +0000)]
Sema: Check type compatibility with the most recent decl when merging

We would check the type information from the declaration found by lookup
but we would neglect checking compatibility with the most recent
declaration.  This would make it possible for us to not correctly
diagnose inconsistencies with declarations which were made in a
different scope.

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

9 years ago[AVX512] Add FP unpack intrinsics
Adam Nemet [Wed, 14 Jan 2015 01:31:17 +0000 (01:31 +0000)]
[AVX512] Add FP unpack intrinsics

These are implemented with __builtin_shufflevector just like AVX.

We have some tests on the LLVM side to assert that these shufflevectors do
indeed generate the corresponding unpck instruction.

Part of <rdar://problem/17688758>

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

9 years agoInsert random noops to increase security against ROP attacks (clang)
JF Bastien [Wed, 14 Jan 2015 01:07:51 +0000 (01:07 +0000)]
Insert random noops to increase security against ROP attacks (clang)

A pass that adds random noops to X86 binaries to introduce diversity with the goal of increasing security against most return-oriented programming attacks.

Command line options:
  -noop-insertion // Enable noop insertion.
  -noop-insertion-percentage=X // X% of assembly instructions will have a noop prepended (default: 50%, requires -noop-insertion)
  -max-noops-per-instruction=X // Randomly generate X noops per instruction. ie. roll the dice X times with probability set above (default: 1). This doesn't guarantee X noop instructions.

In addition, the following 'quick switch' in clang enables basic diversity using default settings (currently: noop insertion and schedule randomization; it is intended to be extended in the future).
  -fdiversify

This is the clang part of the patch.
llvm part: D3392

http://reviews.llvm.org/D3393
Patch by Stephen Crane (@rinon)

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

9 years agoUpdate HelpText for -fsanitize= option.
Alexey Samsonov [Wed, 14 Jan 2015 00:51:17 +0000 (00:51 +0000)]
Update HelpText for -fsanitize= option.

There are too many available sanitizers now - redirect to
user manual instead of listing them all.

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

9 years agoUpdate for move in llvm.
Eric Christopher [Wed, 14 Jan 2015 00:50:32 +0000 (00:50 +0000)]
Update for move in llvm.

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

9 years agoLook through sugar when determining whether a type is a scoped enumeration
Richard Smith [Wed, 14 Jan 2015 00:33:10 +0000 (00:33 +0000)]
Look through sugar when determining whether a type is a scoped enumeration
type. Patch by Stephan Bergmann!

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

9 years agoSema: An extern declaration can't be a redeclaration of a parameter
David Majnemer [Wed, 14 Jan 2015 00:31:13 +0000 (00:31 +0000)]
Sema: An extern declaration can't be a redeclaration of a parameter

In the following:
void f(int x) { extern int x; }

The second declaration of 'x' shouldn't be considered a redeclaration of
the parameter.

This is a different approach to r225780.

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

9 years agoSink a parameter into the callee since it's always the same expression in terms of...
David Blaikie [Wed, 14 Jan 2015 00:04:42 +0000 (00:04 +0000)]
Sink a parameter into the callee since it's always the same expression in terms of another parameter

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

9 years agoDebugInfo: Correct the location of EH cleanup for blocks
David Blaikie [Tue, 13 Jan 2015 23:06:27 +0000 (23:06 +0000)]
DebugInfo: Correct the location of EH cleanup for blocks

This was previously piggybacking on whatever happened to be the last
location set on CGDebugInfo/DIBuilder, which was wrong (it was often the
current location, such as the 'fn()' call site, not the end of the
block). With my improvements to set/unset the location in a scoped
manner (r225000) this went from a bad quality situation, to a crash.
Fixing this goes part-way to unblocking the recommit of r225000.

It's likely that any call to CodeGenFunction::StartFunction without the
CurEHLocation set represents a similar bug or risk of a bug. Perhaps
there are some callers that know they won't generate EH cleanups, but
I'm not sure.

I considered a generic catch-fix in StartFunction (just fallback to the
GlobalDecl's location) but that seemed like it'd mask bugs where the EH
location shouldn't be the same as the decl's location (& indeed by not
using that stop-gap I found this bug). We'll see how long I can hold out
on the generic catch-all. I might eventually be able to add an assertion
in.

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

9 years agoclang-format: [Java] Detect `native` keyword.
Nico Weber [Tue, 13 Jan 2015 22:32:50 +0000 (22:32 +0000)]
clang-format: [Java] Detect `native` keyword.

Before:
  public native<X> Foo foo();

After:
  public native <X> Foo foo();

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

9 years agoAdd [extern_c] attribute to _Builtin_intrinsics module
Ben Langmuir [Tue, 13 Jan 2015 21:54:32 +0000 (21:54 +0000)]
Add [extern_c] attribute to _Builtin_intrinsics module

This allows users to import this module inside an extern "C" {} block.

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

9 years agoMention FreeBSD support.
Roman Divacky [Tue, 13 Jan 2015 21:31:03 +0000 (21:31 +0000)]
Mention FreeBSD support.

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

9 years agoWhen attribute 'optnone' appears on the same declaration with a
Paul Robinson [Tue, 13 Jan 2015 18:34:56 +0000 (18:34 +0000)]
When attribute 'optnone' appears on the same declaration with a
conflicting attribute, warn about the conflict and pick a "winning"
attribute to preserve, instead of emitting an error.  This matches the
behavior when the conflicting attributes are on different declarations.

Along the way I discovered that conflicts involving __forceinline were
reported as 'always_inline' (alternate spelling, same attribute) so
fixed that up to report the attribute as spelled in the source.

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

9 years agoInherit attributes when infering a framework module
Ben Langmuir [Tue, 13 Jan 2015 17:47:44 +0000 (17:47 +0000)]
Inherit attributes when infering a framework module

If a module map contains
framework module * [extern_c] {}

We will now infer [extern_c] on the inferred framework modules (we
already inferred [system] as a special case).

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

9 years agoHandle [extern_c] attribute in module printer
Ben Langmuir [Tue, 13 Jan 2015 17:47:38 +0000 (17:47 +0000)]
Handle [extern_c] attribute in module printer

I'm not sure why we have OS.indent(Indent+2) for the system attribute,
but presumably we want the same behaviour for all attributes...

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

9 years agoRemove unused method canInferFrameworkModule
Ben Langmuir [Tue, 13 Jan 2015 17:47:29 +0000 (17:47 +0000)]
Remove unused method canInferFrameworkModule

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

9 years ago[mips] Fix va_arg() for pointer types on big-endian N32.
Daniel Sanders [Tue, 13 Jan 2015 10:47:00 +0000 (10:47 +0000)]
[mips] Fix va_arg() for pointer types on big-endian N32.

Summary:
The Mips ABI's treat pointers in the same way as integers. They are
sign-extended to 32-bit for O32, and 64-bit for N32/N64. This doesn't matter
for O32 and N64 where pointers are already the correct width but it does matter
for big-endian N32, where pointers are 32-bit and need promoting.

The caller side is already passing pointers correctly. This patch corrects the
callee.

Reviewers: vmedic, atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

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

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

9 years agoRevert "Sema: An extern declaration can't be a redeclaration of a parameter"
David Majnemer [Tue, 13 Jan 2015 10:14:57 +0000 (10:14 +0000)]
Revert "Sema: An extern declaration can't be a redeclaration of a parameter"

This reverts commit r225780, we can't compile line 181 in
sanitizer_platform_limits_posix.cc with this commit.

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