diff options
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 15 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInstance.h | 9 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 9 | ||||
-rw-r--r-- | include/clang/Frontend/Utils.h | 2 |
4 files changed, 32 insertions, 3 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 45f771763d..980cd54cb3 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -21,6 +21,7 @@ #include "clang/Lex/PreprocessingRecord.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/FileManager.h" +#include "clang/Basic/FileSystemOptions.h" #include "clang-c/Index.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/OwningPtr.h" @@ -68,7 +69,9 @@ private: llvm::OwningPtr<TargetInfo> Target; llvm::OwningPtr<Preprocessor> PP; llvm::OwningPtr<ASTContext> Ctx; - + + FileSystemOptions FileSystemOpts; + /// \brief The AST consumer that received information about the translation /// unit as it was parsed or loaded. llvm::OwningPtr<ASTConsumer> Consumer; @@ -359,6 +362,8 @@ public: const FileManager &getFileManager() const { return *FileMgr; } FileManager &getFileManager() { return *FileMgr; } + const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; } + const std::string &getOriginalSourceFileName(); const std::string &getASTFileName(); @@ -452,7 +457,12 @@ public: unsigned cached_completion_size() const { return CachedCompletionResults.size(); } - + + llvm::MemoryBuffer *getBufferForFile(llvm::StringRef Filename, + std::string *ErrorStr = 0, + int64_t FileSize = -1, + struct stat *FileInfo = 0); + /// \brief Whether this AST represents a complete translation unit. /// /// If false, this AST is only a partial translation unit, e.g., one @@ -473,6 +483,7 @@ public: /// \returns - The initialized ASTUnit or null if the AST failed to load. static ASTUnit *LoadFromASTFile(const std::string &Filename, llvm::IntrusiveRefCntPtr<Diagnostic> Diags, + const FileSystemOptions &FileSystemOpts, bool OnlyLocalDecls = false, RemappedFile *RemappedFiles = 0, unsigned NumRemappedFiles = 0, diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index e5121e1bf9..3db6077029 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -220,6 +220,10 @@ public: return Invocation->getDiagnosticOpts(); } + const FileSystemOptions &getFileSystemOpts() const { + return Invocation->getFileSystemOpts(); + } + FrontendOptions &getFrontendOpts() { return Invocation->getFrontendOpts(); } @@ -499,7 +503,8 @@ public: void createFileManager(); /// Create the source manager and replace any existing one with it. - void createSourceManager(); + void createSourceManager(FileManager &FileMgr, + const FileSystemOptions &FSOpts); /// Create the preprocessor, using the invocation, file, and source managers, /// and replace any existing one with it. @@ -517,6 +522,7 @@ public: const DependencyOutputOptions &, const TargetInfo &, const FrontendOptions &, + const FileSystemOptions &, SourceManager &, FileManager &); /// Create the AST context. @@ -617,6 +623,7 @@ 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/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index aef02448f0..641c5f6650 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -12,6 +12,7 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetOptions.h" +#include "clang/Basic/FileSystemOptions.h" #include "clang/Frontend/AnalyzerOptions.h" #include "clang/Frontend/CodeGenOptions.h" #include "clang/Frontend/DependencyOutputOptions.h" @@ -52,6 +53,9 @@ class CompilerInvocation { /// Options controlling the diagnostic engine. DiagnosticOptions DiagnosticOpts; + /// Options controlling file system operations. + FileSystemOptions FileSystemOpts; + /// Options controlling the frontend itself. FrontendOptions FrontendOpts; @@ -126,6 +130,11 @@ public: DiagnosticOptions &getDiagnosticOpts() { return DiagnosticOpts; } const DiagnosticOptions &getDiagnosticOpts() const { return DiagnosticOpts; } + FileSystemOptions &getFileSystemOpts() { return FileSystemOpts; } + const FileSystemOptions &getFileSystemOpts() const { + return FileSystemOpts; + } + HeaderSearchOptions &getHeaderSearchOpts() { return HeaderSearchOpts; } const HeaderSearchOptions &getHeaderSearchOpts() const { return HeaderSearchOpts; diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index fe722db381..ff075445b4 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -39,6 +39,7 @@ 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). @@ -53,6 +54,7 @@ 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); |