Commit Graph

18 Commits

Author SHA1 Message Date
Fariborz Jahanian 696c88753f [Objective-C Sema] It is permissable to bridge cast to 'id'
of a CFType bridged to some unknown Objective-C type. 
rdar://20113785

llvm-svn: 234545
2015-04-09 23:39:53 +00:00
John McCall af6b3f8ba6 Recognize objc_bridge(id) on bridged casts to CF types.
Fixes <rdar://20107345>.

llvm-svn: 231814
2015-03-10 18:41:23 +00:00
Ted Kremenek 435b4c786a Revert r194663 and r194647.
Per feedback from Jordan Rose I realized this wasn't the right way to go.

llvm-svn: 194664
2013-11-14 04:44:56 +00:00
Ted Kremenek 428b61dc14 Refine -Wunused-variable to only suppress warning for __bridge_transfer, not all bridge casts.
Also refine test case to capture the intention of this suppression.  Essentially
some developers use __bridge_transfer as if it were a safe CFRelease.

llvm-svn: 194663
2013-11-14 04:27:00 +00:00
Ted Kremenek f6171b3cdf Suppress -Wunused-variable when initializer uses bridge casts for memory management.
Fixes <rdar://problem/15432770>.

llvm-svn: 194647
2013-11-14 01:42:17 +00:00
Rafael Espindola 925213b0fa Add 'not' to commands that are expected to fail.
This is at least good documentation, but also opens the possibility of
using pipefail.

llvm-svn: 185652
2013-07-04 16:16:58 +00:00
Fariborz Jahanian ae5bbfc0d0 objc-arc: change per Jordy's comments.
// rdar://11923822

llvm-svn: 160902
2012-07-27 23:55:46 +00:00
Fariborz Jahanian 36986c6e0f objective-c arc: When function calls with known CFCreate naming convention
are cast to retainable types, only suggest CFBridgingRelease/
CFBridgingRetain and not the __bridge casts.
// rdar://11923822

llvm-svn: 160900
2012-07-27 22:37:07 +00:00
Fariborz Jahanian 84c97cafd0 revert r160839 for now.
llvm-svn: 160895
2012-07-27 21:34:23 +00:00
Fariborz Jahanian 226459efff objc-arc: When objects with known CF semantics are assigned to
retainable types in arc, only suggest CFBridgingRelease/
CFBridgingRetain and not the confusing __bridge casts.
// rdar://11923822

llvm-svn: 160839
2012-07-26 23:17:04 +00:00
Jordan Rose 288c421b3d Insert a space if necessary when suggesting CFBridgingRetain/Release.
This was a problem for people who write 'return(result);'

Also fix ARCMT's corresponding code, though there's no test case for this
because implicit casts like this are rejected by the migrator for being
ambiguous, and explicit casts have no problem.

<rdar://problem/11577346>

llvm-svn: 158130
2012-06-07 01:10:31 +00:00
Fariborz Jahanian 30febeb224 Look for declaration of CFBridgingRetain/CFBridgingRetain before
changing the diagnostic. Also use correct spelling for both.

llvm-svn: 149554
2012-02-01 22:56:20 +00:00
Fariborz Jahanian bcdc282d85 objc-arc: In various diagnostics mention
CFBridgingRetain/CFBridgingRelease calls instead
of __bridge_retained/__bridge_transfer casts as preferred
way of moving cf objects to arc land. // rdar://10207950

llvm-svn: 149449
2012-01-31 23:42:37 +00:00
Fariborz Jahanian 103ae5c48f objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832

llvm-svn: 146904
2011-12-19 21:06:15 +00:00
John McCall 9b0a7cea0f Make -fobjc-nonfragile-abi the -cc1 default, since it's the
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
2011-10-02 01:16:38 +00:00
John McCall 0c07bee8bd Only accept __bridge_retain in system headers, as Doug suggested.
llvm-svn: 133300
2011-06-17 21:56:12 +00:00
John McCall 0c32925aa0 As a hopefully temporary workaround for a header mistake, treat
__bridge_retain as a synonym for __bridge_retained.

llvm-svn: 133295
2011-06-17 21:23:37 +00:00
John McCall 31168b077c Automatic Reference Counting.
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.

llvm-svn: 133103
2011-06-15 23:02:42 +00:00