exit(1);
}
+ llvm::OwningPtr<SourceManager> SourceMgr;
+
for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
const std::string &InFile = InputFilenames[i];
else {
/// Create a SourceManager object. This tracks and owns all the file
/// buffers allocated to a translation unit.
- SourceManager SourceMgr;
+ if (!SourceMgr)
+ SourceMgr.reset(new SourceManager());
+ else
+ SourceMgr->clearIDTables();
// Initialize language options, inferring file types from input filenames.
LangOptions LangInfo;
// Set up the preprocessor with these options.
DriverPreprocessorFactory PPFactory(InFile, Diags, LangInfo, *Target,
- SourceMgr, HeaderInfo);
+ *SourceMgr.get(), HeaderInfo);
llvm::OwningPtr<Preprocessor> PP(PPFactory.CreatePreprocessor());
continue;
ProcessInputFile(*PP, PPFactory, InFile);
- HeaderInfo.ClearFileInfo();
+ HeaderInfo.ClearFileInfo();
if (Stats)
- SourceMgr.PrintStats();
+ SourceMgr->PrintStats();
}
}
+
delete Target;
unsigned NumDiagnostics = Diags.getNumDiagnostics();