Rework our handling of key functions. We used to track a complete list of all
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 28 Feb 2015 01:01:56 +0000 (01:01 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 28 Feb 2015 01:01:56 +0000 (01:01 +0000)
commit91c18de7556f9524c62f655ccdda94adf3848092
tree2ce3a4ad6be2f320764a5d4d27d23e728132224c
parentf986d68b363a961a8bde29fcab649d46aaf23445
Rework our handling of key functions. We used to track a complete list of all
dynamic classes in the translation unit and check whether each one's key
function is defined when we got to the end of the TU (and when we got to the
end of each module). This is really terrible for modules performance, since it
causes unnecessary deserialization of every dynamic class in every compilation.

We now use a much simpler (and, in a modules build, vastly more efficient)
system: when we see an out-of-line definition of a virtual function, we check
whether that function was in fact its class's key function. (If so, we need to
emit the vtable.)

llvm-svn: 230830
14 files changed:
clang/include/clang/Sema/ExternalSemaSource.h
clang/include/clang/Sema/MultiplexExternalSemaSource.h
clang/include/clang/Sema/Sema.h
clang/include/clang/Serialization/ASTBitCodes.h
clang/include/clang/Serialization/ASTReader.h
clang/lib/Sema/MultiplexExternalSemaSource.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/CodeGenCXX/arm64.cpp
clang/test/CodeGenCXX/cxx11-vtable-key-function.cpp
clang/test/CodeGenCXX/key-function-vtable.cpp