[cfe-commits] r161016 - /cfe/trunk/lib/Sema/SemaExprObjC.cpp
Jordan Rose
jordan_rose at apple.com
Mon Jul 30 18:07:44 PDT 2012
Author: jrose
Date: Mon Jul 30 20:07:43 2012
New Revision: 161016
URL: http://llvm.org/viewvc/llvm-project?rev=161016&view=rev
Log:
Explain why ACC_bottom should never occur in diagnosing ARC casts.
This is just a clarification on Fariborz's original patch, per e-mail
discussion. No functionality change.
Modified:
cfe/trunk/lib/Sema/SemaExprObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=161016&r1=161015&r2=161016&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Mon Jul 30 20:07:43 2012
@@ -2860,15 +2860,15 @@
<< castRange
<< castExpr->getSourceRange();
bool br = S.isKnownName("CFBridgingRelease");
- ACCResult CreateRule =
+ ACCResult CreateRule =
ARCCastChecker(S.Context, exprACTC, castACTC, true).Visit(castExpr);
+ assert(CreateRule != ACC_bottom && "This cast should already be accepted.");
if (CreateRule != ACC_plusOne)
{
DiagnosticBuilder DiagB = S.Diag(noteLoc, diag::note_arc_bridge);
addFixitForObjCARCConversion(S, DiagB, CCK, afterLParen,
castType, castExpr, "__bridge ", 0);
}
- assert (CreateRule != ACC_bottom);
if (CreateRule != ACC_plusZero)
{
DiagnosticBuilder DiagB = S.Diag(br ? castExpr->getExprLoc() : noteLoc,
@@ -2895,13 +2895,13 @@
<< castExpr->getSourceRange();
ACCResult CreateRule =
ARCCastChecker(S.Context, exprACTC, castACTC, true).Visit(castExpr);
+ assert(CreateRule != ACC_bottom && "This cast should already be accepted.");
if (CreateRule != ACC_plusOne)
{
DiagnosticBuilder DiagB = S.Diag(noteLoc, diag::note_arc_bridge);
addFixitForObjCARCConversion(S, DiagB, CCK, afterLParen,
castType, castExpr, "__bridge ", 0);
}
- assert (CreateRule != ACC_bottom);
if (CreateRule != ACC_plusZero)
{
DiagnosticBuilder DiagB = S.Diag(br ? castExpr->getExprLoc() : noteLoc,
More information about the cfe-commits
mailing list