llvm-project/clang/lib/Rewrite/Frontend
Douglas Gregor 048fbfa302 Rework the traversal of Objective-C categories and extensions to
consider (sub)module visibility.

The bulk of this change replaces myriad hand-rolled loops over the
linked list of Objective-C categories/extensions attached to an
interface declaration with loops using one of the four new category
iterator kinds:

  visible_categories_iterator: Iterates over all visible categories
  and extensions, hiding any that have their "hidden" bit set. This is
  by far the most commonly used iterator.

  known_categories_iterator: Iterates over all categories and
  extensions, ignoring the "hidden" bit. This tends to be used for
  redeclaration-like traversals.

  visible_extensions_iterator: Iterates over all visible extensions,
  hiding any that have their "hidden" bit set.

  known_extensions_iterator: Iterates over all extensions, whether
  they are visible to normal name lookup or not.

The effect of this change is that any uses of the visible_ iterators
will respect module-import visibility. See the new tests for examples.

Note that the old accessors for categories and extensions are gone;
there are *Raw() forms for some of them, for those (few) areas of the
compiler that have to manipulate the linked list of categories
directly. This is generally discouraged.

Part two of <rdar://problem/10634711>.
 

llvm-svn: 172665
2013-01-16 23:00:23 +00:00
..
CMakeLists.txt Make libASTMatchers link its dependencies. libRewriteFrontend depends on libRewriteCore. 2012-11-16 17:30:58 +00:00
FixItRewriter.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
FrontendActions.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
HTMLPrint.cpp
InclusionRewriter.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
Makefile
RewriteMacros.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
RewriteModernObjC.cpp Rework the traversal of Objective-C categories and extensions to 2013-01-16 23:00:23 +00:00
RewriteObjC.cpp Rework the traversal of Objective-C categories and extensions to 2013-01-16 23:00:23 +00:00
RewriteTest.cpp