[cfe-commits] r165352 - /cfe/trunk/tools/libclang/Indexing.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Oct 5 18:18:36 PDT 2012


Author: akirtzidis
Date: Fri Oct  5 20:18:35 2012
New Revision: 165352

URL: http://llvm.org/viewvc/llvm-project?rev=165352&view=rev
Log:
[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.

Modified:
    cfe/trunk/tools/libclang/Indexing.cpp

Modified: cfe/trunk/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/Indexing.cpp?rev=165352&r1=165351&r2=165352&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/Indexing.cpp (original)
+++ cfe/trunk/tools/libclang/Indexing.cpp Fri Oct  5 20:18:35 2012
@@ -191,22 +191,12 @@
                          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 @@
     // 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,





More information about the cfe-commits mailing list