[cfe-commits] r131254 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaDeclObjC.cpp
jahanian
fjahanian at apple.com
Fri May 13 11:07:52 PDT 2011
On May 13, 2011, at 8:46 AM, jahanian wrote:
>
> On May 12, 2011, at 6:09 PM, Douglas Gregor wrote:
>
>>
>> On May 12, 2011, at 3:04 PM, Fariborz Jahanian wrote:
>>
>>> Author: fjahanian
>>> Date: Thu May 12 17:04:39 2011
>>> New Revision: 131254
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=131254&view=rev
>>> Log:
>>> After issuing diagnostics on circular protocol list,
>>> don't build circular AST in protocol's protocol list
>>> when user code has introduced it. Indexer and other
>>> clients may crash. // rdar://9221614
>>
>> Excellent, thanks!
>>
>>> Modified:
>>> cfe/trunk/include/clang/Sema/Sema.h
>>> cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>>>
>>> Modified: cfe/trunk/include/clang/Sema/Sema.h
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=131254&r1=131253&r2=131254&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/include/clang/Sema/Sema.h (original)
>>> +++ cfe/trunk/include/clang/Sema/Sema.h Thu May 12 17:04:39 2011
>>> @@ -4739,7 +4739,8 @@
>>> void CheckForwardProtocolDeclarationForCircularDependency(
>>> IdentifierInfo *PName,
>>> SourceLocation &PLoc, SourceLocation PrevLoc,
>>> - const ObjCList<ObjCProtocolDecl> &PList);
>>> + const ObjCList<ObjCProtocolDecl> &PList,
>>> + bool &err);
>>
>> Why not just return true on error, as we commonly do in Clang? Does the reference variable have any benefit?
>
> Generally, we return 'true' when on first error detection routine returns. In this case, we want to detect as many cycles as we can and
> yet return the 'error' flag if any one was found. Probably can do the return thing too but I am sure it makes the code path unnecessarily
> more complicated. Will still look into this.
In r131297.
- Fariborz
More information about the cfe-commits
mailing list