[cfe-commits] r69969 - /cfe/trunk/lib/Frontend/PCHReader.cpp
Douglas Gregor
dgregor at apple.com
Fri Apr 24 09:44:53 PDT 2009
On Apr 24, 2009, at 9:08 AM, Steve Naroff wrote:
> Author: snaroff
> Date: Fri Apr 24 11:08:42 2009
> New Revision: 69969
>
> URL: http://llvm.org/viewvc/llvm-project?rev=69969&view=rev
> Log:
> Allow the next catoregory slot to be null.
>
> Modified:
> cfe/trunk/lib/Frontend/PCHReader.cpp
>
> Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69969&r1=69968&r2=69969&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
> +++ cfe/trunk/lib/Frontend/PCHReader.cpp Fri Apr 24 11:08:42 2009
> @@ -298,7 +298,9 @@
> for (unsigned I = 0; I != NumProtoRefs; ++I)
> ProtoRefs.push_back(cast<ObjCProtocolDecl>(Reader.GetDecl(Record
> [Idx++])));
> CD->setProtocolList(&ProtoRefs[0], NumProtoRefs, Reader.getContext
> ());
> - CD->setNextClassCategory(cast<ObjCCategoryDecl>(Reader.GetDecl
> (Record[Idx++])));
> + unsigned nextCat = Record[Idx++];
> + CD->setNextClassCategory(nextCat ?
> + cast<ObjCCategoryDecl>(Reader.GetDecl
> (nextCat)) : 0);
> CD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
Why not just use:
CD->setNextClassCategory(cast_or_null<ObjCCategoryDecl>(Reader.GetDecl
(Record[Idx++])));
?
- Doug
More information about the cfe-commits
mailing list