diff options
author | Steve Naroff <snaroff@apple.com> | 2009-04-24 16:59:10 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-04-24 16:59:10 +0000 |
commit | b87eeaeadfe5c1299e47ae4f88993b930cea4886 (patch) | |
tree | 704575e72e5361fa3fad8ac1cf8b9b3bc3eff7b1 /clang/lib/Frontend/PCHReader.cpp | |
parent | 7049e79e451eabaa88a44cb491c95a4a915bd69e (diff) | |
download | bcm5719-llvm-b87eeaeadfe5c1299e47ae4f88993b930cea4886.tar.gz bcm5719-llvm-b87eeaeadfe5c1299e47ae4f88993b930cea4886.zip |
Use cast_or_null instead of ternary operator (suggested by Doug).
llvm-svn: 69975
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index d50ab8310b0..d97cf810baf 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/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++])); } |