summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-15 22:00:41 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-15 22:00:41 +0000
commit97eec24b0bc245fc96ac9615899c3d15a6bc8b3e (patch)
tree8e370157e8487174f6169a4c1431ba7d82ec3804 /clang/lib/Frontend/InitPreprocessor.cpp
parent112ec17e1b536cf292e168696b3ebcd173e249f3 (diff)
downloadbcm5719-llvm-97eec24b0bc245fc96ac9615899c3d15a6bc8b3e.tar.gz
bcm5719-llvm-97eec24b0bc245fc96ac9615899c3d15a6bc8b3e.zip
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. llvm-svn: 139860
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 474de77f267..e70ecf9da8c 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/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(),
OpenPOWER on IntegriCloud