| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:
// expect-error{{candidate function has different number of parameters}}
will match the following error messages from Clang:
candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters
It will also match these other error messages:
candidate function
function has different number of parameters
number of parameters
This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:
87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)
llvm-svn: 146619
|
|
|
|
| |
llvm-svn: 146210
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
migrator:
-Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce
a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization
file inside this method.
-Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the
Diagnostic object.
-Ignore null source ranges.
llvm-svn: 146020
|
|
|
|
|
|
|
| |
methods with these attributes are sent to receivers
of 'id' type too. // rdar://10459930
llvm-svn: 145999
|
|
|
|
|
|
| |
the implementation.
llvm-svn: 145224
|
|
|
|
|
|
| |
__weak from a readonly property.
llvm-svn: 145210
|
|
|
|
|
|
| |
fix the test.
llvm-svn: 144146
|
|
|
|
|
|
| |
redundant 'strong'.
llvm-svn: 144136
|
|
|
|
|
|
| |
type is strong by default too. // rdar://10410903
llvm-svn: 144118
|
|
|
|
|
|
|
|
| |
'(strong)'
property attribute.
llvm-svn: 144078
|
|
|
|
|
|
|
|
| |
__unsafe_unretained
later on, or we will end up with a redundant '__unsafe_unretained'.
llvm-svn: 144059
|
|
|
|
| |
llvm-svn: 143980
|
|
|
|
|
|
|
|
|
| |
-Move __strong/__weak added to a property type to the property attribute,
e.g. "@property (assign) __weak Foo *prop;" --> "@property (weak) Foo *prop;"
-Remove (assign) in a property so that it becomes strong-by-default in ARC.
llvm-svn: 143979
|
|
|
|
|
|
| |
to objects of classes that don't support ARC weak
llvm-svn: 143976
|
|
|
|
| |
llvm-svn: 143887
|
|
|
|
| |
llvm-svn: 143886
|
|
|
|
|
|
| |
GC managed non-objc object memory.
llvm-svn: 143747
|
|
|
|
| |
llvm-svn: 143701
|
|
|
|
|
|
| |
object that it receives in ARC.
llvm-svn: 143700
|
|
|
|
|
|
| |
This allows the migrator to visit and fix them.
llvm-svn: 143699
|
|
|
|
| |
llvm-svn: 143698
|
|
|
|
|
|
| |
<rdar://problem/10245086>.
llvm-svn: 142571
|
|
|
|
| |
llvm-svn: 142407
|
|
|
|
|
|
|
|
| |
if possible,
instead of changing it to 'strong'. rdar://9984862.
llvm-svn: 142304
|
|
|
|
|
|
|
| |
passing/receiving CF objects at +0 to/from Objective-C methods
or audited C functions.
llvm-svn: 142219
|
|
|
|
| |
llvm-svn: 141462
|
|
|
|
| |
llvm-svn: 141434
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.
This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.
Most, though, it involved a perl script to translate a ton
of test cases.
Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.
llvm-svn: 140957
|
|
|
|
|
|
| |
annotated with cf_consumed attribute.
llvm-svn: 139709
|
|
|
|
| |
llvm-svn: 139262
|
|
|
|
|
|
| |
mingw and msvc.
llvm-svn: 139223
|
|
|
|
|
|
| |
of leftovers.
llvm-svn: 138971
|
|
|
|
|
|
|
|
| |
Objective-C method buffering(rdar://10056942)
Turned out the same issue existed for C++ inline methods.
llvm-svn: 138960
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and does the Sema on their body after the entire
class/category @implementation is seen. This change allows messaging
of forward private methods, as well as, access to
synthesized ivars of properties with foward synthesize
declarations; among others. In effect, this patch removes
several restrictions placed on objective-c due to in-place
semantics processing of methods.
This is part of // rdar://8843851.
llvm-svn: 138865
|
|
|
|
| |
llvm-svn: 138696
|
|
|
|
| |
llvm-svn: 138674
|
|
|
|
|
|
|
|
| |
into account
that assigning result of -retain means it should be strong. rdar://9931757.
llvm-svn: 137252
|
|
|
|
| |
llvm-svn: 136658
|
|
|
|
| |
llvm-svn: 136209
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
| |
C function) implementation
will be rejected with a compilation error in ARC mode, and a compiler warning otherwise.
This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free
to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP
llvm-svn: 135740
|
|
|
|
|
|
|
|
|
|
|
| |
pre-migration ARC errors.
-arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else
-arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file
rdar://9791454
llvm-svn: 135491
|
|
|
|
|
|
|
|
|
| |
add __attribute__((objc_precise_lifetime)) to make sure that the object
(and its data) will not get released before the var goes out-of-scope.
rdar://9206226
llvm-svn: 135382
|
|
|
|
|
|
| |
with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226
llvm-svn: 135381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
release];" since it's very likely
that, after migration, the object that was passed to 'setDelegate:' will not be properly retained, e.g:
-whatever {
id x = [[MyDoHicky alloc] init];
[someivar setDelegate: x]; // x won't get retained in ARC.
}
-dealloc {
[[someivar delegate] release]; // give migration error here.
}
rdar://8858009
llvm-svn: 135327
|
|
|
|
| |
llvm-svn: 135309
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
id x = ...
@try {
...
} @finally {
[x release];
}
Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown.
rdar://9398256
llvm-svn: 135301
|
|
|
|
|
|
| |
errors. rdar://9402555.
llvm-svn: 135213
|
|
|
|
|
|
|
|
| |
used.
Keep the error if the result is unused. rdar://9552694.
llvm-svn: 135209
|
|
|
|
|
|
|
|
|
|
|
| |
An unused autorelease is badness. If we remove it the receiver
will likely die immediately while previously it was kept alive
by the autorelease pool. This is bad practice in general, so leave it
and emit an error to force the user to restructure his code.
rdar://9599884
llvm-svn: 135193
|