summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Change large if body to early return. No functionality change.Jordy Rose2011-06-141-77/+78
| | | | llvm-svn: 132956
* [analyzer] Fix modeling of strnlen to be more conservative. Move tests we ↵Jordy Rose2011-06-141-23/+89
| | | | | | can't properly model (yet?) to string-fail.c. llvm-svn: 132955
* Make __gnu_inline__ functions in gnu99 mode work the same way as inline ↵Eli Friedman2011-06-131-1/+2
| | | | | | | | functions in gnu89 mode in terms of redefinitions. rdar://9559708 . llvm-svn: 132953
* Put local variables in appropriate debug info scope.Devang Patel2011-06-131-5/+5
| | | | | | This fixes radar 8757124. llvm-svn: 132949
* Put classes into anonymous namespaces.Benjamin Kramer2011-06-131-20/+26
| | | | llvm-svn: 132924
* Eliminate the -f[no]objc-infer-related-result-type flags; there's noDouglas Gregor2011-06-135-17/+1
| | | | | | reason to allow the user to control these semantics through a flag. llvm-svn: 132919
* Document CheckObjCMethodOverridesDouglas Gregor2011-06-131-1/+9
| | | | llvm-svn: 132917
* Give a diagnostic when using non-POD types in a va_argDavid Majnemer2011-06-131-1/+5
| | | | llvm-svn: 132905
* Improve the diagnostics generated for switch statements missing expressionsDavid Majnemer2011-06-131-4/+7
| | | | | | | - 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 llvm-svn: 132903
* Fix a broken index left over from before this function was converted toChandler Carruth2011-06-131-1/+1
| | | | | | handle memcpy and memmove. Spotted by Nico. llvm-svn: 132902
* Correct the spelling of instantiationDavid Majnemer2011-06-131-1/+1
| | | | llvm-svn: 132901
* Don't assert on initialized typedef declarations in classes:Richard Smith2011-06-122-7/+5
| | | | | | | | | | | | 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)' llvm-svn: 132890
* Added 'atomic' for objc properties.Fariborz Jahanian2011-06-111-0/+5
| | | | llvm-svn: 132879
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-1125-224/+769
| | | | llvm-svn: 132878
* Add code completetion code for the new 'atomic' attributeFariborz Jahanian2011-06-111-0/+2
| | | | | | keyword in objc property decl. llvm-svn: 132877
* Fix order of operands for the warning about incompatible Objective-CDouglas Gregor2011-06-111-1/+1
| | | | | | | pointer assignment in C++. This was a longstanding problem spotted by Jordy Rose. llvm-svn: 132873
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-1120-59/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 132868
* Restore 'atomic' as an attribute of objcFariborz Jahanian2011-06-112-2/+8
| | | | | | properties. llvm-svn: 132866
* PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to ↵Eli Friedman2011-06-102-3/+3
| | | | | | | | 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. llvm-svn: 132861
* __OBJC__ is also a standard predefined macro.Nick Lewycky2011-06-101-1/+3
| | | | llvm-svn: 132855
* This change is breaking selfhost. Revert it until I have more timeAlexis Hunt2011-06-102-109/+192
| | | | | | to study it. llvm-svn: 132843
* Implement caching of copy assignment operator lookup.Alexis Hunt2011-06-102-192/+109
| | | | | | | | | | | | | 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. llvm-svn: 132841
* [analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level ↵Jordy Rose2011-06-104-42/+22
| | | | | | | | 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. llvm-svn: 132840
* Implement caching for copy constructors in similar situations.Alexis Hunt2011-06-102-90/+58
| | | | llvm-svn: 132835
* Implement caching of default constructors on the resolution table. ThisAlexis Hunt2011-06-103-75/+192
| | | | | | | | isn't yet used for the less controlled environments of initialization. Also a few random text fixups. llvm-svn: 132833
* Made changes to how 'struct'/'class' mismatches are handled in ↵Richard Trieu2011-06-104-14/+72
| | | | | | | | | | | | | | | | | -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. llvm-svn: 132831
* Don't add objc method name mangling to locally declared function.Fariborz Jahanian2011-06-091-0/+6
| | | | | | // rdar://9566314 llvm-svn: 132791
* Handle overloaded operators in ?: precedence warningHans Wennborg2011-06-092-39/+86
| | | | | | | | | | | | | | 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. llvm-svn: 132784
* [analyzer] Ignore parentheses around block-level expressions when computing ↵Jordy Rose2011-06-091-3/+13
| | | | | | liveness. Fixes the other half of PR8962. llvm-svn: 132769
* [analyzer] Look through __extension__ expressions in a GRState's ↵Jordy Rose2011-06-081-6/+6
| | | | | | Environment. Fixes PR8962. llvm-svn: 132762
* Remove 'atomic' as a property attribute keyword.Fariborz Jahanian2011-06-082-8/+2
| | | | | | | It is not a sanctioned keyword and is assumed as default. // rdar://8790791 llvm-svn: 132753
* Followup to 132737; make two-character string explicit, add someStuart Hastings2011-06-081-1/+1
| | | | | | comments. rdar://problem/9037836 llvm-svn: 132752
* Modify a diagnostic introduced in r132612 to emit QualTypes directlyPeter Collingbourne2011-06-081-2/+2
| | | | | | | This fixes a memory error on FreeBSD (and is the right thing to do in any case). llvm-svn: 132750
* Fix a bunch more notes that were emitted even when the diagnostic theyChandler Carruth2011-06-081-6/+9
| | | | | | were intended for was suppressed. llvm-svn: 132746
* Revert "hack in my new variables for GCC"Chandler Carruth2011-06-081-20/+24
| | | | | | Very sorry for the accidental commit of WIP code. llvm-svn: 132745
* Fix a regression in the two-phase lookup diagnostics that switching theChandler Carruth2011-06-081-0/+3
| | | | | | | | 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. llvm-svn: 132744
* hack in my new variables for GCCChandler Carruth2011-06-081-24/+20
| | | | llvm-svn: 132743
* Clang support for ARM Uv/Uy/Uq inline-asm constraints.Stuart Hastings2011-06-072-5/+27
| | | | | | rdar://problem/9037836 llvm-svn: 132737
* Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386Joerg Sonnenberger2011-06-071-1/+1
| | | | | | may pick it up. This would create bad text relocations. llvm-svn: 132736
* More coherent diagnostic when a stack variable isFariborz Jahanian2011-06-071-2/+6
| | | | | | declared __weak objc-gc mode. // rdar://9666091. llvm-svn: 132731
* The macros defined by the language standard are still available even when theNick Lewycky2011-06-071-26/+37
| | | | | | | -undef flag is passed in. Also __ASSEMBLER__ with -x assembler-with-cpp. (Don't ask.) llvm-svn: 132708
* Catch the memory leak in a bucketAlexis Hunt2011-06-071-1/+2
| | | | llvm-svn: 132700
* Touchup to comments that weren't quite in sync with codeJonathan D. Turner2011-06-061-2/+3
| | | | llvm-svn: 132679
* Diagnose the condition in C++ [temp.expl.spec]p16 that prohibitsDouglas Gregor2011-06-062-3/+42
| | | | | | | specializing a member of an unspecialized template, and recover from such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>. llvm-svn: 132677
* Richard Smith was correct about how the sets should be computed forChandler Carruth2011-06-051-11/+8
| | | | | | | | | this. My suggestion assumed a viable erase method for iterators on SmallPtrSet. This patch restores his original pattern. llvm-svn: 132673
* Fix PR10053: Improve diagnostics and error recovery for code which some ↵Richard Smith2011-06-051-8/+140
| | | | | | compilers incorrectly accept due to a lack of proper support for two-phase name lookup. llvm-svn: 132672
* Toolchain support for Ubuntu Oneiric. Patch by Michael Wild!Benjamin Kramer2011-06-051-3/+6
| | | | llvm-svn: 132669
* Drop most of InitializationSequence::SequenceKind's values. They didn't ↵Sebastian Redl2011-06-051-56/+12
| | | | | | | | 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. llvm-svn: 132667
* Remove more references to FailedSequence.Sebastian Redl2011-06-051-3/+3
| | | | llvm-svn: 132666
* Remove all references to InitializationSequence::FailedSequence from outside ↵Sebastian Redl2011-06-055-17/+14
| | | | | | 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. llvm-svn: 132664
OpenPOWER on IntegriCloud