]> granicus.if.org Git - clang/log
clang
10 years agoFix PR18498: Support explicit template arguments with variadic generic lambdas
Faisal Vali [Sun, 1 Jun 2014 16:11:54 +0000 (16:11 +0000)]
Fix PR18498: Support explicit template arguments with variadic generic lambdas

http://llvm.org/bugs/show_bug.cgi?id=18498

This code was resulting in a crash:

auto L = [](auto ... v) { };
L.operator()<int>(3);

The reason is that the partially-substituted-pack is incorrectly retained within the current-instantiation-scope during template-argument-finalization, and because lambda's are local, there parent instantiation scopes are merged, which leads to the expansion-pattern being retained in the finalized specialization.

This patch ensures that once we have finalized deduction of a parameter-pack, we remove the partially-substituted-pack so that it doesn't cause CheckParameterPacksForExpansion to incorrectly inform the caller that it needs to retain the expansion pattern.

Thanks to Richard Smith for the review!

http://reviews.llvm.org/D2135

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

10 years agoTest fixes and improvements.
Rafael Espindola [Sun, 1 Jun 2014 13:45:09 +0000 (13:45 +0000)]
Test fixes and improvements.

Remove redundant -fno-stack-protector run with openbsd.
Add -target to the -fstack-protector tests so they pass on openbsd.

Patch by Brad Smith.

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

10 years agoDon't add examples to the check-clang dependencies unless requested
Alp Toker [Sun, 1 Jun 2014 02:02:23 +0000 (02:02 +0000)]
Don't add examples to the check-clang dependencies unless requested

The tests were correctly getting skipped but the targets still mistakenly got
built.

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

10 years agoPreprocessor: make C++ operator names as macro identifiers a compatible extension
Alp Toker [Sat, 31 May 2014 16:32:22 +0000 (16:32 +0000)]
Preprocessor: make C++ operator names as macro identifiers a compatible extension

With recent changes, this is now a compatible language extension and can be
safely enabled with -ms-extensions instead of requiring the full
-ms-compatibility MSVC drop-in mode. As such we can now also emit an extension
warning under -Wmicrosoft to help users port their code.

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

10 years agoFix test on platforms where size_t is not 'unsigned long'.
Benjamin Kramer [Sat, 31 May 2014 15:06:33 +0000 (15:06 +0000)]
Fix test on platforms where size_t is not 'unsigned long'.

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

10 years agoSupport C++11 scoped enums in NamedDecl::isCXXClassMember()
Alp Toker [Sat, 31 May 2014 06:11:09 +0000 (06:11 +0000)]
Support C++11 scoped enums in NamedDecl::isCXXClassMember()

Resolves an old FIXME.

No callers depend on this giving the right answer so I haven't been able to
cook up a useful test case.

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

10 years agoRename utility function templates
Alp Toker [Sat, 31 May 2014 06:11:02 +0000 (06:11 +0000)]
Rename utility function templates

isExternCTemplate() and getLanguageLinkageTemplate() have nothing to do with
templates despite the dubious naming scheme.

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

10 years agoFormat strings: check against an enum's underlying type.
Jordan Rose [Sat, 31 May 2014 04:12:14 +0000 (04:12 +0000)]
Format strings: check against an enum's underlying type.

This allows us to be more careful when dealing with enums whose fixed
underlying type requires special handling in a format string, like
NSInteger.

A refinement of r163266 from a year and a half ago, which added the
special handling for NSInteger and friends in the first place.

<rdar://problem/16616623>

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

10 years agoAST Dump: print the Inherited flag on attributes
Hans Wennborg [Sat, 31 May 2014 04:05:57 +0000 (04:05 +0000)]
AST Dump: print the Inherited flag on attributes

Also move the attribute-specific dumping to after dumping this and
the Implicit flag.

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

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

10 years agoPreprocessor: recover gracefully when C++ operator names are used as macro identifiers
Alp Toker [Sat, 31 May 2014 03:38:17 +0000 (03:38 +0000)]
Preprocessor: recover gracefully when C++ operator names are used as macro identifiers

This failure mode shows up occasionally when users try to include C headers in
C++ projects or when porting from Windows. We might as well recover in the way
the user expected, thus avoiding confusing diagnostic messages at point of use.

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

10 years agoPreprocessor: don't exit early in CheckMacroName()
Alp Toker [Sat, 31 May 2014 03:38:08 +0000 (03:38 +0000)]
Preprocessor: don't exit early in CheckMacroName()

The checks below can hypothetically apply to converted operator name
identifiers.

In practice there are no builtin macros etc. with those names so there's no
behavioural change to test.

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

10 years agoThere is no std::errc:success, remove the llvm one.
Rafael Espindola [Sat, 31 May 2014 03:20:52 +0000 (03:20 +0000)]
There is no std::errc:success, remove the llvm one.

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

10 years agoUse make_error_code in preparation for making errc an enum class.
Rafael Espindola [Sat, 31 May 2014 02:23:01 +0000 (02:23 +0000)]
Use make_error_code in preparation for making errc an enum class.

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

10 years agoPR12961 - Extend DR532 to cover C++98/03.
Nikola Smiljanic [Sat, 31 May 2014 02:10:59 +0000 (02:10 +0000)]
PR12961 - Extend DR532 to cover C++98/03.

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

10 years agoDiagnose dll attribute on member of class that already has a dll attribute
Hans Wennborg [Sat, 31 May 2014 02:08:49 +0000 (02:08 +0000)]
Diagnose dll attribute on member of class that already has a dll attribute

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

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

10 years agoMake Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags
Hans Wennborg [Sat, 31 May 2014 01:30:30 +0000 (01:30 +0000)]
Make Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags

I was bitten by this when working with the dll attributes: when a dll
attribute was cloned from a class template declaration to its
specialization, the Inherited flag didn't get cloned.

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

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

10 years agoUse error_code() instead of error_code::succes()
Rafael Espindola [Sat, 31 May 2014 01:26:30 +0000 (01:26 +0000)]
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

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

10 years ago[CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing {extract...
Michael J. Spencer [Sat, 31 May 2014 00:22:12 +0000 (00:22 +0000)]
[CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing {extract,insert} vector element instructions.

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

10 years agoRefactor: use the DeclarationNameInfo form of BuildMemberReferenceExpr
Richard Smith [Sat, 31 May 2014 00:18:32 +0000 (00:18 +0000)]
Refactor: use the DeclarationNameInfo form of BuildMemberReferenceExpr
consistently, rather than sometimes performing lookup and calling the
LookupResult form. No functionality change intended.

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

10 years agocc1as: invert return bool to indicate failure
Alp Toker [Sat, 31 May 2014 00:02:27 +0000 (00:02 +0000)]
cc1as: invert return bool to indicate failure

This simplifies code flow and matches the convention used in surrounding code.

No functional change.

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

10 years agocc1as: fix a potential leak and unremoved output file in error conditions
Alp Toker [Sat, 31 May 2014 00:02:21 +0000 (00:02 +0000)]
cc1as: fix a potential leak and unremoved output file in error conditions

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

10 years agoTake PrintingPolicy::SuppressUnwrittenScope into account when printing the
Richard Smith [Fri, 30 May 2014 22:16:51 +0000 (22:16 +0000)]
Take PrintingPolicy::SuppressUnwrittenScope into account when printing the
qualified name of a NamedDecl. Patch by Volodymyr Sapsai!

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

10 years agoInvalidate the file system cache entries for files that may rebuild
Ben Langmuir [Fri, 30 May 2014 21:20:54 +0000 (21:20 +0000)]
Invalidate the file system cache entries for files that may rebuild

This reapplies r209910 with a fix for the assertion failures hit on the
buildbots.

original commit message:
I thought we could get away without this, but it means that the
FileEntry objects actually refer to the wrong files, since pcms are not
updated inplace, they are atomically renamed into place after compiling
a module.

So we are close to the original behaviour of invalidating the cache for
all modules being removed, but now we should only invalidate the ones
that depend on whichever module failed to load.

Unfortunately I haven't come up with a new test that didn't require
a race between parallel invocations of clang.

<rdar://problem/17038180>

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

10 years agoRemove unused struct from test
Alp Toker [Fri, 30 May 2014 21:07:40 +0000 (21:07 +0000)]
Remove unused struct from test

This presumably got inadvertently copied from dllimport-members.cpp.

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

10 years agoAdd a FIXME for a bug Doug pointed out in code review.
Richard Smith [Fri, 30 May 2014 19:44:17 +0000 (19:44 +0000)]
Add a FIXME for a bug Doug pointed out in code review.

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

10 years agoThread Safety Analysis: fix handling of string and char literals.
DeLesley Hutchins [Fri, 30 May 2014 18:20:04 +0000 (18:20 +0000)]
Thread Safety Analysis: fix handling of string and char literals.

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

10 years agoRevert "Invalidate the file system cache entries for files that may rebuild"
Ben Langmuir [Fri, 30 May 2014 17:54:59 +0000 (17:54 +0000)]
Revert "Invalidate the file system cache entries for files that may rebuild"

This reverts commit r209910, which is breaking some of the bots.

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

10 years agoInvalidate the file system cache entries for files that may rebuild
Ben Langmuir [Fri, 30 May 2014 17:42:15 +0000 (17:42 +0000)]
Invalidate the file system cache entries for files that may rebuild

I thought we could get away without this, but it means that the
FileEntry objects actually refer to the wrong files, since pcms are not
updated inplace, they are atomically renamed into place after compiling
a module.

So we are close to the original behaviour of invalidating the cache for
all modules being removed, but now we should only invalidate the ones
that depend on whichever module failed to load.

Unfortunately I haven't come up with a new test that didn't require
a race between parallel invocations of clang.

<rdar://problem/17038180>

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

10 years agoStart adding support for dllimport/dllexport on classes (PR11170)
Hans Wennborg [Fri, 30 May 2014 16:59:42 +0000 (16:59 +0000)]
Start adding support for dllimport/dllexport on classes (PR11170)

This implements the central part of support for dllimport/dllexport on
classes: allowing the attribute on class declarations, inheriting it
to class members, and forcing emission of exported members. It's based
on Nico Rieck's patch from http://reviews.llvm.org/D1099.

This patch doesn't propagate dllexport to bases that are template
specializations, which is an interesting problem. It also doesn't
look at the rules when redeclaring classes with different attributes,
I'd like to do that separately.

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

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

10 years agoObjective-C. Diagnose assigning a block pointer type to
Fariborz Jahanian [Fri, 30 May 2014 16:35:53 +0000 (16:35 +0000)]
Objective-C. Diagnose assigning a block pointer type to
an Objective-C object type other than 'id'.
// rdar://16739120

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

10 years agoThread Safety Analysis: fix uninitialized member in TIL Literal.
DeLesley Hutchins [Fri, 30 May 2014 15:55:25 +0000 (15:55 +0000)]
Thread Safety Analysis: fix uninitialized member in TIL Literal.

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

10 years agoAArch64: combine arm64 & aarch64 cases in switch
Tim Northover [Fri, 30 May 2014 14:14:07 +0000 (14:14 +0000)]
AArch64: combine arm64 & aarch64 cases in switch

There shouldn't be any difference in behaviour here, at least not in
any configurations people care about and possibly not in any reachable
configurations.

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

10 years agoRemove unnecessary test.
Diego Novillo [Fri, 30 May 2014 13:19:28 +0000 (13:19 +0000)]
Remove unnecessary test.

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

10 years agoThis test is no longer relevant. It is covered already by [basic.scope.pdecl]p10...
Aaron Ballman [Fri, 30 May 2014 13:17:17 +0000 (13:17 +0000)]
This test is no longer relevant. It is covered already by [basic.scope.pdecl]p10, and our current test for that is more thorough (though our test is named p9.cpp).

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

10 years agoThis test should no longer be XFAILed; the standard has stabilized, and the test...
Aaron Ballman [Fri, 30 May 2014 13:09:38 +0000 (13:09 +0000)]
This test should no longer be XFAILed; the standard has stabilized, and the test contents are acceptable. No diagnostics expected from this test.

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

10 years agoSetting a heading for the section/allocate attribute so that the attribute documentat...
Aaron Ballman [Fri, 30 May 2014 12:57:13 +0000 (12:57 +0000)]
Setting a heading for the section/allocate attribute so that the attribute documentation can be properly generated.

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

10 years agoclang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.
NAKAMURA Takumi [Fri, 30 May 2014 07:03:16 +0000 (07:03 +0000)]
clang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.

You could see unexpected result (*.tmp.err) with "-target x86_64-win32".

  Weverything-and-remarks.cpp:11:9: warning: 'char32_t' type specifier is incompatible with C++98 [-Wc++98-compat]
  typedef __char32_t char32_t;
          ^
  Weverything-and-remarks.cpp:12:27: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long')
  typedef long unsigned int size_t;
                            ^
  Weverything-and-remarks.cpp:19:62: warning: dynamic exception specifications are deprecated [-Wdeprecated]
    static void assign(char_type& __c1, const char_type& __c2) throw() {
                                                               ^~~~~~~
  Weverything-and-remarks.cpp:19:62: note: use 'noexcept' instead
    static void assign(char_type& __c1, const char_type& __c2) throw() {
                                                               ^~~~~~~
                                                               noexcept
  Weverything-and-remarks.cpp:25:46: warning: unused parameter '__n' [-Wunused-parameter]
                                        size_t __n) {
                                               ^
  3 warnings and 1 error generated.

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

10 years ago[OPENMP] Improve debug location codegen for OpenMP runtime library.
Alexey Bataev [Fri, 30 May 2014 05:48:40 +0000 (05:48 +0000)]
[OPENMP] Improve debug location codegen for OpenMP runtime library.

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

10 years agoFix 'this' capturing Generic lambdas used within default initializers (PR19876)
Faisal Vali [Fri, 30 May 2014 04:39:37 +0000 (04:39 +0000)]
Fix 'this' capturing Generic lambdas used within default initializers (PR19876)

http://llvm.org/bugs/show_bug.cgi?id=19876

The following C++1y code results in a crash:

struct X {
  int m = 10;
  int n = [this](auto) { return m; }(20);
};

When implicitly instantiating the generic lambda's call operator specialization body, Sema is unable to determine the current 'this' type when transforming the MemberExpr 'm' - since it looks for the nearest enclosing FunctionDeclDC - which is obviously null.

I considered two ways to fix this:

    1) In InstantiateFunctionDefinition, when the context is saved after the lambda scope info is created, retain the 'this' pointer.
    2) Teach getCurrentThisType() to recognize it is within a generic lambda within an NSDMI/default-initializer and return the appropriate this type.

I chose to implement #2 (though I confess I do not have a compelling reason for choosing it over #1).

Richard Smith accepted the patch:
http://reviews.llvm.org/D3935

Thank you!

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

10 years agoPR11410 - Confusing diagnostic when trailing array element tries to call deleted...
Nikola Smiljanic [Fri, 30 May 2014 01:28:28 +0000 (01:28 +0000)]
PR11410 - Confusing diagnostic when trailing array element tries to call deleted default constructor

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

10 years agoPR12214 - Warn on suspicious self-compound-assignments.
Nikola Smiljanic [Fri, 30 May 2014 00:15:04 +0000 (00:15 +0000)]
PR12214 - Warn on suspicious self-compound-assignments.

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

10 years agoPermit the "if" literal suffix with Microsoft extensions enabled.
Peter Collingbourne [Thu, 29 May 2014 23:10:15 +0000 (23:10 +0000)]
Permit the "if" literal suffix with Microsoft extensions enabled.

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

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

10 years agoThread Safety Analysis: implement review suggestions from Aaron Ballman.
DeLesley Hutchins [Thu, 29 May 2014 21:24:16 +0000 (21:24 +0000)]
Thread Safety Analysis: implement review suggestions from Aaron Ballman.

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

10 years agoImplement AVX1 vbroadcast intrinsics with vector initializers
Adam Nemet [Thu, 29 May 2014 20:47:29 +0000 (20:47 +0000)]
Implement AVX1 vbroadcast intrinsics with vector initializers

These intrinsics are special because they directly take a memory operand (AVX2
adds the register counterparts).  Typically, other non-memop intrinsics take
registers and then it's left to isel to fold memory operands.

In order to LICM intrinsics directly reading memory, we require that no stores
are in the loop (LICM) or that the folded load accesses constant memory
(MachineLICM).  When neither is the case we fail to hoist a loop-invariant
broadcast.

We can work around this limitation if we expose the load as a regular load and
then just implement the broadcast using the vector initializer syntax.  This
exposes the load to LICM and other optimizations.

At the IR level this is translated into a series of insertelements.  The
sequence is already recognized as a broadcast so there is no impact on the
quality of codegen.

_mm256_broadcast_pd and _mm256_broadcast_ps are not updated by this patch
because right now we lack the DAG-combiner smartness to recover the broadcast
instructions.  This will be tackled in a follow-on.

There will be completing changes on the LLVM side to remove the LLVM
intrinsics and to auto-upgrade bitcode files.

Fixes <rdar://problem/16494520>

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

10 years agoThread Safety Analysis: minor changes to TIL pretty-printing.
DeLesley Hutchins [Thu, 29 May 2014 20:28:53 +0000 (20:28 +0000)]
Thread Safety Analysis: minor changes to TIL pretty-printing.

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

10 years agoAdd documentation for -Rpass*
Diego Novillo [Thu, 29 May 2014 20:13:27 +0000 (20:13 +0000)]
Add documentation for -Rpass*

Summary:
This adds documentation for -Rpass, -Rpass-missed and -Rpass-analysis.
It also adds release notes for 3.5.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoAdd flags -Rpass-missed and -Rpass-analysis.
Diego Novillo [Thu, 29 May 2014 19:55:06 +0000 (19:55 +0000)]
Add flags -Rpass-missed and -Rpass-analysis.

Summary:
These two flags are in the same family as -Rpass, but are used in
different situations.

-Rpass-missed is used by optimizers to inform the user when they tried
to apply an optimization but couldn't (or wouldn't).

-Rpass-analysis is used by optimizers to report analysis results back
to the user (e.g., why the transformation could not be applied).

Depends on D3682.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoMake the -mno-global-merge option work for arm64/aarch64. rdar://17024719
Bob Wilson [Thu, 29 May 2014 19:43:02 +0000 (19:43 +0000)]
Make the -mno-global-merge option work for arm64/aarch64. rdar://17024719

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

10 years agoMake runlines consistent with other dll attribute tests
Nico Rieck [Thu, 29 May 2014 16:57:34 +0000 (16:57 +0000)]
Make runlines consistent with other dll attribute tests

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

10 years agoFix some minor typos in tests
Nico Rieck [Thu, 29 May 2014 16:57:18 +0000 (16:57 +0000)]
Fix some minor typos in tests

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

10 years agoAdd missing -S to avoid invoking assembler unnecessarily.
Diego Novillo [Thu, 29 May 2014 16:52:06 +0000 (16:52 +0000)]
Add missing -S to avoid invoking assembler unnecessarily.

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

10 years agoSema: Functions with dll attributes cannot be deleted
Nico Rieck [Thu, 29 May 2014 16:51:19 +0000 (16:51 +0000)]
Sema: Functions with dll attributes cannot be deleted

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

10 years agoMS ABI: Emit static data members with proper linkage
Nico Rieck [Thu, 29 May 2014 16:50:46 +0000 (16:50 +0000)]
MS ABI: Emit static data members with proper linkage

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

10 years agoSema: Check dll attributes on static data members
Nico Rieck [Thu, 29 May 2014 16:50:20 +0000 (16:50 +0000)]
Sema: Check dll attributes on static data members

Redeclarations cannot add a dll attribute and static data members cannot
be defined.

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

10 years agoNo longer allow the -std options to entirely override the -x language option. This...
Aaron Ballman [Thu, 29 May 2014 16:39:42 +0000 (16:39 +0000)]
No longer allow the -std options to entirely override the -x language option. This allows -x cuda -std=c++11, for instance.

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

10 years agoFix spurious remarks when -Weverything is used.
Diego Novillo [Thu, 29 May 2014 16:19:27 +0000 (16:19 +0000)]
Fix spurious remarks when -Weverything is used.

With -Weverything, the backend remarks are enabled. This was
causing spurious diagnostics for remarks that we don't yet
handle (cf http://reviews.llvm.org/D3683).

This will stop being a problem once http://reviews.llvm.org/D3683
is committed.

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

10 years agoParsing/Sema for OMPAlignedClause.
Alexander Musman [Thu, 29 May 2014 14:36:25 +0000 (14:36 +0000)]
Parsing/Sema for OMPAlignedClause.

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

10 years agoRefactoring. Remove Owned method from Sema.
Nikola Smiljanic [Thu, 29 May 2014 14:05:12 +0000 (14:05 +0000)]
Refactoring. Remove Owned method from Sema.

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

10 years agoFixing a test case which was failing the MSVC build bots. When -std isn't specified...
Aaron Ballman [Thu, 29 May 2014 12:59:11 +0000 (12:59 +0000)]
Fixing a test case which was failing the MSVC build bots. When -std isn't specified with an MSVC build, it defaults to -std=c++11, which overrides the -x cuda option. In turn, this causes all CUDA language option checks to fail.

This fix is possibly temporary while we determine whether -x cuda should be considered along with -std=c++11 when setting language options.

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

10 years agoRefactoring. Remove release and take methods from ActionResult. Rename takeAs to...
Nikola Smiljanic [Thu, 29 May 2014 10:55:11 +0000 (10:55 +0000)]
Refactoring. Remove release and take methods from ActionResult. Rename takeAs to getAs.

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

10 years agoWhen merging functions across modules (and in particular, instantiations of
Richard Smith [Thu, 29 May 2014 03:15:31 +0000 (03:15 +0000)]
When merging functions across modules (and in particular, instantiations of
member functions), ensure that the redecl chain never transitions from 'inline'
to 'not inline', since that violates an AST invariant.

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

10 years agoImplement a convenience recursive walk method over a cursor and its descendants.
Eli Bendersky [Thu, 29 May 2014 02:35:27 +0000 (02:35 +0000)]
Implement a convenience recursive walk method over a cursor and its descendants.

Before r160106 there was a way to recursively visit all descendants of a cursor
via Cursor_visit, but it was removed. Since then, every user needs to
reimplement the recursive descent into get_children.

Adding a walk_preorder() method to Cursor that conveniently implements recursive
walking in a Pythonic way. This also greatly simplifies get_cursor and
get_cursors in tests/cindex/util.py (walk_preorder is now tested through these
utility functions, since they are used in many tests).

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

10 years ago[ASan] Hoist blacklisting globals from init-order checking to Clang.
Alexey Samsonov [Thu, 29 May 2014 01:43:53 +0000 (01:43 +0000)]
[ASan] Hoist blacklisting globals from init-order checking to Clang.

Clang knows about the sanitizer blacklist and it makes no sense to
add global to the list of llvm.asan.dynamically_initialized_globals if it
will be blacklisted in the instrumentation pass anyway. Instead, we should
do as much blacklisting as possible (if not all) in the frontend.

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

10 years agoPR19878: If a pack expansion appears within another pack expansion, correctly
Richard Smith [Thu, 29 May 2014 01:12:14 +0000 (01:12 +0000)]
PR19878: If a pack expansion appears within another pack expansion, correctly
deduce any packs that are expanded by both expansions.

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

10 years agoThread Safety Analysis: update TIL traversal mechanism to allow arbitrary
DeLesley Hutchins [Wed, 28 May 2014 21:28:13 +0000 (21:28 +0000)]
Thread Safety Analysis: update TIL traversal mechanism to allow arbitrary
local contexts.  Also includes some minor refactoring.

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

10 years agoadded Intel's BMI intrinsic variants
Sanjay Patel [Wed, 28 May 2014 20:26:57 +0000 (20:26 +0000)]
added Intel's BMI intrinsic variants
(fixes PR19431 - http://llvm.org/bugs/show_bug.cgi?id=19431)

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

10 years agoExpose CUDA function attributes to the C interface.
Eli Bendersky [Wed, 28 May 2014 19:29:58 +0000 (19:29 +0000)]
Expose CUDA function attributes to the C interface.

Until now all CUDA-specific attributes were represented with
CXCursor_UnexposedAttr; now they are actually implemented, including the Python
bindings.

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

10 years agoReverting 209503 - Breaks asan blacklists
Warren Hunt [Wed, 28 May 2014 19:17:45 +0000 (19:17 +0000)]
Reverting 209503 - Breaks asan blacklists
I opened a discussion on cfe-commits.  Ideally we've got a few things
that need to happen.  CompilerRT should probably have blacklists tests.
Asan should probably not depend on that specific field.

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

10 years agoDebug Info: Fix the source range for IfStmt's ConditionScope.
Adrian Prantl [Wed, 28 May 2014 19:10:59 +0000 (19:10 +0000)]
Debug Info: Fix the source range for IfStmt's ConditionScope.
Since the continuation block of the if statement is emitted within the
condition scope this had the undesirable effect of creating a line table
entry at the end of the then or else statement, a line that may have never
been executed.
PR19864 / rdar://problem/17052973

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

10 years agoMove misplaced Documentation note in Attr.td
Reid Kleckner [Wed, 28 May 2014 18:43:46 +0000 (18:43 +0000)]
Move misplaced Documentation note in Attr.td

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

10 years agoObjective-C. Diagnose use of properties in functions nested in,
Fariborz Jahanian [Wed, 28 May 2014 18:12:10 +0000 (18:12 +0000)]
Objective-C. Diagnose use of properties in functions nested in,
now deprecated, ObjC containers instead of crashing.
// rdar://16859666

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

10 years agoTrim trailing whitespace in cindex.py
Eli Bendersky [Wed, 28 May 2014 17:35:14 +0000 (17:35 +0000)]
Trim trailing whitespace in cindex.py

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

10 years agoObjective-C. Deprecate use of function definitions
Fariborz Jahanian [Wed, 28 May 2014 17:02:35 +0000 (17:02 +0000)]
Objective-C. Deprecate use of function definitions
in Objective-C container declarations (but not
in their definitions. // rdar://10414277

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

10 years ago[DOC] Documentation for #pragma clang optimize on/off
Dario Domizioli [Wed, 28 May 2014 14:06:38 +0000 (14:06 +0000)]
[DOC] Documentation for #pragma clang optimize on/off

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

10 years ago-pthread does not translate to -lpthread on Android.
Evgeniy Stepanov [Wed, 28 May 2014 12:53:34 +0000 (12:53 +0000)]
-pthread does not translate to -lpthread on Android.

There is no libpthread.so, and pthread interface is implemented in libc.so.
This mirrors gcc behavior.

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

10 years agoAdd a PR reference for XFAILed test
Alp Toker [Wed, 28 May 2014 12:26:32 +0000 (12:26 +0000)]
Add a PR reference for XFAILed test

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

10 years agoTest requires exceptions
Alp Toker [Wed, 28 May 2014 12:20:23 +0000 (12:20 +0000)]
Test requires exceptions

It's still XFAIL, but slightly closer to passing.

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

10 years agoConsolidate some note diagnostics
Alp Toker [Wed, 28 May 2014 12:20:14 +0000 (12:20 +0000)]
Consolidate some note diagnostics

These note diags have the same message and can be unified further but for now
let's just bring them together.

Incidental change: Display a source range in the final attr diagnostic.

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

10 years agoFix line endings.
Nikola Smiljanic [Wed, 28 May 2014 11:19:43 +0000 (11:19 +0000)]
Fix line endings.

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

10 years agoLet clang/test/CodeGen/pr19841.cpp tolerant of MS mangler.
NAKAMURA Takumi [Wed, 28 May 2014 10:53:06 +0000 (10:53 +0000)]
Let clang/test/CodeGen/pr19841.cpp tolerant of MS mangler.

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

10 years agoclang-format: Don't break before a case's colon.
Daniel Jasper [Wed, 28 May 2014 10:09:11 +0000 (10:09 +0000)]
clang-format: Don't break before a case's colon.

Before (with just the right line length:
  switch (a) {
  case some_namespace::some_constant
      :
    return;
  }

After:
  switch (a) {
  case some_namespace::
      some_constant:
    return;
  }

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

10 years agoAdd 'nonnull' parameter or return attribute when producing an llvm pointer type in...
Nick Lewycky [Wed, 28 May 2014 09:56:42 +0000 (09:56 +0000)]
Add 'nonnull' parameter or return attribute when producing an llvm pointer type in a function type where the C++ type is a reference. Update the tests.

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

10 years agoclang-format: Format array and dict literals similar to blocks.
Daniel Jasper [Wed, 28 May 2014 09:11:53 +0000 (09:11 +0000)]
clang-format: Format array and dict literals similar to blocks.

Especially, reduce the amount of indentation if it doesn't increase
readability.

Before:
  NSMutableDictionary* dictionary = [NSMutableDictionary
      dictionaryWithDictionary:@{
                                 aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa,
                                 bbbbbbbbbbbbbbbbbb : bbbbb,
                                 cccccccccccccccc : ccccccccccccccc
                               }];

After:
  NSMutableDictionary* dictionary =
      [NSMutableDictionary dictionaryWithDictionary:@{
        aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa,
        bbbbbbbbbbbbbbbbbb : bbbbb,
        cccccccccccccccc : ccccccccccccccc
      }];

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

10 years ago[OPENMP] Additional checking for local vars in initial values for threadprivate vars
Alexey Bataev [Wed, 28 May 2014 07:40:25 +0000 (07:40 +0000)]
[OPENMP] Additional checking for local vars in initial values for threadprivate vars

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

10 years ago[OPENMP] Reformatting of parsing code for OpenMP constructs.
Alexey Bataev [Wed, 28 May 2014 06:15:33 +0000 (06:15 +0000)]
[OPENMP] Reformatting of parsing code for OpenMP constructs.

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

10 years ago[OPENMP][C++11] Formatting and make more C++11 compliant of OpenMP sema.
Alexey Bataev [Wed, 28 May 2014 05:53:51 +0000 (05:53 +0000)]
[OPENMP][C++11] Formatting and make more C++11 compliant of OpenMP sema.

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

10 years agoMove the logic for testing for namespace std into one location. This check can
Richard Trieu [Wed, 28 May 2014 02:16:01 +0000 (02:16 +0000)]
Move the logic for testing for namespace std into one location.  This check can
be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace

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

10 years agoDon't dllimport/export destructor variants implemented by thunks.
Hans Wennborg [Wed, 28 May 2014 01:52:23 +0000 (01:52 +0000)]
Don't dllimport/export destructor variants implemented by thunks.

MSVC doesn't export these functions, so trying to import them doesnt' work.
Also, don't let any dll attributes on the CXXDestructorDecl influence the
thunk's linkage -- they should always be linkonce_odr.

This takes care of the FIXME's for this in Nico's tests.

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

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

10 years agoRetain isImplicit flag for local variable declarations when instantiating
Alexander Kornienko [Tue, 27 May 2014 21:29:22 +0000 (21:29 +0000)]
Retain isImplicit flag for local variable declarations when instantiating
templates.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

10 years agoAdd a test that we don't store stale modtime in modules
Ben Langmuir [Tue, 27 May 2014 19:57:48 +0000 (19:57 +0000)]
Add a test that we don't store stale modtime in modules

The change from r209195 turned out to be important to avoid saving stale
modification time/expected size information in a module file when there
are 3 or more modules in a dependency chain and the bottom one is
rebuilt. So add a test for that.

rdar://problem/17038180

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

10 years agoAdd range accessors for captures of a LambdaExpr.
James Dennett [Tue, 27 May 2014 19:13:04 +0000 (19:13 +0000)]
Add range accessors for captures of a LambdaExpr.

Summary:
This adds LambdaExpr::captures(), LambdaExpr::explicit_captures()
and LambdaExpr::implicit_captures() as simple wrappers over the underlying
*_begin()/*_end() functions.

Reviewers: aaron.ballman

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

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

10 years agoObjective-C. Fixes an obscuer crash caused by multiple inclusion of
Fariborz Jahanian [Tue, 27 May 2014 18:26:09 +0000 (18:26 +0000)]
Objective-C. Fixes an obscuer crash caused by multiple inclusion of
same framework after complaining about duplicate class definition.
// rdar://17024681

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

10 years agoFix pr19841, bb are also unnamed
Renato Golin [Tue, 27 May 2014 17:01:21 +0000 (17:01 +0000)]
Fix pr19841, bb are also unnamed

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

10 years agoFix pr19841.cpp on release mode
Renato Golin [Tue, 27 May 2014 16:51:36 +0000 (16:51 +0000)]
Fix pr19841.cpp on release mode

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

10 years agoRevert small change to EmitDeclRefLValue
Renato Golin [Tue, 27 May 2014 16:46:27 +0000 (16:46 +0000)]
Revert small change to EmitDeclRefLValue

That small change, although it looked harmless, it made emitting the LValue
on the PHI node without the proper cast. Reverting it fixes PR19841.

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

10 years agoASTMatchers.h: Appease msc17.
NAKAMURA Takumi [Tue, 27 May 2014 15:13:51 +0000 (15:13 +0000)]
ASTMatchers.h: Appease msc17.

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

10 years agoParsing/Sema for OMPCollapseClause.
Alexander Musman [Tue, 27 May 2014 15:12:19 +0000 (15:12 +0000)]
Parsing/Sema for OMPCollapseClause.
Actual usage in Sema for collapsing loops will in some future patch.

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

10 years agoMake equalsNode work with pointers to subtypes.
Manuel Klimek [Tue, 27 May 2014 12:31:10 +0000 (12:31 +0000)]
Make equalsNode work with pointers to subtypes.

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

10 years agoAdds child traversal matchers for IfStmt's then and else branches.
Manuel Klimek [Tue, 27 May 2014 10:04:12 +0000 (10:04 +0000)]
Adds child traversal matchers for IfStmt's then and else branches.

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

10 years agoAllow hasBody on CXXForRangeStmt nodes and update the docs.
Manuel Klimek [Tue, 27 May 2014 07:45:18 +0000 (07:45 +0000)]
Allow hasBody on CXXForRangeStmt nodes and update the docs.

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