forked from OSchip/llvm-project
053f6c6c9e
ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046 |
||
---|---|---|
.. | ||
ASTConsumers.cpp | ||
ASTMerge.cpp | ||
ASTUnit.cpp | ||
CMakeLists.txt | ||
CacheTokens.cpp | ||
ChainedDiagnosticConsumer.cpp | ||
ChainedIncludesSource.cpp | ||
CompilerInstance.cpp | ||
CompilerInvocation.cpp | ||
CreateInvocationFromCommandLine.cpp | ||
DependencyFile.cpp | ||
DependencyGraph.cpp | ||
DiagnosticRenderer.cpp | ||
FrontendAction.cpp | ||
FrontendActions.cpp | ||
FrontendOptions.cpp | ||
HeaderIncludeGen.cpp | ||
InitHeaderSearch.cpp | ||
InitPreprocessor.cpp | ||
LangStandards.cpp | ||
LayoutOverrideSource.cpp | ||
LogDiagnosticPrinter.cpp | ||
Makefile | ||
MultiplexConsumer.cpp | ||
PrintPreprocessedOutput.cpp | ||
SerializedDiagnosticPrinter.cpp | ||
TextDiagnostic.cpp | ||
TextDiagnosticBuffer.cpp | ||
TextDiagnosticPrinter.cpp | ||
VerifyDiagnosticConsumer.cpp |