]> granicus.if.org Git - clang/commit
The semantic checking that verifies whether an Objective-C method
authorDouglas Gregor <dgregor@apple.com>
Tue, 1 May 2012 23:07:34 +0000 (23:07 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 1 May 2012 23:07:34 +0000 (23:07 +0000)
commit8722ae8f6083cc27bef430e2815ceea77ffa0b28
treef302d8f896bc7708c9909c1194bcc207fa55e543
parente4c043d3fdd0f98ab724aa4f1419cec9985ea2c4
The semantic checking that verifies whether an Objective-C method
declared in a subclass has consistent parameter types with a method
having the same selector in a superclass performs a significant number
of lookups into the class hierarchy. In the example in
<rdar://problem/11004361>, we spend 4.7% of -fsyntax-only time in
these lookups.

Optimize away most of the calls to this routine
(Sema::CompareMethodParamsInBaseAndSuper) by first checking whether we
have ever seen *any* method with that selector (using the global
selector table). Since most selectors are unique, we can avoid the
cost of this name lookup in many cases, for a 3.3% speedup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155958 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/SemaDeclObjC.cpp