]> granicus.if.org Git - clang/log
clang
13 years ago[analyzer] If a C string length is UnknownVal, clear any existing length binding...
Jordy Rose [Wed, 15 Jun 2011 05:14:03 +0000 (05:14 +0000)]
[analyzer] If a C string length is UnknownVal, clear any existing length binding. No tests yet because the only thing that sets string length is strcpy(), and that needs some work anyway.

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

13 years ago[analyzer] When performing a binary operation on symbolic operands, we convert the...
Jordy Rose [Wed, 15 Jun 2011 04:55:49 +0000 (04:55 +0000)]
[analyzer] When performing a binary operation on symbolic operands, we convert the symbol values to a common type. But in a relational operation, the result is an 'int' or 'bool', which may not be the appropriate type to convert the operands to. In these cases, use the left-hand operand's type as the conversion type.

There's no associated test for this because fully-constrained symbolic values are evaluated ahead of time in normal expressions. This can only come up in checker-constructed expressions (like the ones in an upcoming patch to CStringChecker).

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

13 years agoBuild fix attempt.
Nico Weber [Wed, 15 Jun 2011 04:50:13 +0000 (04:50 +0000)]
Build fix attempt.

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

13 years agoProperly implement C++0x [stmt.dcl]p3, which requires a scope to be
Douglas Gregor [Wed, 15 Jun 2011 03:23:34 +0000 (03:23 +0000)]
Properly implement C++0x [stmt.dcl]p3, which requires a scope to be
protected in the case where a variable is being initialized by a
trivial default constructor but has a non-trivial destructor.

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

13 years agoWarn on "void f(int a[10]) { sizeof(a); }"
Nico Weber [Wed, 15 Jun 2011 02:47:03 +0000 (02:47 +0000)]
Warn on "void f(int a[10]) { sizeof(a); }"

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

13 years agoSema: show shift result in hexadecimal
Ted Kremenek [Wed, 15 Jun 2011 00:54:52 +0000 (00:54 +0000)]
Sema: show shift result in hexadecimal

Change the output for -Wshift-overflow and
-Wshift-sign-overflow to an unsigned hexadecimal. It makes
more sense for looking at bits than a signed decimal does.
Also, change the diagnostic's wording from "overrides"
to "sets".

This uses a new optional argument in APInt::toString()
that adds the '0x' prefix to hexademical numbers.

This fixes PR 9651.

Patch by nobled@dreamwidth.org!

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

13 years agomention new VLA behavior in gnu* vs c* mode dox.
Chris Lattner [Wed, 15 Jun 2011 00:41:40 +0000 (00:41 +0000)]
mention new VLA behavior in gnu* vs c* mode dox.

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

13 years agoIntroduce a -cc1-level option to turn off related result type
Douglas Gregor [Tue, 14 Jun 2011 23:20:43 +0000 (23:20 +0000)]
Introduce a -cc1-level option to turn off related result type
inference, to be used (only) by the Objective-C rewriter.

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

13 years ago[format strings] correctly suggest correct type for '%@' specifiers. Fixes <rdar...
Ted Kremenek [Tue, 14 Jun 2011 22:56:51 +0000 (22:56 +0000)]
[format strings] correctly suggest correct type for '%@' specifiers.  Fixes <rdar://problem/9607158>.

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

13 years agoBad table discription of fromat-y2k causes
Fariborz Jahanian [Tue, 14 Jun 2011 21:54:00 +0000 (21:54 +0000)]
Bad table discription of fromat-y2k causes
no-format-y2k turn off -Wformat altogether.
// rdar://9504680

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

13 years agofix example as per rdar://problem/9461587
Blaine Garst [Tue, 14 Jun 2011 21:41:00 +0000 (21:41 +0000)]
fix example as per rdar://problem/9461587

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

13 years agoWhack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 2 of 3.
Eli Friedman [Tue, 14 Jun 2011 21:20:53 +0000 (21:20 +0000)]
Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI).  Batch 2 of 3.

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

13 years agorevert r133003 and fix the bug properly: the issue was that ## in a token
Chris Lattner [Tue, 14 Jun 2011 18:19:37 +0000 (18:19 +0000)]
revert r133003 and fix the bug properly: the issue was that ## in a token
lexer is not a paste operator, it is a normal token.  This fixes a conformance
issue shown here:
http://p99.gforge.inria.fr/c99-conformance/c99-conformance-clang-2.9.html

and it defines away the crash from before.

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

13 years agoFix a crash on the testcase in PR9981 / rdar://9486765.
Chris Lattner [Tue, 14 Jun 2011 18:12:03 +0000 (18:12 +0000)]
Fix a crash on the testcase in PR9981 / rdar://9486765.

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

13 years agoWhen profiling FunctionProtoTypes, don't canonicalize the expression
Douglas Gregor [Tue, 14 Jun 2011 16:42:44 +0000 (16:42 +0000)]
When profiling FunctionProtoTypes, don't canonicalize the expression
in a noexcept exception specification because it isn't part of the
canonical type. This ensures that we keep the exact expression written
in the noexcept exception specification, rather than accidentally
"adopting" a previously-written and canonically "equivalent" function
prototype. Fixes PR10087.

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

13 years agoWarn on memset(ptr, 0, sizeof(ptr)). Diagnostic wording by Jordy Rose.
Nico Weber [Tue, 14 Jun 2011 16:14:58 +0000 (16:14 +0000)]
Warn on memset(ptr, 0, sizeof(ptr)). Diagnostic wording by Jordy Rose.

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

13 years agoRemove the Fix-it for missing statement in switches
David Majnemer [Tue, 14 Jun 2011 15:24:38 +0000 (15:24 +0000)]
Remove the Fix-it for missing statement in switches

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

13 years agoStaticDiagNameIndex is never written to, place it into .rodata.
Benjamin Kramer [Tue, 14 Jun 2011 13:15:38 +0000 (13:15 +0000)]
StaticDiagNameIndex is never written to, place it into .rodata.

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

13 years agoHyphenate "argument-dependent".
Jay Foad [Tue, 14 Jun 2011 12:59:25 +0000 (12:59 +0000)]
Hyphenate "argument-dependent".

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

13 years agowhen compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded...
Chris Lattner [Tue, 14 Jun 2011 06:38:10 +0000 (06:38 +0000)]
when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays.  This has slightly different semantics in some insane cases, but allows
us to accept some constructs that GCC does.  Continue to be pedantic in -std=c99 and other
modes.  This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code

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

13 years agofix rdar://9204520 - Accept int(0.85 * 10) as an initializer in a class member
Chris Lattner [Tue, 14 Jun 2011 05:46:29 +0000 (05:46 +0000)]
fix rdar://9204520 - Accept int(0.85 * 10) as an initializer in a class member
as an extension.

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

13 years agoProperly diagnose using abstract and incomplete types in va_arg
David Majnemer [Tue, 14 Jun 2011 05:17:32 +0000 (05:17 +0000)]
Properly diagnose using abstract and incomplete types in va_arg

- Move a test from test/SemaTemplate/instantiate-expr-3.cpp, it did not belong there
- Incomplete and abstract types are considered hard errors

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

13 years agoUpdate the prefetch intrinsic usage. Now the last argument tells codegen
Bruno Cardoso Lopes [Tue, 14 Jun 2011 05:00:30 +0000 (05:00 +0000)]
Update the prefetch intrinsic usage. Now the last argument tells codegen
whether it's a data or instruction cache access.

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

13 years agofix rdar://9546171 - -Wshorten-64-to-32 shouldn't warn on vector bitcasts.
Chris Lattner [Tue, 14 Jun 2011 04:51:15 +0000 (04:51 +0000)]
fix rdar://9546171 - -Wshorten-64-to-32 shouldn't warn on vector bitcasts.

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

13 years agoMove GlobalDecl to AST
Peter Collingbourne [Tue, 14 Jun 2011 04:02:39 +0000 (04:02 +0000)]
Move GlobalDecl to AST

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

13 years ago[analyzer] CStringChecker checks functions in the C standard library, not C++. Its...
Jordy Rose [Tue, 14 Jun 2011 01:40:43 +0000 (01:40 +0000)]
[analyzer] CStringChecker checks functions in the C standard library, not C++. Its external name is now unix.experimental.CString.

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

13 years agoThe LLVM IR representation of byval arguments has a rather strange property: if the...
Eli Friedman [Tue, 14 Jun 2011 01:37:52 +0000 (01:37 +0000)]
The LLVM IR representation of byval arguments has a rather strange property: if the alignment of an argument to a call is less than the specified byval alignment for that argument, there is no way to specify the alignment of the implied copy.  Therefore, we must ensure that the alignment of the argument is at least the byval alignment.  To do this, we have to mess with the alignment of relevant alloca's in some cases, and insert a copy that conceptually shouldn't be necessary in some cases.

This patch tries relatively hard to avoid creating an extra copy if it can be avoided (see test3 in the included testcase), but it is not possible to avoid in some cases (like test2 in the included testcase).

rdar://9483886

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

13 years ago[analyzer] Change large if body to early return. No functionality change.
Jordy Rose [Tue, 14 Jun 2011 01:26:48 +0000 (01:26 +0000)]
[analyzer] Change large if body to early return. No functionality change.

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

13 years ago[analyzer] Fix modeling of strnlen to be more conservative. Move tests we can't prope...
Jordy Rose [Tue, 14 Jun 2011 01:15:31 +0000 (01:15 +0000)]
[analyzer] Fix modeling of strnlen to be more conservative. Move tests we can't properly model (yet?) to string-fail.c.

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

13 years agoMake __gnu_inline__ functions in gnu99 mode work the same way as inline functions...
Eli Friedman [Mon, 13 Jun 2011 23:56:42 +0000 (23:56 +0000)]
Make __gnu_inline__ functions in gnu99 mode work the same way as inline functions in gnu89 mode in terms of redefinitions.

rdar://9559708 .

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

13 years agoPut local variables in appropriate debug info scope.
Devang Patel [Mon, 13 Jun 2011 23:15:32 +0000 (23:15 +0000)]
Put local variables in appropriate debug info scope.
This fixes radar 8757124.

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

13 years agoRemote this unreliable test case because it did not do its job.
Devang Patel [Mon, 13 Jun 2011 23:14:35 +0000 (23:14 +0000)]
Remote this unreliable test case because it did not do its job.

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

13 years agoUpdate extensions section of the docs to account for wacky gcc stuff we did end up...
Eli Friedman [Mon, 13 Jun 2011 23:12:01 +0000 (23:12 +0000)]
Update extensions section of the docs to account for wacky gcc stuff we did end up implementing.

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

13 years agoWhack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 1 of...
Eli Friedman [Mon, 13 Jun 2011 22:51:21 +0000 (22:51 +0000)]
Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI).  Batch 1 of 3 or so.

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

13 years agoPut classes into anonymous namespaces.
Benjamin Kramer [Mon, 13 Jun 2011 18:38:45 +0000 (18:38 +0000)]
Put classes into anonymous namespaces.

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

13 years agoEliminate the -f[no]objc-infer-related-result-type flags; there's no
Douglas Gregor [Mon, 13 Jun 2011 16:42:53 +0000 (16:42 +0000)]
Eliminate the -f[no]objc-infer-related-result-type flags; there's no
reason to allow the user to control these semantics through a flag.

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

13 years agoUpdate Indexer test for new 'atomic' keyword.
Fariborz Jahanian [Mon, 13 Jun 2011 16:42:02 +0000 (16:42 +0000)]
Update Indexer test for new 'atomic' keyword.

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

13 years agoDocument CheckObjCMethodOverrides
Douglas Gregor [Mon, 13 Jun 2011 16:07:18 +0000 (16:07 +0000)]
Document CheckObjCMethodOverrides

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

13 years agoGive a diagnostic when using non-POD types in a va_arg
David Majnemer [Mon, 13 Jun 2011 06:37:03 +0000 (06:37 +0000)]
Give a diagnostic when using non-POD types in a va_arg

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

13 years agoImprove the diagnostics generated for switch statements missing expressions
David Majnemer [Mon, 13 Jun 2011 05:50:12 +0000 (05:50 +0000)]
Improve the diagnostics generated for switch statements missing expressions

- Move the diagnostic to the case statement instead of at the end of the switch
- Add a fix-it hint as to how to fix the compilation error

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

13 years agoFix a broken index left over from before this function was converted to
Chandler Carruth [Mon, 13 Jun 2011 05:00:35 +0000 (05:00 +0000)]
Fix a broken index left over from before this function was converted to
handle memcpy and memmove. Spotted by Nico.

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

13 years agoCorrect the spelling of instantiation
David Majnemer [Mon, 13 Jun 2011 04:29:15 +0000 (04:29 +0000)]
Correct the spelling of instantiation

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

13 years agoMy calendar says it's 2011.
Benjamin Kramer [Sun, 12 Jun 2011 15:26:54 +0000 (15:26 +0000)]
My calendar says it's 2011.

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

13 years agoDon't assert on initialized typedef declarations in classes:
Richard Smith [Sun, 12 Jun 2011 11:43:46 +0000 (11:43 +0000)]
Don't assert on initialized typedef declarations in classes:

  struct {
    typedef int A = 0;
  };

According to the C++11 standard, this is not ill-formed, but does not have any ascribed meaning. We can't reasonably accept it, so treat it as ill-formed.

Also switch C++ from an incorrect 'fields can only be initialized in constructors' diagnostic for this case to C's 'illegal initializer (only variables can be initialized)'

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

13 years agoTest for C++11 [class]p6 (trivial classes).
Richard Smith [Sun, 12 Jun 2011 09:24:32 +0000 (09:24 +0000)]
Test for C++11 [class]p6 (trivial classes).

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

13 years agoAdded 'atomic' for objc properties.
Fariborz Jahanian [Sat, 11 Jun 2011 17:37:19 +0000 (17:37 +0000)]
Added 'atomic' for objc properties.

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

13 years agoImplement support for C++11 in-class initialization of non-static data members.
Richard Smith [Sat, 11 Jun 2011 17:19:42 +0000 (17:19 +0000)]
Implement support for C++11 in-class initialization of non-static data members.

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

13 years agoAdd code completetion code for the new 'atomic' attribute
Fariborz Jahanian [Sat, 11 Jun 2011 17:14:27 +0000 (17:14 +0000)]
Add code completetion code for the new 'atomic' attribute
keyword in objc property decl.

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

13 years agoExtra test for related result type inference
Douglas Gregor [Sat, 11 Jun 2011 04:42:58 +0000 (04:42 +0000)]
Extra test for related result type inference

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

13 years agoFix order of operands for the warning about incompatible Objective-C
Douglas Gregor [Sat, 11 Jun 2011 04:42:12 +0000 (04:42 +0000)]
Fix order of operands for the warning about incompatible Objective-C
pointer assignment in C++. This was a longstanding problem spotted by
Jordy Rose.

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

13 years agoImplement Objective-C Related Result Type semantics.
Douglas Gregor [Sat, 11 Jun 2011 01:09:30 +0000 (01:09 +0000)]
Implement Objective-C Related Result Type semantics.

Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
      expression of type 'NSArray *' [-Wincompatible-pointer-types]
  NSSet *array = [[NSArray alloc] init];
         ^       ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
      instance method 'init' is assumed to return an instance of its
      receiver
      type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

  auto array = [[NSMutableArray alloc] initWithObjects:@"one",  @"two",nil];
  //    ^ now infers NSMutableArray* rather than id

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

13 years agoRestore 'atomic' as an attribute of objc
Fariborz Jahanian [Sat, 11 Jun 2011 00:45:12 +0000 (00:45 +0000)]
Restore 'atomic' as an attribute of objc
properties.

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

13 years agoPR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine...
Eli Friedman [Fri, 10 Jun 2011 21:53:06 +0000 (21:53 +0000)]
PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.

While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.

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

13 years ago__OBJC__ is also a standard predefined macro.
Nick Lewycky [Fri, 10 Jun 2011 20:56:43 +0000 (20:56 +0000)]
__OBJC__ is also a standard predefined macro.

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

13 years agoThis change is breaking selfhost. Revert it until I have more time
Sean Hunt [Fri, 10 Jun 2011 12:07:09 +0000 (12:07 +0000)]
This change is breaking selfhost. Revert it until I have more time
to study it.

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

13 years agoUncomment this testcase now that we pass it.
Sean Hunt [Fri, 10 Jun 2011 09:32:33 +0000 (09:32 +0000)]
Uncomment this testcase now that we pass it.

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

13 years agoImplement caching of copy assignment operator lookup.
Sean Hunt [Fri, 10 Jun 2011 09:24:41 +0000 (09:24 +0000)]
Implement caching of copy assignment operator lookup.

I believe, upon, careful review, that this code causes us to incorrectly
handle exception specifications of copy assignment operators in C++03
mode. However, we currently do not seem to properly implement the subtle
distinction between copying of members and bases made by implicit copy
constructors and assignment operators in C++03 - namely that they are
limited in their overload selection - in all cases. As such, I feel that
committing this code is correct pending a careful review of our
implementation of these semantics.

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

13 years ago[analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level expressions...
Jordy Rose [Fri, 10 Jun 2011 08:49:37 +0000 (08:49 +0000)]
[analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level expressions (by calling IgnoreParens before adding expressions to blocks). Undo 132769 (LiveVariables' local IgnoreParens), since it's no longer necessary.

Also, have Environment stop looking through NoOp casts; it didn't match the behavior of LiveVariables. And once that's gone, the whole cast block of that switch is unnecessary.

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

13 years agoImplement caching for copy constructors in similar situations.
Sean Hunt [Fri, 10 Jun 2011 04:44:37 +0000 (04:44 +0000)]
Implement caching for copy constructors in similar situations.

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

13 years agoImplement caching of default constructors on the resolution table. This
Sean Hunt [Fri, 10 Jun 2011 03:50:41 +0000 (03:50 +0000)]
Implement caching of default constructors on the resolution table. This
isn't yet used for the less controlled environments of initialization.

Also a few random text fixups.

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

13 years agoMade changes to how 'struct'/'class' mismatches are handled in -Wmismatched-tags.
Richard Trieu [Fri, 10 Jun 2011 03:11:26 +0000 (03:11 +0000)]
Made changes to how 'struct'/'class' mismatches are handled in -Wmismatched-tags.
- Removed fix-it hints from template instaniations since changes to the
templates are rarely helpful.
- Changed the caret in template instaniations from the class/struct name to the
class/struct keyword, matching the other warnings.
- Do not offer fix-it hints when multiple declarations disagree.  Warnings are
still given.
- Once a definition is found, offer a fix-it hint to all previous declarations
with wrong tag.
- Declarations that disagree with a previous definition will get a fix-it hint
to change the declaration.

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

13 years agoAdd few missing files in AST directory to xcode project.
Fariborz Jahanian [Thu, 9 Jun 2011 22:34:17 +0000 (22:34 +0000)]
Add few missing files in AST directory to xcode project.

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

13 years agoDon't add objc method name mangling to locally declared function.
Fariborz Jahanian [Thu, 9 Jun 2011 19:25:01 +0000 (19:25 +0000)]
Don't add objc method name mangling to locally declared function.
// rdar://9566314

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

13 years agoHandle overloaded operators in ?: precedence warning
Hans Wennborg [Thu, 9 Jun 2011 17:06:51 +0000 (17:06 +0000)]
Handle overloaded operators in ?: precedence warning

This is a follow-up to r132565, and should address the rest of PR9969:

Warn about cases such as

int foo(A a, bool b) {
 return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}

also when + is an overloaded operator call.

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

13 years agoAdd isVCVT_N flag to identify Neon VCVT_N intrinsics, which require special
Bob Wilson [Thu, 9 Jun 2011 17:03:27 +0000 (17:03 +0000)]
Add isVCVT_N flag to identify Neon VCVT_N intrinsics, which require special
range checking for immediate operands.  Radar 9558930.

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

13 years ago[analyzer] Ignore parentheses around block-level expressions when computing liveness...
Jordy Rose [Thu, 9 Jun 2011 05:44:04 +0000 (05:44 +0000)]
[analyzer] Ignore parentheses around block-level expressions when computing liveness. Fixes the other half of PR8962.

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

13 years ago[analyzer] Look through __extension__ expressions in a GRState's Environment. Fixes...
Jordy Rose [Wed, 8 Jun 2011 22:47:39 +0000 (22:47 +0000)]
[analyzer] Look through __extension__ expressions in a GRState's Environment. Fixes PR8962.

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

13 years agoRemove stale reference to libIndex.
Ted Kremenek [Wed, 8 Jun 2011 19:52:31 +0000 (19:52 +0000)]
Remove stale reference to libIndex.

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

13 years agoRemove 'atomic' as a property attribute keyword.
Fariborz Jahanian [Wed, 8 Jun 2011 16:40:09 +0000 (16:40 +0000)]
Remove 'atomic' as a property attribute keyword.
It is not a sanctioned keyword and is assumed as default.
// rdar://8790791

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

13 years agoFollowup to 132737; make two-character string explicit, add some
Stuart Hastings [Wed, 8 Jun 2011 16:06:31 +0000 (16:06 +0000)]
Followup to 132737; make two-character string explicit, add some
comments.  rdar://problem/9037836

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

13 years agoModify a diagnostic introduced in r132612 to emit QualTypes directly
Peter Collingbourne [Wed, 8 Jun 2011 15:15:17 +0000 (15:15 +0000)]
Modify a diagnostic introduced in r132612 to emit QualTypes directly

This fixes a memory error on FreeBSD (and is the right thing to do
in any case).

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

13 years agoFix a bunch more notes that were emitted even when the diagnostic they
Chandler Carruth [Wed, 8 Jun 2011 10:26:03 +0000 (10:26 +0000)]
Fix a bunch more notes that were emitted even when the diagnostic they
were intended for was suppressed.

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

13 years agoRevert "hack in my new variables for GCC"
Chandler Carruth [Wed, 8 Jun 2011 10:14:38 +0000 (10:14 +0000)]
Revert "hack in my new variables for GCC"

Very sorry for the accidental commit of WIP code.

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

13 years agoFix a regression in the two-phase lookup diagnostics that switching the
Chandler Carruth [Wed, 8 Jun 2011 10:13:17 +0000 (10:13 +0000)]
Fix a regression in the two-phase lookup diagnostics that switching the
namespace set algorithm (re-)introduced. We may not have seen the 'std'
namespace, but we should still suggested associated namespaces. Easy
fix, but a bit annoying to test.

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

13 years agohack in my new variables for GCC
Chandler Carruth [Wed, 8 Jun 2011 10:13:14 +0000 (10:13 +0000)]
hack in my new variables for GCC

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

13 years agoClang support for ARM Uv/Uy/Uq inline-asm constraints.
Stuart Hastings [Tue, 7 Jun 2011 23:45:05 +0000 (23:45 +0000)]
Clang support for ARM Uv/Uy/Uq inline-asm constraints.
rdar://problem/9037836

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

13 years agoSort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386
Joerg Sonnenberger [Tue, 7 Jun 2011 23:39:17 +0000 (23:39 +0000)]
Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386
may pick it up. This would create bad text relocations.

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

13 years agoMore coherent diagnostic when a stack variable is
Fariborz Jahanian [Tue, 7 Jun 2011 20:15:46 +0000 (20:15 +0000)]
More coherent diagnostic when a stack variable is
declared __weak objc-gc mode.  // rdar://9666091.

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

13 years agoThe macros defined by the language standard are still available even when the
Nick Lewycky [Tue, 7 Jun 2011 06:07:12 +0000 (06:07 +0000)]
The macros defined by the language standard are still available even when the
-undef flag is passed in. Also __ASSEMBLER__ with -x assembler-with-cpp. (Don't
ask.)

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

13 years agoDowngrade the warning about the use of typedefs for class template
Douglas Gregor [Tue, 7 Jun 2011 02:21:18 +0000 (02:21 +0000)]
Downgrade the warning about the use of typedefs for class template
specializations within an explicit instantiation to default to off
(enabled by -pedantic). Nobody else seem to implement C++
[temp.explicit]p3. Fixes PR10093.

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

13 years agoCatch the memory leak in a bucket
Sean Hunt [Tue, 7 Jun 2011 00:11:58 +0000 (00:11 +0000)]
Catch the memory leak in a bucket

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

13 years agoSecond try at fixing this test, this time without breaking 32-bit Darwin builders.
Eli Friedman [Mon, 6 Jun 2011 22:25:48 +0000 (22:25 +0000)]
Second try at fixing this test, this time without breaking 32-bit Darwin builders.

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

13 years agoStart fixing up clang tests to work on the clang-native-arm-cortex-a9 builder.
Eli Friedman [Mon, 6 Jun 2011 21:23:05 +0000 (21:23 +0000)]
Start fixing up clang tests to work on the clang-native-arm-cortex-a9 builder.

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

13 years agoDon't put a note in the DiagGroup
Sean Hunt [Mon, 6 Jun 2011 20:30:15 +0000 (20:30 +0000)]
Don't put a note in the DiagGroup

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

13 years agoTouchup to comments that weren't quite in sync with code
Jonathan D. Turner [Mon, 6 Jun 2011 16:22:39 +0000 (16:22 +0000)]
Touchup to comments that weren't quite in sync with code

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

13 years agoDiagnose the condition in C++ [temp.expl.spec]p16 that prohibits
Douglas Gregor [Mon, 6 Jun 2011 15:22:55 +0000 (15:22 +0000)]
Diagnose the condition in C++ [temp.expl.spec]p16 that prohibits
specializing a member of an unspecialized template, and recover from
such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>.

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

13 years agook now, let's fix that MSVC warning for real.
Francois Pichet [Mon, 6 Jun 2011 02:57:59 +0000 (02:57 +0000)]
ok now, let's fix that MSVC warning for real.

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

13 years agoFix MSVC warning:
Francois Pichet [Mon, 6 Jun 2011 02:42:06 +0000 (02:42 +0000)]
Fix MSVC warning:
"unsafe mix of type 'int' and type 'bool' in operation"

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

13 years agoRichard Smith was correct about how the sets should be computed for
Chandler Carruth [Sun, 5 Jun 2011 23:36:55 +0000 (23:36 +0000)]
Richard Smith was correct about how the sets should be computed for
this. My suggestion assumed a viable erase method for iterators on
SmallPtrSet.

This patch restores his original pattern.

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

13 years agoFix PR10053: Improve diagnostics and error recovery for code which some compilers...
Richard Smith [Sun, 5 Jun 2011 22:42:48 +0000 (22:42 +0000)]
Fix PR10053: Improve diagnostics and error recovery for code which some compilers incorrectly accept due to a lack of proper support for two-phase name lookup.

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

13 years agoToolchain support for Ubuntu Oneiric. Patch by Michael Wild!
Benjamin Kramer [Sun, 5 Jun 2011 16:08:59 +0000 (16:08 +0000)]
Toolchain support for Ubuntu Oneiric. Patch by Michael Wild!

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

13 years agoDrop most of InitializationSequence::SequenceKind's values. They didn't really contai...
Sebastian Redl [Sun, 5 Jun 2011 13:59:11 +0000 (13:59 +0000)]
Drop most of InitializationSequence::SequenceKind's values. They didn't really contain any information that the step array didn't contain too. This makes debugging dumps a bit less informative, but probably not significantly so. The advantage is that the redundancy is gone, so the code is easier to understand.
ReferenceBinding is still there, because it is used in some unclear code.

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

13 years agoRemove more references to FailedSequence.
Sebastian Redl [Sun, 5 Jun 2011 13:59:05 +0000 (13:59 +0000)]
Remove more references to FailedSequence.

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

13 years agoRemove all references to InitializationSequence::FailedSequence from outside SemaInit...
Sebastian Redl [Sun, 5 Jun 2011 12:23:28 +0000 (12:23 +0000)]
Remove all references to InitializationSequence::FailedSequence from outside SemaInit.cpp. Replace them with the boolean conversion or the new Failed() function. This is a first step towards removing InitializationSequence::SequenceKind. No functionality change.

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

13 years agoMore std::initializer_list tests.
Sebastian Redl [Sun, 5 Jun 2011 12:23:21 +0000 (12:23 +0000)]
More std::initializer_list tests.

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

13 years agoParse C++0x generalized initializers.
Sebastian Redl [Sun, 5 Jun 2011 12:23:16 +0000 (12:23 +0000)]
Parse C++0x generalized initializers.

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

13 years agoExpand on braced init list tests.
Sebastian Redl [Sun, 5 Jun 2011 12:23:08 +0000 (12:23 +0000)]
Expand on braced init list tests.

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

13 years agoIdentity and non-identity standard conversion sequences can be
Douglas Gregor [Sun, 5 Jun 2011 06:15:20 +0000 (06:15 +0000)]
Identity and non-identity standard conversion sequences can be
compared even when one is a reference binding and the other is not
(<rdar://problem/9173984>), but the definition of an identity sequence
does not involve lvalue-to-rvalue adjustments (PR9507). Fix both
inter-related issues.

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

13 years agoAdd name mangling for expr .* expr. Fixes PR9983 / <rdar://problem/9486332>.
Douglas Gregor [Sun, 5 Jun 2011 05:27:58 +0000 (05:27 +0000)]
Add name mangling for expr .* expr. Fixes PR9983 / <rdar://problem/9486332>.

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

13 years agoAllow block returns in C++ with the form
Douglas Gregor [Sun, 5 Jun 2011 05:14:41 +0000 (05:14 +0000)]
Allow block returns in C++ with the form

  return <expression> ;

in blocks with a 'void' result type, so long as <expression> has type
'void'. This follows the rules for C++ functions.

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