diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-16 20:19:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-16 20:19:15 +0000 |
commit | c858105d41602a2dadb2efbc1af80a7b791ebac3 (patch) | |
tree | 3f2bc9d3680e813b3d64a07f840977cc6870b93b /Driver/RewriteTest.cpp | |
parent | 439e71f4be0148101281f72f10c9f8bf743e78bd (diff) |
minor cleanups, make getNumInstanceMethods always return unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r-- | Driver/RewriteTest.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index d72aaf282b..7bdec9390a 100644 --- a/Driver/RewriteTest.cpp +++ b/Driver/RewriteTest.cpp @@ -2348,9 +2348,7 @@ void RewriteTest::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols, for (int i = 0; i < NumProtocols; i++) { ObjCProtocolDecl *PDecl = Protocols[i]; // Output struct protocol_methods holder of method selector and type. - if (!objc_protocol_methods && - (PDecl->getNumInstanceMethods() > 0 - || PDecl->getNumClassMethods() > 0)) { + if (!objc_protocol_methods && !PDecl->isForwardDecl()) { /* struct protocol_methods { SEL _cmd; char *method_types; @@ -2363,8 +2361,8 @@ void RewriteTest::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols, objc_protocol_methods = true; } - int NumMethods = PDecl->getNumInstanceMethods(); - if(NumMethods > 0) { + if (PDecl->instmeth_begin() != PDecl->instmeth_end()) { + unsigned NumMethods = PDecl->getNumInstanceMethods(); /* struct _objc_protocol_method_list { int protocol_method_count; struct protocol_methods protocols[]; @@ -2397,7 +2395,7 @@ void RewriteTest::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols, } // Output class methods declared in this protocol. - NumMethods = PDecl->getNumClassMethods(); + int NumMethods = PDecl->getNumClassMethods(); if (NumMethods > 0) { /* struct _objc_protocol_method_list { int protocol_method_count; @@ -2460,7 +2458,7 @@ void RewriteTest::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols, "{\n\t0, \""; Result += PDecl->getName(); Result += "\", 0, "; - if (PDecl->getNumInstanceMethods() > 0) { + if (PDecl->instmeth_begin() != PDecl->instmeth_end()) { Result += "(struct _objc_protocol_method_list *)&_OBJC_PROTOCOL_INSTANCE_METHODS_"; Result += PDecl->getName(); Result += ", "; |