- Jul 27, 2011
-
-
Douglas Gregor authored
llvm-svn: 136210
-
-
rdar://9615812Argyrios Kyrtzidis authored
- Replace calling -zone with 'nil'. -zone is obsolete in ARC. - Allow removing retain/release on a static global var. - Fix assertion hit when scanning for name references outside a NSAutoreleasePool scope. - Automatically add bridged casts for results of objc method calls and when calling CFRetain, for example: NSString *s; CFStringRef ref = [s string]; -> CFStringRef ref = (__bridge CFStringRef)([s string]); ref = s.string; -> ref = (__bridge CFStringRef)(s.string); ref = [NSString new]; -> ref = (__bridge_retained CFStringRef)([NSString new]); ref = [s newString]; -> ref = (__bridge_retained CFStringRef)([s newString]); ref = [[NSString alloc] init]; -> ref = (__bridge_retained CFStringRef)([[NSString alloc] init]); ref = [[s string] retain]; -> ref = (__bridge_retained CFStringRef)([s string]); ref = CFRetain(s); -> ref = (__bridge_retained CFTypeRef)(s); ref = [s retain]; -> ref = (__bridge_retained CFStringRef)(s); - Emit migrator error when trying to cast to CF type the result of autorelease/release: for CFStringRef f3() { return (CFStringRef)[[[NSString alloc] init] autorelease]; } emits: t.m:12:10: error: [rewriter] it is not safe to cast to 'CFStringRef' the result of 'autorelease' message; a __bridge cast may result in a pointer to a destroyed object and a __bridge_retained may leak the object return (CFStringRef)[[[NSString alloc] init] autorelease]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ t.m:12:3: note: [rewriter] remove the cast and change return type of function to 'NSString *' to have the object automatically autoreleased return (CFStringRef)[[[NSString alloc] init] autorelease]; ^ - Before changing attributes to weak/unsafe_unretained, check if the backing ivar is set to a +1 object, in which case use 'strong' instead. llvm-svn: 136208
-
Douglas Gregor authored
llvm-svn: 136207
-
John McCall authored
for-in statements; specifically, make sure to close over any temporaries or cleanups it might require. In ARC, this has implications for the lifetime of the collection, so emit it with a retain and release it upon exit from the loop. rdar://problem/9817306 llvm-svn: 136204
-
Francois Pichet authored
In Microsoft mode, if we are within a templated function and we can't resolve Identifier during BuildCXXNestedNameSpecifier, then extend the SS with Identifier. This will have the effect of resolving Identifier during template instantiation. The goal is to be able to resolve a function call whose nested-name-specifier is located inside a dependent base class. class C { public: static void foo2() { } }; template <class T> class A { public: typedef C D; }; template <class T> class B : public A<T> { public: void foo() { D::foo2(); } }; Note that this won't work if the NestedNameSpecifier refers to a type. This fixes 1 error when parsing the MSVC 2010 standard headers file with clang. llvm-svn: 136203
-
Eric Christopher authored
llvm-svn: 136192
-
Ted Kremenek authored
This required converting the StringMaps to use a BumpPtrAllocator. I measured the compile time and saw no observable regression. llvm-svn: 136190
-
Ted Kremenek authored
llvm-svn: 136189
-
Eric Christopher authored
llvm-svn: 136188
-
Eric Christopher authored
llvm-svn: 136185
-
Eli Friedman authored
llvm-svn: 136183
-
Eric Christopher authored
llvm-svn: 136182
-
Jeffrey Yasskin authored
[dcl.init.list] as is possible without generalized initializer lists or full constant expression support, and adds a c++0x-compat warning in C++98 mode. The FixIt currently uses a typedef's basename without qualification, which is likely to be incorrect on some code. If it's incorrect on too much code, we should write a function to get the string that refers to a type from a particular context. The warning is currently off by default. I'll fix LLVM and clang before turning it on. llvm-svn: 136181
-
Douglas Gregor authored
destructors of abstract classes. It's undefined behavior to actually call the destructor (e.g., via delete), but the presence of code that calls this destructor doesn't make the program ill-formed. Fixes <rdar://problem/9819242>. llvm-svn: 136180
-
Eric Christopher authored
llvm-svn: 136179
-
Eric Christopher authored
llvm-svn: 136177
-
Eric Christopher authored
llvm-svn: 136173
-
Eli Friedman authored
I'm not completely sure the standard allows us to reject this, but if it doesn't, it should. :) llvm-svn: 136172
-
Eric Christopher authored
llvm-svn: 136169
-
Eric Christopher authored
llvm-svn: 136168
-
Eric Christopher authored
build bots. llvm-svn: 136166
-
Anna Zaks authored
llvm-svn: 136165
-
Eric Christopher authored
llvm-svn: 136164
-
Eric Christopher authored
llvm-svn: 136163
-
Eric Christopher authored
llvm-svn: 136162
-
Eli Friedman authored
1. Attempting to delete an expression of incomplete class type should be an error, not a warning. 2. If someone tries to delete a pointer to an incomplete class type, make sure we actually emit the delete expression after we warn. llvm-svn: 136161
-
Eric Christopher authored
llvm-svn: 136160
-
Eric Christopher authored
most of them to FileCheck. llvm-svn: 136159
-
Eric Christopher authored
llvm-svn: 136158
-
- Jul 26, 2011
-
-
Argyrios Kyrtzidis authored
@interface Foo : NSObject @property (readonly) id myProp; @end @implementation Foo @synthesize myProp; @end t.m:9:13: error: ARC forbids synthesizing a property of an Objective-C object with unspecified storage attribute @synthesize myProp; ^ which is fine, we want the ownership of the synthesized ivar to be explicit. But we should _not_ emit an error for the following cases, because we can get the ownership either from the declared ivar or from the property type: @interface Foo : NSObject { __weak id _myProp1; id myProp2; } @property (readonly) id myProp1; @property (readonly) id myProp2; @property (readonly) __strong id myProp3; @end @implementation Foo @synthesize myProp1 = _myProp1; @synthesize myProp2; @synthesize myProp3; @end  rdar://9844006. llvm-svn: 136155
-
Eric Christopher authored
CodeGen/2003-08-21-WideString.c CodeGen/2003-10-02-UnionLValueError.c CodeGen/2004-02-20-Builtins.c CodeGen/2008-01-04-WideBitfield.c CodeGen/2002-07-14-MiscTests3.c CodeGen/2005-04-09-ComplexOps.c CodeGen/2008-12-23-AsmIntPointerTie.c CodeGen/2005-07-20-SqrtNoErrno.c CodeGen/2005-01-02-VAArgError-ICE.c CodeGen/2004-06-17-UnorderedCompares.c CodeGen/2002-06-25-FWriteInterfaceFailure.c CodeGen/2002-02-18-64bitConstant.c CodeGen/2002-05-24-Alloca.c CodeGen/2006-01-13-Includes.c CodeGen/2007-09-27-ComplexIntCompare.c CodeGen/2004-02-13-IllegalVararg.c CodeGen/2007-09-12-PragmaPack.c CodeGen/2002-08-02-UnionTest.c from test/FrontendC with changes to remove header file includes. llvm-svn: 136153
-
Ted Kremenek authored
Report more memory using in Preprocessor::getTotalMemory() and PreprocessingRecord::getTotalMemory(). Most of the memory was already reported; but now we report more memory from side data structures. Fixes <rdar://problem/9379717>. llvm-svn: 136150
-
Eric Christopher authored
to remove header file includes. llvm-svn: 136134
-
Eric Christopher authored
changes to remove any #include lines. llvm-svn: 136129
-
Eric Christopher authored
to avoid header inclusions. llvm-svn: 136128
-
Eric Christopher authored
modify to avoid any outside includes. llvm-svn: 136127
-
Eric Christopher authored
and modified to avoid includes. llvm-svn: 136126
-
Eric Christopher authored
llvm-svn: 136114
-
Kaelyn Uhrain authored
llvm-svn: 136113
-