aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-07-08 22:01:51 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-07-08 22:01:51 +0000
commita93e3b5bde9f0a7b59215f19f176f7d69881b81c (patch)
tree8370d623fa21547d38f09c84df7b6559531f8f91 /include/clang/Frontend
parent80db8cbff5afc047a23dbfe11f7ef787d891feec (diff)
Some preparatory work for chained PCH. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r--include/clang/Frontend/ASTConsumers.h2
-rw-r--r--include/clang/Frontend/CompilerInstance.h7
-rw-r--r--include/clang/Frontend/PCHBitCodes.h12
-rw-r--r--include/clang/Frontend/PCHWriter.h3
4 files changed, 19 insertions, 5 deletions
diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h
index e42b1f2cd9..5718979ba1 100644
--- a/include/clang/Frontend/ASTConsumers.h
+++ b/include/clang/Frontend/ASTConsumers.h
@@ -29,6 +29,7 @@ class CodeGenOptions;
class Diagnostic;
class FileManager;
class LangOptions;
+class PCHReader;
class Preprocessor;
class TargetOptions;
@@ -62,6 +63,7 @@ ASTConsumer *CreateDeclContextPrinter();
// times.
ASTConsumer *CreatePCHGenerator(const Preprocessor &PP,
llvm::raw_ostream *OS,
+ const PCHReader *Chain,
const char *isysroot = 0);
// Inheritance viewer: for C++ code, creates a graph of the inheritance
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index 06dc8004a6..54ce8bfe3b 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -34,6 +34,7 @@ class DiagnosticClient;
class ExternalASTSource;
class FileManager;
class FrontendAction;
+class PCHReader;
class Preprocessor;
class SourceManager;
class TargetInfo;
@@ -96,6 +97,9 @@ class CompilerInstance {
/// The list of active output files.
std::list< std::pair<std::string, llvm::raw_ostream*> > OutputFiles;
+ /// The PCH reader. Not owned; the ASTContext owns this.
+ PCHReader *Reader;
+
void operator=(const CompilerInstance &); // DO NOT IMPLEMENT
CompilerInstance(const CompilerInstance&); // DO NOT IMPLEMENT
public:
@@ -507,6 +511,9 @@ public:
createPCHExternalASTSource(llvm::StringRef Path, const std::string &Sysroot,
Preprocessor &PP, ASTContext &Context);
+ /// Get the PCH reader, if any.
+ PCHReader *getPCHReader() { return Reader; }
+
/// Create a code completion consumer using the invocation; note that this
/// will cause the source manager to truncate the input source file at the
/// completion point.
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h
index 4da96044c5..afa6d93ef2 100644
--- a/include/clang/Frontend/PCHBitCodes.h
+++ b/include/clang/Frontend/PCHBitCodes.h
@@ -30,10 +30,10 @@ namespace clang {
/// designed for the previous version could not support reading
/// the new version), this number should be increased.
///
- /// Version 3 of PCH files also requires that the version control branch and
+ /// Version 4 of PCH files also requires that the version control branch and
/// revision match exactly, since there is no backward compatibility of
/// PCH files at this time.
- const unsigned VERSION_MAJOR = 3;
+ const unsigned VERSION_MAJOR = 4;
/// \brief PCH minor version number supported by this version of
/// Clang.
@@ -47,7 +47,7 @@ namespace clang {
/// \brief An ID number that refers to a declaration in a PCH file.
///
- /// The ID numbers of types are consecutive (in order of
+ /// The ID numbers of declarations are consecutive (in order of
/// discovery) and start at 2. 0 is reserved for NULL, and 1 is
/// reserved for the translation unit declaration.
typedef uint32_t DeclID;
@@ -232,7 +232,11 @@ namespace clang {
VTABLE_USES = 24,
/// \brief Record code for the array of dynamic classes.
- DYNAMIC_CLASSES = 25
+ DYNAMIC_CLASSES = 25,
+
+ /// \brief Record code for the chained PCH metadata, including the
+ /// PCH version and the name of the PCH this is chained to.
+ CHAINED_METADATA = 26
};
diff --git a/include/clang/Frontend/PCHWriter.h b/include/clang/Frontend/PCHWriter.h
index 1e1ce51e4a..0b0c866bd6 100644
--- a/include/clang/Frontend/PCHWriter.h
+++ b/include/clang/Frontend/PCHWriter.h
@@ -39,6 +39,7 @@ class CXXBaseOrMemberInitializer;
class LabelStmt;
class MacroDefinition;
class MemorizeStatCalls;
+class PCHReader;
class Preprocessor;
class Sema;
class SourceManager;
@@ -257,7 +258,7 @@ public:
/// \param PPRec Record of the preprocessing actions that occurred while
/// preprocessing this file, e.g., macro instantiations
void WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
- const char* isysroot);
+ const PCHReader *Chain, const char* isysroot);
/// \brief Emit a source location.
void AddSourceLocation(SourceLocation Loc, RecordData &Record);