diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 6 | ||||
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index b6a1ac4492..dc314f1f07 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -110,6 +110,12 @@ namespace SrcMgr { Buffer.setPointer(B); Buffer.setInt(false); } + + /// \brief Get the underlying buffer, returning NULL if the buffer is not + /// yet available. + const llvm::MemoryBuffer *getRawBuffer() const { + return Buffer.getPointer(); + } /// \brief Replace the existing buffer (which will be deleted) /// with the given buffer. diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 56e73d9be4..b9db4beafd 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -21,6 +21,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Index/ASTLocation.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringMap.h" #include "llvm/System/Path.h" #include "llvm/Support/Timer.h" #include <map> @@ -28,6 +29,7 @@ #include <vector> #include <cassert> #include <utility> +#include <sys/types.h> namespace llvm { class MemoryBuffer; @@ -135,14 +137,21 @@ private: /// \brief The size of the source buffer that we've reserved for the main /// file within the precompiled preamble. unsigned PreambleReservedSize; - + + /// \brief Keeps track of the files that were used when computing the + /// preamble, with both their buffer size and their modification time. + /// + /// If any of the files have changed from one compile to the next, + /// the preamble must be thrown away. + llvm::StringMap<std::pair<off_t, time_t> > FilesInPreamble; + /// \brief When non-NULL, this is the buffer used to store the contents of /// the main file when it has been padded for use with the precompiled /// preamble. llvm::MemoryBuffer *SavedMainFileBuffer; /// \brief The group of timers associated with this translation unit. - llvm::OwningPtr<llvm::TimerGroup> TimerGroup; + llvm::OwningPtr<llvm::TimerGroup> TimerGroup; /// \brief The timers we've created from the various parses, reparses, etc. /// involved in this translation unit. |