diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
commit | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch) | |
tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /include/clang/Serialization/ASTReader.h | |
parent | c3b054d250cdca485c71845089c316e10610ebad (diff) | |
download | src-01af97d3b23bded2b2b21af19bbc6e4cce49e5b3.tar.gz src-01af97d3b23bded2b2b21af19bbc6e4cce49e5b3.zip |
Notes
Diffstat (limited to 'include/clang/Serialization/ASTReader.h')
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 424e78c391bc..da018ab99e65 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -69,6 +69,7 @@ class ASTStmtReader; class ASTIdentifierLookupTrait; class TypeLocReader; struct HeaderFileInfo; +class VersionTuple; struct PCHPredefinesBlock { /// \brief The file ID for this predefines buffer in a PCH file. @@ -213,6 +214,10 @@ private: /// \brief The AST consumer. ASTConsumer *Consumer; + /// \brief AST buffers for chained PCHs created and stored in memory. + /// First (not depending on another) PCH in chain is in front. + std::vector<llvm::MemoryBuffer *> ASTBuffers; + /// \brief Information that is needed for every module. struct PerFileData { PerFileData(ASTFileType Ty); @@ -806,7 +811,9 @@ private: /// /// This routine should only be used for fatal errors that have to /// do with non-routine failures (e.g., corrupted AST file). - void Error(const char *Msg); + void Error(llvm::StringRef Msg); + void Error(unsigned DiagID, llvm::StringRef Arg1 = llvm::StringRef(), + llvm::StringRef Arg2 = llvm::StringRef()); ASTReader(const ASTReader&); // do not implement ASTReader &operator=(const ASTReader &); // do not implement @@ -886,6 +893,13 @@ public: /// \brief Sets and initializes the given Context. void InitializeContext(ASTContext &Context); + /// \brief Set AST buffers for chained PCHs created and stored in memory. + /// First (not depending on another) PCH in chain is first in array. + void setASTMemoryBuffers(llvm::MemoryBuffer **bufs, unsigned numBufs) { + ASTBuffers.clear(); + ASTBuffers.insert(ASTBuffers.begin(), bufs, bufs + numBufs); + } + /// \brief Retrieve the name of the named (primary) AST file const std::string &getFileName() const { return Chain[0]->FileName; } @@ -1052,6 +1066,10 @@ public: /// \brief Print some statistics about AST usage. virtual void PrintStats(); + /// Return the amount of memory used by memory buffers, breaking down + /// by heap-backed versus mmap'ed memory. + virtual void getMemoryBufferSizes(MemoryBufferSizes &sizes) const; + /// \brief Initialize the semantic source with the Sema instance /// being used to perform semantic analysis on the abstract syntax /// tree. @@ -1108,7 +1126,7 @@ public: } /// \brief Read the source location entry with index ID. - virtual void ReadSLocEntry(unsigned ID); + virtual bool ReadSLocEntry(unsigned ID); Selector DecodeSelector(unsigned Idx); @@ -1197,6 +1215,9 @@ public: // \brief Read a string std::string ReadString(const RecordData &Record, unsigned &Idx); + /// \brief Read a version tuple. + VersionTuple ReadVersionTuple(const RecordData &Record, unsigned &Idx); + CXXTemporary *ReadCXXTemporary(const RecordData &Record, unsigned &Idx); /// \brief Reads attributes from the current stream position. |