CleanTemporaryFiles();
PreprocessedEntitiesByFile.clear();
- if (!OverrideMainBuffer)
+ if (!OverrideMainBuffer) {
StoredDiagnostics.clear();
-
+ TopLevelDeclsInPreamble.clear();
+ }
+
// Create a file manager object to provide access to and cache the filesystem.
Clang.setFileManager(&getFileManager());
getSourceManager());
StoredDiagnostics[I].setLocation(Loc);
}
+ } else {
+ PreprocessorOpts.PrecompiledPreambleBytes.first = 0;
+ PreprocessorOpts.PrecompiledPreambleBytes.second = false;
}
llvm::OwningPtr<TopLevelDeclTrackerAction> Act;
}
// Remap files.
+ PreprocessorOptions &PPOpts = Invocation->getPreprocessorOpts();
+ for (PreprocessorOptions::remapped_file_buffer_iterator
+ R = PPOpts.remapped_file_buffer_begin(),
+ REnd = PPOpts.remapped_file_buffer_end();
+ R != REnd;
+ ++R) {
+ delete R->second;
+ }
Invocation->getPreprocessorOpts().clearRemappedFiles();
for (unsigned I = 0; I != NumRemappedFiles; ++I)
Invocation->getPreprocessorOpts().addRemappedFile(RemappedFiles[I].first,
FullSourceLoc Loc(StoredDiagnostics[I].getLocation(), SourceMgr);
StoredDiagnostics[I].setLocation(Loc);
}
+ } else {
+ PreprocessorOpts.PrecompiledPreambleBytes.first = 0;
+ PreprocessorOpts.PrecompiledPreambleBytes.second = false;
}
llvm::OwningPtr<SyntaxOnlyAction> Act;