From 9ffe5a352559434c6abb04639cea57f504767293 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 30 Jan 2017 05:00:26 +0000 Subject: Prototype of modules codegen First pass at generating weak definitions of inline functions from module files (& skipping (-O0) or emitting available_externally (optimizations) definitions where those modules are used). External functions defined in modules are emitted into the modular object file as well (this may turn an existing ODR violation (if that module were imported into multiple translations) into valid/linkable code). Internal symbols (static functions, for example) are not correctly supported yet. The symbol will be produced, internal, in the modular object - unreferenceable from the users. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D28845 llvm-svn: 293456 --- clang/lib/Sema/MultiplexExternalSemaSource.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/Sema/MultiplexExternalSemaSource.cpp') diff --git a/clang/lib/Sema/MultiplexExternalSemaSource.cpp b/clang/lib/Sema/MultiplexExternalSemaSource.cpp index 077a56f..c97e4df 100644 --- a/clang/lib/Sema/MultiplexExternalSemaSource.cpp +++ b/clang/lib/Sema/MultiplexExternalSemaSource.cpp @@ -94,6 +94,15 @@ MultiplexExternalSemaSource::GetExternalCXXCtorInitializers(uint64_t Offset) { return nullptr; } +ExternalASTSource::ExtKind +MultiplexExternalSemaSource::hasExternalDefinitions(unsigned int ID) { + for (const auto &S : Sources) + if (auto EK = S->hasExternalDefinitions(ID)) + if (EK != EK_ReplyHazy) + return EK; + return EK_ReplyHazy; +} + bool MultiplexExternalSemaSource:: FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) { bool AnyDeclsFound = false; -- cgit v1.1