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 | acc04a9261fcbedf2687a44795209b26c0de318e (patch) | |
tree | 34dab620afc2592be13a4b3be68bb6f87ae4c6b5 /clang/Driver/RewriteTest.cpp | |
parent | ab4b7d36cdb4b234073d5081c1fa6748bc640e09 (diff) | |
download | bcm5719-llvm-acc04a9261fcbedf2687a44795209b26c0de318e.tar.gz bcm5719-llvm-acc04a9261fcbedf2687a44795209b26c0de318e.zip |
minor cleanups, make getNumInstanceMethods always return unsigned.
llvm-svn: 48423
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r-- | clang/Driver/RewriteTest.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index d72aaf282b2..7bdec9390a1 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/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 += ", "; |