[cfe-commits] implement all_decls for PCH

Nick Lewycky nlewycky at google.com
Sat Apr 14 19:34:25 PDT 2012


This patch fixes the all_decls iterator to work with PCH, as requested
by Doug on r153970. As one of the testcases, this includes a complete
copy of Matthias Kleine's patch here:
  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-April/020756.html
which it also fixes.

This patch works by exposing the ASTReader's completeVisibleDeclsMap
API through ExternalASTSource, and also reimplementing it because the
existing implementation would fail for a CXXRecord that contained
constructor, destructor or conversion operator.

Doing that necessitated adding a new iterator to the OnDiskHashTable
called a data_iterator. This is an iterator that never attempts to
reconstruct an external_key, only using the internal_key. That allows
us to use it with a Trait that deliberately produces keys without
enough information to recover the external_key. For example, we don't
want to store the type of the destructor in the key of the name lookup
table, which would be necessary to reconstruct the DeclarationName.
Now, an attempt to instantiate
ASTDeclContextNameLookupTable::key_iterator or
ASTDeclContextNameLookupTable::item_iterator will fail at compile
time.

Please review!

Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: complete-visibledeclsmap-externalstorage-2.patch
Type: text/x-diff
Size: 16405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120414/77f7ec3f/attachment.patch>


More information about the cfe-commits mailing list