// Configure the various subsystems.
// FIXME: Should we retain the previous file manager?
FileSystemOpts = Clang.getFileSystemOpts();
- FileMgr.reset(new FileManager(Clang.getFileSystemOpts()));
+ FileMgr.reset(new FileManager(FileSystemOpts));
SourceMgr.reset(new SourceManager(getDiagnostics(), *FileMgr));
TheSema.reset();
Ctx.reset();
ConfigureDiags(Diags, 0, 0, *AST, /*CaptureDiagnostics=*/false);
AST->Diagnostics = Diags;
AST->Invocation.reset(CI);
- AST->FileMgr.reset(new FileManager(CI->getFileSystemOpts()));
+ AST->FileSystemOpts = CI->getFileSystemOpts();
+ AST->FileMgr.reset(new FileManager(AST->FileSystemOpts));
AST->SourceMgr.reset(new SourceManager(*Diags, *AST->FileMgr));
return AST.take();
AST.reset(new ASTUnit(false));
ConfigureDiags(Diags, ArgBegin, ArgEnd, *AST, CaptureDiagnostics);
AST->Diagnostics = Diags;
-
- AST->FileMgr.reset(new FileManager(FileSystemOptions()));
+
+ AST->FileSystemOpts = CI->getFileSystemOpts();
+ AST->FileMgr.reset(new FileManager(AST->FileSystemOpts));
AST->OnlyLocalDecls = OnlyLocalDecls;
AST->CaptureDiagnostics = CaptureDiagnostics;
AST->CompleteTranslationUnit = CompleteTranslationUnit;
/// \brief The CXCodeCompleteResults structure we allocate internally;
/// the client only sees the initial CXCodeCompleteResults structure.
struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults {
- AllocatedCXCodeCompleteResults();
+ AllocatedCXCodeCompleteResults(const FileSystemOptions& FileSystemOpts);
~AllocatedCXCodeCompleteResults();
/// \brief Diagnostics produced while performing code completion.
/// Used for debugging purposes only.
static llvm::sys::cas_flag CodeCompletionResultObjects;
-AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults()
+AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults(
+ const FileSystemOptions& FileSystemOpts)
: CXCodeCompleteResults(),
Diag(new Diagnostic(
llvm::IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs))),
+ FileSystemOpts(FileSystemOpts),
FileMgr(FileSystemOpts),
SourceMgr(*Diag, FileMgr) {
if (getenv("LIBCLANG_OBJTRACKING")) {
}
// Parse the resulting source file to find code-completion results.
- AllocatedCXCodeCompleteResults *Results = new AllocatedCXCodeCompleteResults;
+ AllocatedCXCodeCompleteResults *Results =
+ new AllocatedCXCodeCompleteResults(AST->getFileSystemOpts());
Results->Results = 0;
Results->NumResults = 0;