now the FileManager has a FileSystemOpts ivar, stop threading
FileSystemOpts through a ton of apis, simplifying a lot of code.
This also fixes a latent bug in ASTUnit where it would invoke
methods on FileManager without creating one in some code paths
in cindextext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120010 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 2bc362a..7de7d40 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -2584,8 +2584,7 @@
ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu->TUData);
FileManager &FMgr = CXXUnit->getFileManager();
- const FileEntry *File = FMgr.getFile(file_name, CXXUnit->getFileSystemOpts());
- return const_cast<FileEntry *>(File);
+ return const_cast<FileEntry *>(FMgr.getFile(file_name));
}
} // end: extern "C"
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp
index 60c9e19..7fb1e80 100644
--- a/tools/libclang/CIndexCodeCompletion.cpp
+++ b/tools/libclang/CIndexCodeCompletion.cpp
@@ -234,12 +234,12 @@
/// \brief Language options used to adjust source locations.
LangOptions LangOpts;
-
- /// \brief File manager, used for diagnostics.
- FileManager FileMgr;
FileSystemOptions FileSystemOpts;
+ /// \brief File manager, used for diagnostics.
+ FileManager FileMgr;
+
/// \brief Source manager, used for diagnostics.
SourceManager SourceMgr;
@@ -263,7 +263,7 @@
Diag(new Diagnostic(
llvm::IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs))),
FileMgr(FileSystemOpts),
- SourceMgr(*Diag, FileMgr, FileSystemOpts) {
+ SourceMgr(*Diag, FileMgr) {
if (getenv("LIBCLANG_OBJTRACKING")) {
++CodeCompletionResultObjects;
fprintf(stderr, "+++ %d completion results\n", CodeCompletionResultObjects);