diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-23 00:14:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-23 00:14:00 +0000 |
commit | 4db64a461cb3442934afe43c83ed3f17f7c11c1d (patch) | |
tree | c9de870e2fa2e16f082b9e5124e32ac324b070c3 /include/clang/Frontend/PreprocessorOptions.h | |
parent | e4fb82839a762e632f63e195058015e2f1ca27a8 (diff) |
Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/PreprocessorOptions.h')
-rw-r--r-- | include/clang/Frontend/PreprocessorOptions.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h index c43a1feb8c..7ba7c5c38d 100644 --- a/include/clang/Frontend/PreprocessorOptions.h +++ b/include/clang/Frontend/PreprocessorOptions.h @@ -16,6 +16,10 @@ #include <utility> #include <vector> +namespace llvm { + class MemoryBuffer; +} + namespace clang { class Preprocessor; @@ -48,6 +52,12 @@ public: /// pair). std::vector<std::pair<std::string, std::string> > RemappedFiles; + /// \brief The set of file-to-buffer remappings, which take existing files + /// on the system (the first part of each pair) and gives them the contents + /// of the specified memory buffer (the second part of each pair). + std::vector<std::pair<std::string, const llvm::MemoryBuffer *> > + RemappedFileBuffers; + typedef std::vector<std::pair<std::string, std::string> >::const_iterator remapped_file_iterator; remapped_file_iterator remapped_file_begin() const { @@ -57,6 +67,15 @@ public: 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 { + return RemappedFileBuffers.begin(); + } + remapped_file_buffer_iterator remapped_file_buffer_end() const { + return RemappedFileBuffers.end(); + } + public: PreprocessorOptions() : UsePredefines(true) {} @@ -69,6 +88,9 @@ public: void addRemappedFile(llvm::StringRef From, llvm::StringRef To) { RemappedFiles.push_back(std::make_pair(From, To)); } + void addRemappedFile(llvm::StringRef From, const llvm::MemoryBuffer * To) { + RemappedFileBuffers.push_back(std::make_pair(From, To)); + } }; } // end namespace clang |