From fba18aa8f2cd1994dc65e8cb9f4be201c560dc0b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 15 Sep 2011 22:00:41 +0000 Subject: Add an experimental flag -fauto-module-import that automatically turns #include or #import direcctives of framework headers into module imports of the corresponding framework module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139860 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/InitPreprocessor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Frontend/InitPreprocessor.cpp') diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 474de77f26..e70ecf9da8 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -710,6 +710,10 @@ void clang::InitializePreprocessor(Preprocessor &PP, InitializeFileRemapping(PP.getDiagnostics(), PP.getSourceManager(), PP.getFileManager(), InitOpts); + // Specify whether the preprocessor should replace #include/#import with + // module imports when plausible. + PP.setAutoModuleImport(InitOpts.AutoModuleImport); + // Emit line markers for various builtin sections of the file. We don't do // this in asm preprocessor mode, because "# 4" is not a line marker directive // in this mode. @@ -783,7 +787,7 @@ void clang::InitializePreprocessor(Preprocessor &PP, // Copy PredefinedBuffer into the Preprocessor. PP.setPredefines(Predefines.str()); - + // Initialize the header search object. ApplyHeaderSearchOptions(PP.getHeaderSearchInfo(), HSOpts, PP.getLangOptions(), -- cgit v1.2.3-18-g5258