[PATCH] D29901: Modular Codegen: Add/use a bit in serialized function definitions to track whether they are the subject of modular codegen

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 11:54:34 PST 2017


dblaikie created this revision.

Some decls are created not where they are written, but in other module
files/users (implicit special members and function template implicit
specializations). To correctly identify them, use a bit next to the definition
to track the modular codegen property.

Possible improvement would be to store this bit on the Decl itself, rather than
a sidemap - happy to give that a whirl if it seems better. (actually it'd be
two bits, since 3 states are required - currently reflected by "not in the
map", "in the map with Always", "in the map with Never")

Discussed whether the module file bit could be omitted in favor of
reconstituting from the modular codegen decls list - best guess today is that
the efficiency improvement of not having to deserialize the whole list whenever
any function is queried by a module user is worth it for the small size
increase of this redundant (list + bit-on-def) representation.


https://reviews.llvm.org/D29901

Files:
  include/clang/AST/ExternalASTSource.h
  include/clang/Sema/MultiplexExternalSemaSource.h
  include/clang/Serialization/ASTReader.h
  lib/AST/ASTContext.cpp
  lib/AST/ExternalASTSource.cpp
  lib/Sema/MultiplexExternalSemaSource.cpp
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTReaderDecl.cpp
  lib/Serialization/ASTWriterDecl.cpp
  test/Modules/Inputs/codegen/foo.h
  test/Modules/Inputs/codegen/use.cpp
  test/Modules/codegen.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29901.88235.patch
Type: text/x-patch
Size: 9087 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170213/d98cb779/attachment.bin>


More information about the cfe-commits mailing list