- 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
-
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
-
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
-
Eli Friedman authored
llvm-svn: 136183
-
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
-
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
-
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
-
- 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
-
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
-
Kaelyn Uhrain authored
llvm-svn: 136113
-
Jonathan D. Turner authored
This patch extends the previous patch by starting to incorporate more functionality, like lookup-by-name and exporting lookup tables, into the module manager. Methods now have documentation. A few more functions have been switched over to the new iterator style and away from manual/explicit iteration. Ultimately we want to move away from name lookup here, as symlinks make filenames not a safe unique value, but we use it here as a stopgap before better measures are in place (namely instead using FileEntry* from a global FileManager). llvm-svn: 136107
-
Fariborz Jahanian authored
in few more places and in each instance, fix up the type to the expected type. // rdar://9603056 llvm-svn: 136103
-
Benjamin Kramer authored
llvm-svn: 136092
-
Douglas Gregor authored
provides the partial Objective-C selector used in a code completion. From Connor Wakamo! llvm-svn: 136084
-
Douglas Gregor authored
that allocates an array of objects with a non-trivial destructor, be sure to mark the destructor is "used". Fixes PR10480 / <rdar://problem/9834317>. llvm-svn: 136081
-
Douglas Gregor authored
lifetime-qualified template parameter, ensure that the deduced template argument is a lifetime type. Fixes <rdar://problem/9828157>. llvm-svn: 136078
-
Chad Rosier authored
the preferred alignment. Thus, revert r135934, r135935, and r135940. llvm-svn: 136062
-
Chandler Carruth authored
refer to 'expansion' instead of 'instantiation'. llvm-svn: 136060
-
Chandler Carruth authored
llvm-svn: 136059
-
Chandler Carruth authored
'expansion' rather than 'instantiation' for macro source locations. llvm-svn: 136058
-
Chandler Carruth authored
etc. With this I think essentially all of the SourceManager APIs are converted. Comments and random other bits of cleanup should be all thats left. llvm-svn: 136057
-
Chandler Carruth authored
and various other 'expansion' based terms. I've tried to reformat where appropriate and catch as many references in comments but I'm going to do several more passes. Also I've tried to expand parameter names to be more clear where appropriate. llvm-svn: 136056
-
Chandler Carruth authored
llvm-svn: 136054
-
Chandler Carruth authored
to isMacroArgExpansion. llvm-svn: 136053
-
Kaelyn Uhrain authored
and to work with pointer arithmetic in addition to array indexing. The new pointer arithmetic porition of the array bounds checking can be turned on by -Warray-bounds-pointer-arithmetic (and is off by default). llvm-svn: 136046
-
Kaelyn Uhrain authored
llvm-svn: 136044
-
- Jul 25, 2011
-
-
Fariborz Jahanian authored
to declare a static object. // rdar://9603056 llvm-svn: 135970
-
Chandler Carruth authored
SourceManager and FullSourceLoc. llvm-svn: 135969
-
Chandler Carruth authored
SourceManager and FullSourceLoc. llvm-svn: 135965
-
Chandler Carruth authored
llvm-svn: 135962
-
Chandler Carruth authored
llvm-svn: 135961
-
Chandler Carruth authored
getImmediateExpansionRange. llvm-svn: 135960
-
Jonathan D. Turner authored
Refactor of how modules are handled in ASTReader to remove explicit uses of a chain of AST files, instead redirect calls through a module manager. This should help move toward a DAG and the potential of loading multiple, unrelated PCH files. It's still early in development. llvm-svn: 135957
-
Chad Rosier authored
FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI. Also part of rdar://9802874 llvm-svn: 135940
-
Axel Naumann authored
Pick up expected diagnostics not only in the main file but also in the file where the first diagnostic occurred. Useful if the main file is not relevant (like with cling). By Vassil Vassilev. llvm-svn: 135936
-