summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend/PreprocessorOptions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Frontend/PreprocessorOptions.h')
-rw-r--r--include/clang/Frontend/PreprocessorOptions.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h
index c43a1fe..7ba7c5c 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
OpenPOWER on IntegriCloud