diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-06 01:18:35 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-06 01:18:35 +0000 |
commit | 53d6ded0edb70b04430cdaf7d02602799b4d4b07 (patch) | |
tree | a1ac310737a4c3c889940c87b0d39f8a53102ba6 /tools/libclang/Indexing.cpp | |
parent | cbeda892668c7e7e8f0785bc72d96d28fe9ba8df (diff) |
[libclang] Don't disable the preprocessing record while indexing so as
to not mess up with module building.
It was not worth trying to combine indexing without preprocessing record
and building modules with one because:
-just importing a module/PCH that was built with a pp record, enables it anyway
-the performance gain of indexing without the preprocessing record is insignificant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/Indexing.cpp')
-rw-r--r-- | tools/libclang/Indexing.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp index 0b12d82d30..6ea87eb95e 100644 --- a/tools/libclang/Indexing.cpp +++ b/tools/libclang/Indexing.cpp @@ -191,22 +191,12 @@ public: unsigned indexOptions, CXTranslationUnit cxTU) : IndexCtx(clientData, indexCallbacks, indexOptions, cxTU), - CXTU(cxTU), EnablePPDetailedRecordForModules(false) { } - - bool EnablePPDetailedRecordForModules; + CXTU(cxTU) { } virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { PreprocessorOptions &PPOpts = CI.getPreprocessorOpts(); - // We usually disable the preprocessing record for indexing even if the - // original preprocessing options had it enabled. Now that the indexing - // Preprocessor has been created (without a preprocessing record), re-enable - // the option in case modules are enabled, so that the detailed record - // option can be propagated when the module file is generated. - if (CI.getLangOpts().Modules && EnablePPDetailedRecordForModules) - PPOpts.DetailedRecord = true; - if (!PPOpts.ImplicitPCHInclude.empty()) { IndexCtx.importedPCH( CI.getFileManager().getFile(PPOpts.ImplicitPCHInclude)); @@ -402,17 +392,11 @@ static void clang_indexSourceFile_Impl(void *UserData) { // FIXME: Add a flag for modules. CacheCodeCompletionResults = TU_options & CXTranslationUnit_CacheCompletionResults; - if (TU_options & CXTranslationUnit_DetailedPreprocessingRecord) { - PPOpts.DetailedRecord = true; - } } - IndexAction->EnablePPDetailedRecordForModules - = PPOpts.DetailedRecord || - (TU_options & CXTranslationUnit_DetailedPreprocessingRecord); - - if (!requestedToGetTU) - PPOpts.DetailedRecord = false; + if (TU_options & CXTranslationUnit_DetailedPreprocessingRecord) { + PPOpts.DetailedRecord = true; + } DiagnosticErrorTrap DiagTrap(*Diags); bool Success = ASTUnit::LoadFromCompilerInvocationAction(CInvok.getPtr(), Diags, |