]> granicus.if.org Git - clang/log
clang
12 years agoConvert initializer lists to temporaries in CreateBuiltinBinOp. Allows assignment...
Sebastian Redl [Mon, 27 Feb 2012 20:34:02 +0000 (20:34 +0000)]
Convert initializer lists to temporaries in CreateBuiltinBinOp. Allows assignment of init lists to built-in types and resolves PR12088.

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

12 years agoAdd missing code for compound literals of complex type. <rdar://problem/10938628>
Eli Friedman [Mon, 27 Feb 2012 20:26:13 +0000 (20:26 +0000)]
Add missing code for compound literals of complex type.  <rdar://problem/10938628>

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

12 years agoRevert testing code I committed by mistake in r151464.
Argyrios Kyrtzidis [Mon, 27 Feb 2012 20:21:34 +0000 (20:21 +0000)]
Revert testing code I committed by mistake in r151464.

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

12 years agoJust drop the bitfield from ExtProtoInfo, this struct isn't even heap allocated so...
Benjamin Kramer [Mon, 27 Feb 2012 20:04:30 +0000 (20:04 +0000)]
Just drop the bitfield from ExtProtoInfo, this struct isn't even heap allocated so it doesn't hurt.

MSVC < 10 still has the signed enum bitfield bug, making the top bit unusable.

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

12 years agoSpeculatively attempt to work around a hypothetical but unreproduced MSVC issue
Richard Smith [Mon, 27 Feb 2012 19:56:34 +0000 (19:56 +0000)]
Speculatively attempt to work around a hypothetical but unreproduced MSVC issue
in r151494.

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

12 years agoTest case for r151429/r151430, which ensures llvm.lifetime intrinsics are not
Chad Rosier [Mon, 27 Feb 2012 18:45:03 +0000 (18:45 +0000)]
Test case for r151429/r151430, which ensures llvm.lifetime intrinsics are not
being emitted at -O0, but are emitted when optimizations are enabled.

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

12 years agoSerialize InitListExpr's initializesStdInitializerList bit, so it's not left uninitia...
Benjamin Kramer [Mon, 27 Feb 2012 13:20:39 +0000 (13:20 +0000)]
Serialize InitListExpr's initializesStdInitializerList bit, so it's not left uninitialized.

Found by valgrind.

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

12 years agoObjcInterfaceTypes are also complete types for the type cache.
Eric Christopher [Mon, 27 Feb 2012 08:23:23 +0000 (08:23 +0000)]
ObjcInterfaceTypes are also complete types for the type cache.

Fixes rdar://10934887

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

12 years agoMake this test a bit more robust for debug info changes.
Eric Christopher [Mon, 27 Feb 2012 08:22:57 +0000 (08:22 +0000)]
Make this test a bit more robust for debug info changes.

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

12 years agoEnsure that we delete default constructors in the right cases. Don't delete the
Richard Smith [Mon, 27 Feb 2012 06:07:25 +0000 (06:07 +0000)]
Ensure that we delete default constructors in the right cases. Don't delete the
default constructor of a union if it has a const member with no user-provided
default constructor.

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

12 years agoFix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed
Richard Smith [Mon, 27 Feb 2012 05:24:00 +0000 (05:24 +0000)]
Fix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed
decltype expression.

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

12 years agoTests for r151508.
Richard Smith [Sun, 26 Feb 2012 23:49:01 +0000 (23:49 +0000)]
Tests for r151508.

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

12 years agoHalf of PR12088: parse braced-init-lists on the RHS of assignment operators.
Richard Smith [Sun, 26 Feb 2012 23:40:27 +0000 (23:40 +0000)]
Half of PR12088: parse braced-init-lists on the RHS of assignment operators.

If the assignment operator is a scalar type, we continue to incorrectly reject
the initializer, but semantic analysis (and codegen) is correct for overloaded
operators.

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

12 years ago[clang.py] Test Cursor.__ne__
Gregory Szorc [Sun, 26 Feb 2012 21:56:32 +0000 (21:56 +0000)]
[clang.py] Test Cursor.__ne__

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

12 years agoReorder members to save padding.
Benjamin Kramer [Sun, 26 Feb 2012 20:37:14 +0000 (20:37 +0000)]
Reorder members to save padding.

There's more potential here, but these Exprs aren't used that often so I don't feel like doing heroic bit packing right now.

-8 bytes on every class changed (x86_64).

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

12 years agoMove CharacterLiteral, FloatingLiteral and UnaryExprOrTypeTraitExpr flags over into...
Benjamin Kramer [Sun, 26 Feb 2012 19:47:25 +0000 (19:47 +0000)]
Move CharacterLiteral, FloatingLiteral and UnaryExprOrTypeTraitExpr flags over into Stmt.

Apply the inheritance-padding trick to FloatingLiteral.
Shrinks CharacterLiteral from 32 to 24 bytes and the other two from 40 to 32 bytes (x86_64).

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

12 years agoMake clever use of padding to shrink IntegerLiterals.
Benjamin Kramer [Sun, 26 Feb 2012 18:34:12 +0000 (18:34 +0000)]
Make clever use of padding to shrink IntegerLiterals.

Inheritance allows us to use padding across classes.
40 -> 32 bytes on x86_64.

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

12 years agoBit pack StringLiteral.
Benjamin Kramer [Sun, 26 Feb 2012 18:34:07 +0000 (18:34 +0000)]
Bit pack StringLiteral.

48 -> 40 bytes on x86_64.

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

12 years agoReduce padding in MemberExpr.
Benjamin Kramer [Sun, 26 Feb 2012 18:34:02 +0000 (18:34 +0000)]
Reduce padding in MemberExpr.

56 -> 48 bytes on x86_64.

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

12 years agoCompoundLiteralExpr: Pair a bool with a pointer.
Benjamin Kramer [Sun, 26 Feb 2012 18:33:56 +0000 (18:33 +0000)]
CompoundLiteralExpr: Pair a bool with a pointer.

48 -> 40 bytes on x86_64.

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

12 years agoShuffle members of DesignatedInitExpr to avoid padding.
Benjamin Kramer [Sun, 26 Feb 2012 17:31:32 +0000 (17:31 +0000)]
Shuffle members of DesignatedInitExpr to avoid padding.

40 -> 32 bytes on x86_64.

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

12 years agoBit pack ExtProtoInfo.
Benjamin Kramer [Sun, 26 Feb 2012 16:55:55 +0000 (16:55 +0000)]
Bit pack ExtProtoInfo.

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

12 years agoMove FullSourceLoc::dump into the .cpp file, the used attribute made us emit this...
Benjamin Kramer [Sun, 26 Feb 2012 16:55:50 +0000 (16:55 +0000)]
Move FullSourceLoc::dump into the .cpp file, the used attribute made us emit this into every TU that includes SourceLocation.h.

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

12 years agoOkay, makes sense to change all the occurences to match clang.EXE.
Benjamin Kramer [Sun, 26 Feb 2012 14:55:10 +0000 (14:55 +0000)]
Okay, makes sense to change all the occurences to match clang.EXE.

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

12 years agoAllow any file extension for the clang binary in the linux-header-search test.
Benjamin Kramer [Sun, 26 Feb 2012 14:50:31 +0000 (14:50 +0000)]
Allow any file extension for the clang binary in the linux-header-search test.

Turns out this can be .exe or .EXE, depending on the build system.

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

12 years agoDon't assert when trying to diagnose why a class with a constructor template is
Richard Smith [Sun, 26 Feb 2012 10:50:32 +0000 (10:50 +0000)]
Don't assert when trying to diagnose why a class with a constructor template is
non-trivial.

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

12 years agoAdd the critical crtbegin.o files necessary for any of the tests in
Chandler Carruth [Sun, 26 Feb 2012 10:46:17 +0000 (10:46 +0000)]
Add the critical crtbegin.o files necessary for any of the tests in
r151482 and r151484 to work. Sorry about the fallout...

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

12 years agoA follow-up to r151482 which added support for powerpc and powerpc64
Chandler Carruth [Sun, 26 Feb 2012 09:21:43 +0000 (09:21 +0000)]
A follow-up to r151482 which added support for powerpc and powerpc64
Debian multiarch libraries, this should in theory add support for those
platform's header search rules. I don't have a system to check this
with, so review appreciated. I've added the corresponding tests
referring to the debian multiarch tree.

We are starting to have a relatively completely tested Linux platform
for header search and library search, with several interesting
peculiarities. We should point people at the debian_multiarch_tree when
suggesting new tests. Folks with Debian systems that can check this for
correctness, it would be much appreciated. The missing chunks I know of
are testing bi-arch peudo-cross-compiling toolchains betwen 32-bit and
64-bit variants of platforms, and the MIPS and ARM Debian toolchains.

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

12 years agoEnsure that we delete destructors in the right cases. Specifically:
Richard Smith [Sun, 26 Feb 2012 09:11:52 +0000 (09:11 +0000)]
Ensure that we delete destructors in the right cases. Specifically:
 - variant members with nontrivial destructors make the containing class's
   destructor deleted
 - check for a virtual destructor after checking for overridden methods in the
   base class(es)
 - check for an inaccessible operator delete for a class with a virtual
   destructor.

Do not try to call an anonymous union field's destructor from the destructor of
the containing class.

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

12 years agoAdd support for PPC and PPC64 multiarch toolchains on Debain.
Chandler Carruth [Sun, 26 Feb 2012 09:03:21 +0000 (09:03 +0000)]
Add support for PPC and PPC64 multiarch toolchains on Debain.

Patch from Michel Dänzer, sent our way via Jeremy Huddleston who added
64-bit support. I just added one other place where powerpc64-linux-gnu
was missing (we only had powerpc64-unknown-linux-gnu).

I've also added a tree to test out the debian multiarch stuff. I don't
use debian regularly, so I'm not certain this is entirely accurate. If
anyone wants to check it against a debian system and fix any
inaccuracies, fire away. This way at least folks can see how this is
*supposed* to be tested.

It'd be particularly good to get the Debian MIPS toolchains tested in
this way.

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

12 years agoMake sure we don't try to produce a definition of an implicitly-deleted function
Richard Smith [Sun, 26 Feb 2012 07:51:39 +0000 (07:51 +0000)]
Make sure we don't try to produce a definition of an implicitly-deleted function

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

12 years agoUpdate release notes and language extensions pages to note that support for
Richard Smith [Sun, 26 Feb 2012 07:09:21 +0000 (07:09 +0000)]
Update release notes and language extensions pages to note that support for
generalized initializers is available.

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

12 years agoSpecial members which are defaulted or deleted on their first declaration are
Richard Smith [Sun, 26 Feb 2012 00:31:33 +0000 (00:31 +0000)]
Special members which are defaulted or deleted on their first declaration are
trivial if the implicit declaration would be. Don't forget to set the Trivial
flag on the special member as well as on the class. It doesn't seem ideal that
we have two separate mechanisms for storing this information, but this patch
does not attempt to address that.

This leaves us in an interesting position where the has_trivial_X trait for a
class says 'yes' for a deleted but trivial X, but is_trivially_Xable says 'no'.
This seems to be what the standard requires.

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

12 years agoRevert r151460 as it is not enough to address the issue.
Argyrios Kyrtzidis [Sat, 25 Feb 2012 23:21:37 +0000 (23:21 +0000)]
Revert r151460 as it is not enough to address the issue.

Original log:
When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

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

12 years agoRichard Smith pointed out that there already is a proposal for init list mangling.
Sebastian Redl [Sat, 25 Feb 2012 22:59:28 +0000 (22:59 +0000)]
Richard Smith pointed out that there already is a proposal for init list mangling.

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

12 years agoWhen evaluating integer expressions handle logical operators outside
Argyrios Kyrtzidis [Sat, 25 Feb 2012 21:38:16 +0000 (21:38 +0000)]
When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

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

12 years agoInitializer lists are now supported.
Sebastian Redl [Sat, 25 Feb 2012 20:51:27 +0000 (20:51 +0000)]
Initializer lists are now supported.

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

12 years agoCodeGen support for global variables of type std::initializer_list<X>.
Sebastian Redl [Sat, 25 Feb 2012 20:51:20 +0000 (20:51 +0000)]
CodeGen support for global variables of type std::initializer_list<X>.

This emits a backing array with internal linkage and fills it with data,
then has the initializer_list point at the array. Dynamic initialization
and global destructors are correctly supported.

What doesn't work is nested initializer_lists. I have no idea how to
get them to work, either. However, these should be very rare, and so
I'll just call it a known bug and declare generalized initializers
DONE!

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

12 years agoFix crashers on unexpected std::initializer_list layouts. Found by inspection.
Sebastian Redl [Sat, 25 Feb 2012 20:51:13 +0000 (20:51 +0000)]
Fix crashers on unexpected std::initializer_list layouts. Found by inspection.

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

12 years agoBetter mangling for new-expressions. Also, although we can't mangle arbitrary initial...
Sebastian Redl [Sat, 25 Feb 2012 20:51:07 +0000 (20:51 +0000)]
Better mangling for new-expressions. Also, although we can't mangle arbitrary initializer lists yet (we will need this), turn the crash into a controlled error.

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

12 years agoTemporarily revert r151288:
Chad Rosier [Sat, 25 Feb 2012 20:32:43 +0000 (20:32 +0000)]
Temporarily revert r151288:
ARM: enable the integrated assembler by default for Darwin.

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

12 years agoCMake: install libclang.dll to $CMAKE_INSTALL_PREFIX/bin.
NAKAMURA Takumi [Sat, 25 Feb 2012 16:46:50 +0000 (16:46 +0000)]
CMake: install libclang.dll to $CMAKE_INSTALL_PREFIX/bin.

Patch by Joe Groff.

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

12 years agoArrayRef'ize various functions in the AST/Parser/Sema.
Ahmed Charles [Sat, 25 Feb 2012 11:00:22 +0000 (11:00 +0000)]
ArrayRef'ize various functions in the AST/Parser/Sema.

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

12 years agoAccept __has_feature(__feature__) as a synonym for __has_feature(feature) (and
Richard Smith [Sat, 25 Feb 2012 10:41:10 +0000 (10:41 +0000)]
Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (and
likewise for __has_extension). Patch by Jonathan Sauer!

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

12 years agoFix r151443 to only apply C++11's exception for non-static data member access
Richard Smith [Sat, 25 Feb 2012 10:20:59 +0000 (10:20 +0000)]
Fix r151443 to only apply C++11's exception for non-static data member access
in cases where we would otherwise disallow the access, and add a -Wc++98-compat
diagnostic for this C++11 feature.

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

12 years agoPR11956: C++11's special exception for accessing non-static data members from
Richard Smith [Sat, 25 Feb 2012 10:04:07 +0000 (10:04 +0000)]
PR11956: C++11's special exception for accessing non-static data members from
unevaluated operands applies within member functions, too.

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

12 years agoFix assertion (too few Diag arguments) when diagnosing a deleted operator delete
Richard Smith [Sat, 25 Feb 2012 09:42:26 +0000 (09:42 +0000)]
Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete

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

12 years agoTeach CXXRecordDecl::hasIrrelevantDestructor to check the base classes and
Richard Smith [Sat, 25 Feb 2012 07:33:38 +0000 (07:33 +0000)]
Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes and
data members for deleted or user-provided destructors.

Now it's computed in advance, serialize it, and in passing fix all the other
record DefinitionData flags whose serialization was missing.

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

12 years agoFix a regression from r151117: ADL requires that we attempt to complete any
Richard Smith [Sat, 25 Feb 2012 06:24:24 +0000 (06:24 +0000)]
Fix a regression from r151117: ADL requires that we attempt to complete any
associated classes, since it can find friend functions declared within them,
but overload resolution does not otherwise require argument types to be
complete.

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

12 years agoPrevent llvm.lifetime intrinsics from being emitted at -O0.
Chad Rosier [Sat, 25 Feb 2012 02:56:13 +0000 (02:56 +0000)]
Prevent llvm.lifetime intrinsics from being emitted at -O0.
rdar://10921594

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

12 years agoWork-in-progress for lambda conversion-to-block operator. Still need to implement...
Eli Friedman [Sat, 25 Feb 2012 02:48:22 +0000 (02:48 +0000)]
Work-in-progress for lambda conversion-to-block operator.  Still need to implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure).

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

12 years agoDon't record nested macro expansions in the preprocessing record,
Argyrios Kyrtzidis [Sat, 25 Feb 2012 02:41:16 +0000 (02:41 +0000)]
Don't record nested macro expansions in the preprocessing record,
it can only bring pain when dealing with preprocessor abuse (see: boost).

rdar://10898986

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

12 years agoRetainCountChecker: don't adjust the retain count when analyzing a ReturnStmt unless...
Ted Kremenek [Sat, 25 Feb 2012 02:09:09 +0000 (02:09 +0000)]
RetainCountChecker: don't adjust the retain count when analyzing a ReturnStmt unless we are in the top-level call frame.  We can do more later, but this makes the checker self-consistent (and fixes a crash).

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

12 years ago[arcmt] GC migrator: don't try to remove redundant __strong, it does
Argyrios Kyrtzidis [Sat, 25 Feb 2012 01:57:42 +0000 (01:57 +0000)]
[arcmt] GC migrator: don't try to remove redundant __strong, it does
more harm than good.

Fixes rdar://10522805&10521433

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

12 years agoImprove the diagnostic in ARC mode when a conditional with an Objective-C type and...
Eli Friedman [Sat, 25 Feb 2012 00:23:44 +0000 (00:23 +0000)]
Improve the diagnostic in ARC mode when a conditional with an Objective-C type and void* is used.  <rdar://problem/10486347>.

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

12 years agoTrying to increase my Ohloh ranking with trivial tweaks
Douglas Gregor [Sat, 25 Feb 2012 00:16:17 +0000 (00:16 +0000)]
Trying to increase my Ohloh ranking with trivial tweaks

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

12 years agoBugfix: bogus warning -- "invalid use of non-static data member",
DeLesley Hutchins [Sat, 25 Feb 2012 00:11:55 +0000 (00:11 +0000)]
Bugfix: bogus warning -- "invalid use of non-static data member",
when a class is forward declared, and the reference to the data
member in question does not occur within a method body.

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

12 years agoSimplify check per Eli's comment
Douglas Gregor [Sat, 25 Feb 2012 00:06:47 +0000 (00:06 +0000)]
Simplify check per Eli's comment

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

12 years agoAdd test for C++ DR899.
Douglas Gregor [Fri, 24 Feb 2012 23:57:42 +0000 (23:57 +0000)]
Add test for C++ DR899.

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

12 years ago[analyzer] Malloc: reason about the ObjC messages and C++.
Anna Zaks [Fri, 24 Feb 2012 23:56:53 +0000 (23:56 +0000)]
[analyzer] Malloc: reason about the ObjC messages and C++.

Assume none of the ObjC messages defined in system headers free memory,
except for the ones containing 'freeWhenDone' selector. Currently, just
assume that the region escapes to the messages with 'freeWhenDone'
(ideally, we want to treat it as 'free()').

For now, always assume that regions escape when passed to C++ methods.

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

12 years agoImplement C++11 [over.match.copy]p1b2, which allows the use of
Douglas Gregor [Fri, 24 Feb 2012 23:56:31 +0000 (23:56 +0000)]
Implement C++11 [over.match.copy]p1b2, which allows the use of
explicit conversion functions to initialize the argument to a
copy/move constructor that itself is the subject of direct
initialization. Since we don't have that much context in overload
resolution, we end up threading more flags :(.

Fixes <rdar://problem/10903741> / PR10456.

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

12 years agoFix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger.
Eli Friedman [Fri, 24 Feb 2012 23:53:49 +0000 (23:53 +0000)]
Fix a stupid mistake in r151133.  Reported to me by Joerg Sonnenberger.

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

12 years agoRemove FIXME: as Eli points out, the behavior here is now correct.
Richard Smith [Fri, 24 Feb 2012 23:21:24 +0000 (23:21 +0000)]
Remove FIXME: as Eli points out, the behavior here is now correct.

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

12 years agoFor the purposes of building LLVM types, a forward-declared
Douglas Gregor [Fri, 24 Feb 2012 22:40:36 +0000 (22:40 +0000)]
For the purposes of building LLVM types, a forward-declared
enumeration type with a fixed underlying type is complete. Fixes
<rdar://problem/10916155>.

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

12 years agoBack out __decltype warning from r151377: we should either warn on all the GNU
Richard Smith [Fri, 24 Feb 2012 22:30:04 +0000 (22:30 +0000)]
Back out __decltype warning from r151377: we should either warn on all the GNU
__keywords or none of them.

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

12 years agoMake helper static.
Benjamin Kramer [Fri, 24 Feb 2012 22:19:42 +0000 (22:19 +0000)]
Make helper static.

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

12 years agoWhen checking whether a reference to a variable is an ICE, look at the type of
Richard Smith [Fri, 24 Feb 2012 22:12:32 +0000 (22:12 +0000)]
When checking whether a reference to a variable is an ICE, look at the type of
the declaration, not at the type of the DeclRefExpr, since within a lambda the
DeclRefExpr can be more const than the declaration is.

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

12 years agoMinor modern rewriter bug showed up during testing
Fariborz Jahanian [Fri, 24 Feb 2012 21:42:38 +0000 (21:42 +0000)]
Minor modern rewriter bug showed up during testing
against a large project.

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

12 years agoC++11 [class.ctor]p5 says that
Douglas Gregor [Fri, 24 Feb 2012 21:25:53 +0000 (21:25 +0000)]
C++11 [class.ctor]p5 says that
  A defaulted default constructor for a class X is defined as deleted if [...]
    -  X is a union and all of its variant members are of const-qualified type.

A pedantic reading therefore says that

 union X { };

has a deleted default constructor, which is both silly and almost
certainly unintended. Pretend as if this this read

    - X is a union with one or more variant members, and all of its
      variant members are of const-qualified type.

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

12 years agoFix comment: correct predicate name, reformat comment.
Dmitri Gribenko [Fri, 24 Feb 2012 20:03:35 +0000 (20:03 +0000)]
Fix comment: correct predicate name, reformat comment.

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

12 years agoChange the text of a FIXME.
Argyrios Kyrtzidis [Fri, 24 Feb 2012 19:45:46 +0000 (19:45 +0000)]
Change the text of a FIXME.

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

12 years ago[libclang] Add a triple to the test.
Argyrios Kyrtzidis [Fri, 24 Feb 2012 19:45:42 +0000 (19:45 +0000)]
[libclang] Add a triple to the test.

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

12 years agocxx_status: Consistently refer to C++11 as "C++11", not as "C++'11" nor as
Richard Smith [Fri, 24 Feb 2012 18:42:08 +0000 (18:42 +0000)]
cxx_status: Consistently refer to C++11 as "C++11", not as "C++'11" nor as
"C++0x". Use "C++98" to refer to C++98, not "C++". Add heading for C++98
support section.

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

12 years agocxx_status: extended sizeof has been essentially complete for some time. As
Richard Smith [Fri, 24 Feb 2012 18:37:14 +0000 (18:37 +0000)]
cxx_status: extended sizeof has been essentially complete for some time. As
agreed on IRC, any remaining issues are best dealt with as bugs.

We have no __has_feature check for this; please shout if you'd like one. This
feature seems too small to be worth its own release notes bullet (again, please
shout if you disagree).

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

12 years agotest for writing modern ivar of struct type.
Fariborz Jahanian [Fri, 24 Feb 2012 18:17:50 +0000 (18:17 +0000)]
test for writing modern ivar of struct type.

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

12 years ago__decltype is a GNU extension, not a C++11 extension.
Richard Smith [Fri, 24 Feb 2012 18:10:23 +0000 (18:10 +0000)]
__decltype is a GNU extension, not a C++11 extension.

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

12 years agomore objective-c modern translator ivar tests.
Fariborz Jahanian [Fri, 24 Feb 2012 18:03:42 +0000 (18:03 +0000)]
more objective-c modern translator ivar tests.

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

12 years agoTwo minor, related fixes for template instantiation with blocks:
Douglas Gregor [Fri, 24 Feb 2012 17:41:38 +0000 (17:41 +0000)]
Two minor, related fixes for template instantiation with blocks:
  - Make sure that the block expression is instantiation-dependent if the
    block is in a dependent context
  - Make sure that the C++ 'this' expression gets captured even if we
  don't rebuild the AST node during template instantiation. This would
  also have manifested as a bug for lambdas.

Fixes <rdar://problem/10832617>.

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

12 years agoobjc modern translator. Fixes writing of block pointer ivar access.
Fariborz Jahanian [Fri, 24 Feb 2012 17:35:35 +0000 (17:35 +0000)]
objc modern translator. Fixes writing of block pointer ivar access.

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

12 years ago[analyzer] Run remove dead bindings before each call.
Anna Zaks [Fri, 24 Feb 2012 16:49:46 +0000 (16:49 +0000)]
[analyzer] Run remove dead bindings before each call.

This ensures that we report the bugs associated with symbols going
out of scope in the correct function context.

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

12 years ago[analyzer] We were silently stopping exploring the path after
Anna Zaks [Fri, 24 Feb 2012 16:49:41 +0000 (16:49 +0000)]
[analyzer] We were silently stopping exploring the path after
visiting 'return;' statement!

This most likely caused us to skip a bunch of code when analyzing with
inlining.

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

12 years agoUse -no-integrated-as only on ARM. The X86 and X86-64 integrated as have been
Rafael Espindola [Fri, 24 Feb 2012 16:22:39 +0000 (16:22 +0000)]
Use -no-integrated-as only on ARM. The X86 and X86-64 integrated as have been
the default for clang for some time now and can handle compiler-rt.

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

12 years agoRevert r151357. That unreachable is reachable...
Nick Lewycky [Fri, 24 Feb 2012 09:07:53 +0000 (09:07 +0000)]
Revert r151357. That unreachable is reachable...

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

12 years agoSilence gcc warnings pointing out that CharByteWidth could be used
Nick Lewycky [Fri, 24 Feb 2012 08:58:14 +0000 (08:58 +0000)]
Silence gcc warnings pointing out that CharByteWidth could be used
uninitialized. While there, restyle this function! No functionality change.

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

12 years agoSink variable into assert
Matt Beaumont-Gay [Fri, 24 Feb 2012 08:37:56 +0000 (08:37 +0000)]
Sink variable into assert

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

12 years agoRemove some trivial uses of hasTrivialCopyConstructor() and
Douglas Gregor [Fri, 24 Feb 2012 07:55:51 +0000 (07:55 +0000)]
Remove some trivial uses of hasTrivialCopyConstructor() and
hasTrivialMoveConstructor().

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

12 years agoKill a spurious use of hasTrivialDefaultConstructor()
Douglas Gregor [Fri, 24 Feb 2012 07:48:37 +0000 (07:48 +0000)]
Kill a spurious use of hasTrivialDefaultConstructor()

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

12 years agoImplement a new type trait __is_trivially_constructible(T, Args...)
Douglas Gregor [Fri, 24 Feb 2012 07:38:34 +0000 (07:38 +0000)]
Implement a new type trait __is_trivially_constructible(T, Args...)
that provides the behavior of the C++11 library trait
std::is_trivially_constructible<T, Args...>, which can't be
implemented purely as a library.

Since __is_trivially_constructible can have zero or more arguments, I
needed to add Yet Another Type Trait Expression Class, this one
handling arbitrary arguments. The next step will be to migrate
UnaryTypeTrait and BinaryTypeTrait over to this new, more general
TypeTrait class.

Fixes the Clang side of <rdar://problem/10895483> / PR12038.

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

12 years agoMake PathDiagnosticBuilder sensitive to varying LocationContexts, thus fixing a bug...
Ted Kremenek [Fri, 24 Feb 2012 07:12:52 +0000 (07:12 +0000)]
Make PathDiagnosticBuilder sensitive to varying LocationContexts, thus fixing a bug in the inlining diagnostics where the wrong location could be used.

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

12 years agoRemove stray path in test file.
Ted Kremenek [Fri, 24 Feb 2012 06:01:01 +0000 (06:01 +0000)]
Remove stray path in test file.

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

12 years agoReapply r151317, but when computing the PathDiagnostic profile and size keep into...
Ted Kremenek [Fri, 24 Feb 2012 06:00:00 +0000 (06:00 +0000)]
Reapply r151317, but when computing the PathDiagnostic profile and size keep into account the nested structure.  Also fix a problem with how
inlining impacted Plist diagnostics, and adjust some ranges in the Plist output due to richer information.

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

12 years agoFix test for non-block-default platforms.
David Blaikie [Fri, 24 Feb 2012 04:20:32 +0000 (04:20 +0000)]
Fix test for non-block-default platforms.

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

12 years agoRevert r151317 - Rework PathDiagnostics creation.. - to appease buildbots.
Chad Rosier [Fri, 24 Feb 2012 02:06:33 +0000 (02:06 +0000)]
Revert r151317 - Rework PathDiagnostics creation.. - to appease buildbots.

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

12 years ago[PCH] When keeping track of top-level decls for "targeted deserialization"
Argyrios Kyrtzidis [Fri, 24 Feb 2012 01:12:38 +0000 (01:12 +0000)]
[PCH] When keeping track of top-level decls for "targeted deserialization"
make sure we don't mistake ParmVarDecls for top-level decls.

Fixes rdar://10920009.

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

12 years agoRework PathDiagnostic creation so that call stacks are captured by a nested PathDiagn...
Ted Kremenek [Fri, 24 Feb 2012 00:38:56 +0000 (00:38 +0000)]
Rework PathDiagnostic creation so that call stacks are captured by a nested PathDiagnosticCallPiece.

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

12 years agoAdd an ivar test for modern objc abi translator.
Fariborz Jahanian [Fri, 24 Feb 2012 00:34:58 +0000 (00:34 +0000)]
Add an ivar test for modern objc abi translator.

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

12 years agoMake test works with FileCheck.
Fariborz Jahanian [Fri, 24 Feb 2012 00:29:20 +0000 (00:29 +0000)]
Make test works with FileCheck.

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

12 years agoReapply r151172 - Unwind path cleanup for array new list initializers - with a
Chad Rosier [Fri, 24 Feb 2012 00:13:55 +0000 (00:13 +0000)]
Reapply r151172 - Unwind path cleanup for array new list initializers - with a
test case that only runs on debug builds.

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

12 years agoHandle "#pragma GCC visibility" in a few more places. Switch over "#pragma pack...
Eli Friedman [Thu, 23 Feb 2012 23:47:16 +0000 (23:47 +0000)]
Handle "#pragma GCC visibility" in a few more places.  Switch over "#pragma pack" to use the same handling that gcc does.  Fixes <rdar://problem/10871094> and <rdar://problem/10893316>.

(Hopefully, common usage of these pragmas isn't irregular enough to break our current handling.  Doug has ideas for a more crazy approach if necessary.)

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

12 years agoModernize some code which processes CastExprs to use CastKinds. No intended function...
Eli Friedman [Thu, 23 Feb 2012 23:04:32 +0000 (23:04 +0000)]
Modernize some code which processes CastExprs to use CastKinds.  No intended functional change.

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