[cfe-commits] r160530 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h lib/StaticAnalyzer/Core/CheckerManager.cpp lib/StaticAnalyzer/Core/ExprEngineCXX.cpp lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp lib/StaticAnalyzer/Core/ExprEngineObjC.cpp

Jordan Rose jordan_rose at apple.com
Thu Jul 19 17:46:59 PDT 2012


On Jul 19, 2012, at 5:40 PM, Anna Zaks wrote:

>>> +ProgramStateRef ExprEngine::bindReturnValue(const CallEvent &Call,
>>> +                                            const LocationContext *LCtx,
>>> +                                            ProgramStateRef State) {
>>> +  const Expr *E = Call.getOriginExpr();
>>> +  if (!E)
>>> +    return State;
>>> +
>>> +  // Some method families have known return values.
>>> +  if (const ObjCMethodCall *Msg = dyn_cast<ObjCMethodCall>(&Call)) {
>>> +    switch (Msg->getMethodFamily()) {
>>> +    default:
>>> +      break;
>>> +    case OMF_autorelease:
>>> +    case OMF_retain:
>>> +    case OMF_self: {
>>> +      // These methods return their receivers.
>>> +      return State->BindExpr(E, LCtx, Msg->getReceiverSVal());
>>> +      break;
>>> +    }
>>> +    }
>>> +  }
>> 
>> The inner braces are not necessary anymore here. Also, you have a break after a return.
> 
> I'd like to keep the braces of the if since the switch is visually long (do we have a coding standard for unnecessary braces?).

Yes, I agree there. I meant the braces around the switch case.



More information about the cfe-commits mailing list