Skip to content

Commit

Permalink
Remove some redundant setup when preprocessing .pcm files.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zygoloid committed Jun 26, 2017
1 parent 9e788cd commit f2468c5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions lib/Basic/SourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
1 change: 0 additions & 1 deletion lib/Frontend/FrontendAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f2468c5

Please sign in to comment.