]> granicus.if.org Git - clang/commitdiff
Remove some redundant setup when preprocessing .pcm files.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 26 Jun 2017 20:15:21 +0000 (20:15 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 26 Jun 2017 20:15:21 +0000 (20:15 +0000)
Both of these steps are immediately overwritten by the FrontendAction setup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306325 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/SourceManager.cpp
lib/Frontend/FrontendAction.cpp

index fc4c6d3038012bb0fd49002d04a090a22bdca97b..3936afab21a43fb086e6994d22375e55d9df16fd 100644 (file)
@@ -359,15 +359,6 @@ void SourceManager::initializeForReplay(const SourceManager &Old) {
     return Clone;
   };
 
-  // Set up our main file ID as a copy of the old source manager's main file.
-  const SLocEntry &OldMainFile = Old.getSLocEntry(Old.getMainFileID());
-  assert(OldMainFile.isFile() && "main file is macro expansion?");
-  auto *MainCC = CloneContentCache(OldMainFile.getFile().getContentCache());
-  MemBufferInfos.push_back(MainCC);
-  setMainFileID(createFileID(MainCC, SourceLocation(),
-                             OldMainFile.getFile().getFileCharacteristic(),
-                             0, 0));
-
   // Ensure all SLocEntries are loaded from the external source.
   for (unsigned I = 0, N = Old.LoadedSLocEntryTable.size(); I != N; ++I)
     if (!Old.SLocEntryLoaded[I])
index 7c0b854648bddb9a1a7e4961da8901868b1787e0..f81a06b3186993ce24ae95ae01d6b7e2f455343c 100644 (file)
@@ -561,7 +561,6 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
     CI.setFileManager(&AST->getFileManager());
     CI.createSourceManager(CI.getFileManager());
     CI.getSourceManager().initializeForReplay(AST->getSourceManager());
-    CI.createPreprocessor(getTranslationUnitKind());
 
     // Set up the input file for replay purposes.
     auto Kind = AST->getInputKind();