From bca31b731b3eb6d4614e25c003355ec2446fc027 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 18 May 2015 05:35:52 +0000 Subject: [modules] Move implicit creation of ImportDecls for #includes transformed into module imports from the frontend into Sema where it belongs. llvm-svn: 237555 --- clang/lib/Frontend/CompilerInstance.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 2d8bb71ee18..9e017273cb2 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1612,25 +1612,6 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, Module, ImportLoc); } - // Determine whether we're in the #include buffer for a module. The #includes - // in that buffer do not qualify as module imports; they're just an - // implementation detail of us building the module. - bool IsInModuleIncludes = !getLangOpts().CurrentModule.empty() && - getSourceManager().getFileID(ImportLoc) == - getSourceManager().getMainFileID(); - - // If this module import was due to an inclusion directive, create an - // implicit import declaration to capture it in the AST. - if (IsInclusionDirective && hasASTContext() && !IsInModuleIncludes) { - TranslationUnitDecl *TU = getASTContext().getTranslationUnitDecl(); - ImportDecl *ImportD = ImportDecl::CreateImplicit(getASTContext(), TU, - ImportLoc, Module, - Path.back().second); - TU->addDecl(ImportD); - if (Consumer) - Consumer->HandleImplicitImportDecl(ImportD); - } - LastModuleImportLoc = ImportLoc; LastModuleImportResult = ModuleLoadResult(Module, false); return LastModuleImportResult; -- cgit v1.2.3