diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 15 | ||||
-rw-r--r-- | include/clang/Frontend/PreprocessorOptions.h | 39 |
2 files changed, 46 insertions, 8 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index b7a48881ef..950da64c22 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -46,6 +46,14 @@ class TargetInfo; using namespace idx; +class PrecompiledPreamble { + llvm::sys::Path PreambleFile; + +public: + ~PrecompiledPreamble(); + +}; + /// \brief Utility class for loading a ASTContext from a PCH file. /// class ASTUnit { @@ -125,6 +133,7 @@ private: void CleanTemporaryFiles(); bool Parse(); + void BuildPrecompiledPreamble(); public: class ConcurrencyCheck { @@ -241,7 +250,8 @@ public: static ASTUnit *LoadFromCompilerInvocation(CompilerInvocation *CI, llvm::IntrusiveRefCntPtr<Diagnostic> Diags, bool OnlyLocalDecls = false, - bool CaptureDiagnostics = false); + bool CaptureDiagnostics = false, + bool PrecompilePreamble = false); /// LoadFromCommandLine - Create an ASTUnit from a vector of command line /// arguments, which must specify exactly one source file. @@ -264,7 +274,8 @@ public: bool OnlyLocalDecls = false, RemappedFile *RemappedFiles = 0, unsigned NumRemappedFiles = 0, - bool CaptureDiagnostics = false); + bool CaptureDiagnostics = false, + bool PrecompilePreamble = false); /// \brief Reparse the source files using the same command-line options that /// were originally used to produce this translation unit. diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h index e2c1ca25a2..05159335ad 100644 --- a/include/clang/Frontend/PreprocessorOptions.h +++ b/include/clang/Frontend/PreprocessorOptions.h @@ -62,21 +62,37 @@ public: std::vector<std::pair<std::string, const llvm::MemoryBuffer *> > RemappedFileBuffers; - typedef std::vector<std::pair<std::string, std::string> >::const_iterator + typedef std::vector<std::pair<std::string, std::string> >::iterator remapped_file_iterator; - remapped_file_iterator remapped_file_begin() const { + typedef std::vector<std::pair<std::string, std::string> >::const_iterator + const_remapped_file_iterator; + remapped_file_iterator remapped_file_begin() { return RemappedFiles.begin(); } - remapped_file_iterator remapped_file_end() const { + const_remapped_file_iterator remapped_file_begin() const { + return RemappedFiles.begin(); + } + remapped_file_iterator remapped_file_end() { + return RemappedFiles.end(); + } + const_remapped_file_iterator remapped_file_end() const { return RemappedFiles.end(); } typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >:: - const_iterator remapped_file_buffer_iterator; - remapped_file_buffer_iterator remapped_file_buffer_begin() const { + iterator remapped_file_buffer_iterator; + typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >:: + const_iterator const_remapped_file_buffer_iterator; + remapped_file_buffer_iterator remapped_file_buffer_begin() { + return RemappedFileBuffers.begin(); + } + const_remapped_file_buffer_iterator remapped_file_buffer_begin() const { return RemappedFileBuffers.begin(); } - remapped_file_buffer_iterator remapped_file_buffer_end() const { + remapped_file_buffer_iterator remapped_file_buffer_end() { + return RemappedFileBuffers.end(); + } + const_remapped_file_buffer_iterator remapped_file_buffer_end() const { return RemappedFileBuffers.end(); } @@ -92,9 +108,20 @@ public: void addRemappedFile(llvm::StringRef From, llvm::StringRef To) { RemappedFiles.push_back(std::make_pair(From, To)); } + + remapped_file_iterator eraseRemappedFile(remapped_file_iterator Remapped) { + return RemappedFiles.erase(Remapped); + } + void addRemappedFile(llvm::StringRef From, const llvm::MemoryBuffer * To) { RemappedFileBuffers.push_back(std::make_pair(From, To)); } + + remapped_file_buffer_iterator + eraseRemappedFile(remapped_file_buffer_iterator Remapped) { + return RemappedFileBuffers.erase(Remapped); + } + void clearRemappedFiles() { RemappedFiles.clear(); RemappedFileBuffers.clear(); |