aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-04-24 16:59:10 +0000
committerSteve Naroff <snaroff@apple.com>2009-04-24 16:59:10 +0000
commit07772607284cd10cedf2365fac0e3d9b3332cfc6 (patch)
tree776891fcf377866923c89361d1b614188908d378 /lib/Frontend/PCHReader.cpp
parent81adc058eaf450b43671633b2ad92e8bfa08d9b3 (diff)
Use cast_or_null instead of ternary operator (suggested by Doug).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r--lib/Frontend/PCHReader.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index d50ab8310b..d97cf810ba 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -298,9 +298,7 @@ void PCHDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) {
for (unsigned I = 0; I != NumProtoRefs; ++I)
ProtoRefs.push_back(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++])));
CD->setProtocolList(&ProtoRefs[0], NumProtoRefs, Reader.getContext());
- unsigned nextCat = Record[Idx++];
- CD->setNextClassCategory(nextCat ?
- cast<ObjCCategoryDecl>(Reader.GetDecl(nextCat)) : 0);
+ CD->setNextClassCategory(cast_or_null<ObjCCategoryDecl>(Reader.GetDecl(Record[Idx++])));
CD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
}