- Added Sema::AddFactoryMethodToGlobalPool and Sema::AddInstanceMethodToGlobalPool and DenseMaps. This will allow us to efficiently lookup a method from a selector given no type information (for the "id" data type).
- Fixed some funky "}
else {" indentation in Sema::ActOnAddMethodsToObjcDecl(). I'd prefer we stay away from this style...it wastes space and isn't any easier to read (from my perspective, at least:-)
- Changed Parser::ParseObjCInterfaceDeclList() to only call Action::ActOnAddMethodsToObjcDecl() when it actually has methods to add (since most interface have methods, this is a very minor cleanup).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index bfd6797..4236314 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -266,9 +266,10 @@
ParseDeclarationOrFunctionDefinition();
}
}
- /// Insert collected methods declarations into the @interface object.
- Actions.ActOnAddMethodsToObjcDecl(CurScope, interfaceDecl,
- &allMethods[0], allMethods.size());
+ if (allMethods.size())
+ /// Insert collected methods declarations into the @interface object.
+ Actions.ActOnAddMethodsToObjcDecl(CurScope, interfaceDecl,
+ &allMethods[0], allMethods.size());
}
/// Parse property attribute declarations.