aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-23 08:35:12 +0000
committerChris Lattner <sabre@nondot.org>2010-11-23 08:35:12 +0000
commit39b49bcaaddb1049234fca9500c0ac02c088e23d (patch)
tree4f7ac9da3cf2bcbad0aebfb781b7635462b431cf /include
parent458b5e25052a1052eb873f9145298e0f0aa75cd1 (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/ASTImporter.h7
-rw-r--r--include/clang/Basic/FileManager.h18
-rw-r--r--include/clang/Basic/SourceManager.h6
-rw-r--r--include/clang/Frontend/CompilerInstance.h5
-rw-r--r--include/clang/Frontend/Utils.h2
-rw-r--r--include/clang/Lex/HeaderMap.h7
-rw-r--r--include/clang/Lex/HeaderSearch.h6
-rw-r--r--include/clang/Lex/PTHManager.h1
-rw-r--r--include/clang/Lex/Preprocessor.h3
-rw-r--r--include/clang/Serialization/ASTReader.h4
10 files changed, 12 insertions, 47 deletions
diff --git a/include/clang/AST/ASTImporter.h b/include/clang/AST/ASTImporter.h
index b698522e01..e9245ee958 100644
--- a/include/clang/AST/ASTImporter.h
+++ b/include/clang/AST/ASTImporter.h
@@ -28,7 +28,6 @@ namespace clang {
class Diagnostic;
class Expr;
class FileManager;
- class FileSystemOptions;
class IdentifierInfo;
class NestedNameSpecifier;
class Stmt;
@@ -47,8 +46,6 @@ namespace clang {
/// \brief The file managers we're importing to and from.
FileManager &ToFileManager, &FromFileManager;
- const FileSystemOptions &ToFileSystemOpts, &FromFileSystemOpts;
-
/// \brief Mapping from the already-imported types in the "from" context
/// to the corresponding types in the "to" context.
llvm::DenseMap<Type *, Type *> ImportedTypes;
@@ -75,9 +72,7 @@ namespace clang {
public:
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager,
- const FileSystemOptions &ToFileSystemOpts,
- ASTContext &FromContext, FileManager &FromFileManager,
- const FileSystemOptions &FromFileSystemOpts);
+ ASTContext &FromContext, FileManager &FromFileManager);
virtual ~ASTImporter();
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h
index d5d2da7c26..5a143e9441 100644
--- a/include/clang/Basic/FileManager.h
+++ b/include/clang/Basic/FileManager.h
@@ -14,6 +14,7 @@
#ifndef LLVM_CLANG_FILEMANAGER_H
#define LLVM_CLANG_FILEMANAGER_H
+#include "clang/Basic/FileSystemOptions.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
@@ -33,7 +34,6 @@ class Path;
namespace clang {
class FileManager;
-class FileSystemOptions;
/// DirectoryEntry - Cached information about one directory on the disk.
///
@@ -141,7 +141,7 @@ public:
/// names (e.g. symlinked) will be treated as a single file.
///
class FileManager {
- const FileSystemOptions &FileSystemOpts;
+ FileSystemOptions FileSystemOpts;
class UniqueDirContainer;
class UniqueFileContainer;
@@ -196,32 +196,26 @@ public:
/// getDirectory - Lookup, cache, and verify the specified directory. This
/// returns null if the directory doesn't exist.
///
- const DirectoryEntry *getDirectory(llvm::StringRef Filename,
- const FileSystemOptions &FileSystemOpts);
+ const DirectoryEntry *getDirectory(llvm::StringRef Filename);
/// getFile - Lookup, cache, and verify the specified file. This returns null
/// if the file doesn't exist.
///
- const FileEntry *getFile(llvm::StringRef Filename,
- const FileSystemOptions &FileSystemOpts);
+ const FileEntry *getFile(llvm::StringRef Filename);
/// \brief Retrieve a file entry for a "virtual" file that acts as
/// if there were a file with the given name on disk. The file
/// itself is not accessed.
const FileEntry *getVirtualFile(llvm::StringRef Filename, off_t Size,
- time_t ModificationTime,
- const FileSystemOptions &FileSystemOpts);
+ time_t ModificationTime);
/// \brief Open the specified file as a MemoryBuffer, returning a new
/// MemoryBuffer if successful, otherwise returning null.
llvm::MemoryBuffer *getBufferForFile(const FileEntry *Entry,
- const FileSystemOptions &FileSystemOpts,
std::string *ErrorStr = 0) {
- return getBufferForFile(Entry->getName(), FileSystemOpts,
- ErrorStr, Entry->getSize());
+ return getBufferForFile(Entry->getName(), ErrorStr, Entry->getSize());
}
llvm::MemoryBuffer *getBufferForFile(llvm::StringRef Filename,
- const FileSystemOptions &FileSystemOpts,
std::string *ErrorStr = 0,
int64_t FileSize = -1);
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 9df5ffa2da..e02242882c 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -33,7 +33,6 @@ namespace clang {
class Diagnostic;
class SourceManager;
class FileManager;
-class FileSystemOptions;
class FileEntry;
class LineTableInfo;
@@ -372,7 +371,6 @@ class SourceManager {
Diagnostic &Diag;
FileManager &FileMgr;
- const FileSystemOptions &FileSystemOpts;
mutable llvm::BumpPtrAllocator ContentCacheAlloc;
@@ -431,8 +429,7 @@ class SourceManager {
explicit SourceManager(const SourceManager&);
void operator=(const SourceManager&);
public:
- SourceManager(Diagnostic &Diag, FileManager &FileMgr,
- const FileSystemOptions &FSOpts);
+ SourceManager(Diagnostic &Diag, FileManager &FileMgr);
~SourceManager();
void clearIDTables();
@@ -440,7 +437,6 @@ public:
Diagnostic &getDiagnostics() const { return Diag; }
FileManager &getFileManager() const { return FileMgr; }
- const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; }
//===--------------------------------------------------------------------===//
// MainFileID creation and querying methods.
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index f5d6221efc..5f47aa601e 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -515,8 +515,7 @@ public:
void createFileManager();
/// Create the source manager and replace any existing one with it.
- void createSourceManager(FileManager &FileMgr,
- const FileSystemOptions &FSOpts);
+ void createSourceManager(FileManager &FileMgr);
/// Create the preprocessor, using the invocation, file, and source managers,
/// and replace any existing one with it.
@@ -534,7 +533,6 @@ public:
const DependencyOutputOptions &,
const TargetInfo &,
const FrontendOptions &,
- const FileSystemOptions &,
SourceManager &, FileManager &);
/// Create the AST context.
@@ -635,7 +633,6 @@ public:
static bool InitializeSourceManager(llvm::StringRef InputFile,
Diagnostic &Diags,
FileManager &FileMgr,
- const FileSystemOptions &FSOpts,
SourceManager &SourceMgr,
const FrontendOptions &Opts);
diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h
index ff075445b4..fe722db381 100644
--- a/include/clang/Frontend/Utils.h
+++ b/include/clang/Frontend/Utils.h
@@ -39,7 +39,6 @@ class SourceManager;
class Stmt;
class TargetInfo;
class FrontendOptions;
-class FileSystemOptions;
/// Normalize \arg File for use in a user defined #include directive (in the
/// predefines buffer).
@@ -54,7 +53,6 @@ void ApplyHeaderSearchOptions(HeaderSearch &HS,
/// InitializePreprocessor - Initialize the preprocessor getting it and the
/// environment ready to process a single file.
void InitializePreprocessor(Preprocessor &PP,
- const FileSystemOptions &FSOpts,
const PreprocessorOptions &PPOpts,
const HeaderSearchOptions &HSOpts,
const FrontendOptions &FEOpts);
diff --git a/include/clang/Lex/HeaderMap.h b/include/clang/Lex/HeaderMap.h
index 4f17ae3ec3..8a5c83ecf4 100644
--- a/include/clang/Lex/HeaderMap.h
+++ b/include/clang/Lex/HeaderMap.h
@@ -21,7 +21,6 @@ namespace llvm {
namespace clang {
class FileEntry;
class FileManager;
- class FileSystemOptions;
struct HMapBucket;
struct HMapHeader;
@@ -44,13 +43,11 @@ public:
/// HeaderMap::Create - This attempts to load the specified file as a header
/// map. If it doesn't look like a HeaderMap, it gives up and returns null.
- static const HeaderMap *Create(const FileEntry *FE, FileManager &FM,
- const FileSystemOptions &FSOpts);
+ static const HeaderMap *Create(const FileEntry *FE, FileManager &FM);
/// LookupFile - Check to see if the specified relative filename is located in
/// this HeaderMap. If so, open it and return its FileEntry.
- const FileEntry *LookupFile(llvm::StringRef Filename, FileManager &FM,
- const FileSystemOptions &FileSystemOpts) const;
+ const FileEntry *LookupFile(llvm::StringRef Filename, FileManager &FM) const;
/// getFileName - Return the filename of the headermap.
const char *getFileName() const;
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index 7d467a5680..b8d5781a6d 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -23,7 +23,6 @@ namespace clang {
class ExternalIdentifierLookup;
class FileEntry;
class FileManager;
-class FileSystemOptions;
class IdentifierInfo;
/// HeaderFileInfo - The preprocessor keeps track of this information for each
@@ -72,8 +71,6 @@ struct HeaderFileInfo {
/// file referenced by a #include or #include_next, (sub-)framework lookup, etc.
class HeaderSearch {
FileManager &FileMgr;
- const FileSystemOptions &FileSystemOpts;
-
/// #include search path information. Requests for #include "x" search the
/// directory of the #including file first, then each directory in SearchDirs
/// consequtively. Requests for <x> search the current dir first, then each
@@ -120,11 +117,10 @@ class HeaderSearch {
explicit HeaderSearch(const HeaderSearch&);
void operator=(const HeaderSearch&);
public:
- HeaderSearch(FileManager &FM, const FileSystemOptions &FSOpts);
+ HeaderSearch(FileManager &FM);
~HeaderSearch();
FileManager &getFileMgr() const { return FileMgr; }
- const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; }
/// SetSearchPaths - Interface for setting the file search paths.
///
diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h
index a3787e3ffe..531ec11ea1 100644
--- a/include/clang/Lex/PTHManager.h
+++ b/include/clang/Lex/PTHManager.h
@@ -120,7 +120,6 @@ public:
/// Create - This method creates PTHManager objects. The 'file' argument
/// is the name of the PTH file. This method returns NULL upon failure.
static PTHManager *Create(const std::string& file, FileManager &FileMgr,
- const FileSystemOptions &FSOpts,
Diagnostic &Diags);
void setPreprocessor(Preprocessor *pp) { PP = pp; }
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 261daed75b..c2fcfe218e 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -35,7 +35,6 @@ namespace clang {
class SourceManager;
class ExternalPreprocessorSource;
class FileManager;
-class FileSystemOptions;
class FileEntry;
class HeaderSearch;
class PragmaNamespace;
@@ -58,7 +57,6 @@ class Preprocessor {
LangOptions Features;
const TargetInfo &Target;
FileManager &FileMgr;
- const FileSystemOptions &FileSystemOpts;
SourceManager &SourceMgr;
ScratchBuffer *ScratchBuf;
HeaderSearch &HeaderInfo;
@@ -281,7 +279,6 @@ public:
const LangOptions &getLangOptions() const { return Features; }
const TargetInfo &getTargetInfo() const { return Target; }
FileManager &getFileManager() const { return FileMgr; }
- const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; }
SourceManager &getSourceManager() const { return SourceMgr; }
HeaderSearch &getHeaderSearchInfo() const { return HeaderInfo; }
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index b92ca0b6a7..528ba15ecf 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -67,7 +67,6 @@ class ASTDeclReader;
class ASTStmtReader;
class ASTIdentifierLookupTrait;
class TypeLocReader;
-class FileSystemOptions;
struct HeaderFileInfo;
struct PCHPredefinesBlock {
@@ -194,7 +193,6 @@ private:
SourceManager &SourceMgr;
FileManager &FileMgr;
- const FileSystemOptions &FileSystemOpts;
Diagnostic &Diags;
/// \brief The semantic analysis object that will be processing the
@@ -808,7 +806,6 @@ public:
/// of its regular consistency checking, allowing the use of precompiled
/// headers that cannot be determined to be compatible.
ASTReader(SourceManager &SourceMgr, FileManager &FileMgr,
- const FileSystemOptions &FileSystemOpts,
Diagnostic &Diags, const char *isysroot = 0,
bool DisableValidation = false);
~ASTReader();
@@ -841,7 +838,6 @@ public:
/// the AST file, without actually loading the AST file.
static std::string getOriginalSourceFile(const std::string &ASTFileName,
FileManager &FileMgr,
- const FileSystemOptions &FSOpts,
Diagnostic &Diags);
/// \brief Returns the suggested contents of the predefines buffer,