[cfe-commits] r111471 - in /cfe/trunk: include/clang/AST/ASTConsumer.h include/clang/Serialization/ASTWriter.h include/clang/Serialization/PCHDeserializationListener.h include/clang/Serialization/PCHReader.h lib/Frontend/ASTUnit.cpp lib/Frontend/CompilerInstance.cpp lib/Frontend/FrontendAction.cpp lib/Serialization/GeneratePCH.cpp lib/Serialization/PCHReader.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Wed Aug 18 16:56:56 PDT 2010
Author: cornedbee
Date: Wed Aug 18 18:56:56 2010
New Revision: 111471
URL: http://llvm.org/viewvc/llvm-project?rev=111471&view=rev
Log:
Rename various classes from PCH to AST.
Modified:
cfe/trunk/include/clang/AST/ASTConsumer.h
cfe/trunk/include/clang/Serialization/ASTWriter.h
cfe/trunk/include/clang/Serialization/PCHDeserializationListener.h
cfe/trunk/include/clang/Serialization/PCHReader.h
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Frontend/FrontendAction.cpp
cfe/trunk/lib/Serialization/GeneratePCH.cpp
cfe/trunk/lib/Serialization/PCHReader.cpp
Modified: cfe/trunk/include/clang/AST/ASTConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTConsumer.h?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTConsumer.h (original)
+++ cfe/trunk/include/clang/AST/ASTConsumer.h Wed Aug 18 18:56:56 2010
@@ -19,7 +19,7 @@
class CXXRecordDecl;
class DeclGroupRef;
class HandleTagDeclDefinition;
- class PCHDeserializationListener; // layering violation because void* is ugly
+ class ASTDeserializationListener; // layering violation because void* is ugly
class SemaConsumer; // layering violation required for safe SemaConsumer
class TagDecl;
class VarDecl;
@@ -87,10 +87,10 @@
virtual void HandleVTable(CXXRecordDecl *RD, bool DefinitionRequired) {}
/// \brief If the consumer is interested in entities being deserialized from
- /// PCH, it should return a pointer to a PCHDeserializationListener here.
+ /// AST files, it should return a pointer to a ASTDeserializationListener here
///
- /// The return type is void* because PCHDS lives in Frontend.
- virtual PCHDeserializationListener *GetPCHDeserializationListener() { return 0; }
+ /// The return type is void* because ASTDS lives in Frontend.
+ virtual ASTDeserializationListener *GetASTDeserializationListener() { return 0; }
/// PrintStats - If desired, print any statistics.
virtual void PrintStats() {}
Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Wed Aug 18 18:56:56 2010
@@ -74,7 +74,7 @@
/// representation of a given abstract syntax tree and its supporting
/// data structures. This bitstream can be de-serialized via an
/// instance of the ASTReader class.
-class ASTWriter : public PCHDeserializationListener {
+class ASTWriter : public ASTDeserializationListener {
public:
typedef llvm::SmallVector<uint64_t, 64> RecordData;
@@ -460,7 +460,7 @@
bool hasChain() const { return Chain; }
- // PCHDeserializationListener implementation
+ // ASTDeserializationListener implementation
void SetReader(ASTReader *Reader);
void IdentifierRead(pch::IdentID ID, IdentifierInfo *II);
void TypeRead(pch::TypeID ID, QualType T);
@@ -489,7 +489,7 @@
const char *isysroot, llvm::raw_ostream *Out);
virtual void InitializeSema(Sema &S) { SemaPtr = &S; }
virtual void HandleTranslationUnit(ASTContext &Ctx);
- virtual PCHDeserializationListener *GetPCHDeserializationListener();
+ virtual ASTDeserializationListener *GetASTDeserializationListener();
};
} // end namespace clang
Modified: cfe/trunk/include/clang/Serialization/PCHDeserializationListener.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/PCHDeserializationListener.h?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/PCHDeserializationListener.h (original)
+++ cfe/trunk/include/clang/Serialization/PCHDeserializationListener.h Wed Aug 18 18:56:56 2010
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file defines the PCHDeserializationListener class, which is notified
+// This file defines the ASTDeserializationListener class, which is notified
// by the ASTReader whenever a type or declaration is deserialized.
//
//===----------------------------------------------------------------------===//
@@ -23,9 +23,9 @@
class ASTReader;
class QualType;
-class PCHDeserializationListener {
+class ASTDeserializationListener {
protected:
- virtual ~PCHDeserializationListener() {}
+ virtual ~ASTDeserializationListener() {}
public:
/// \brief Tell the listener about the reader.
Modified: cfe/trunk/include/clang/Serialization/PCHReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/PCHReader.h?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/PCHReader.h (original)
+++ cfe/trunk/include/clang/Serialization/PCHReader.h Wed Aug 18 18:56:56 2010
@@ -59,7 +59,7 @@
class LabelStmt;
class MacroDefinition;
class NamedDecl;
-class PCHDeserializationListener;
+class ASTDeserializationListener;
class Preprocessor;
class Sema;
class SwitchCase;
@@ -81,10 +81,10 @@
/// While reading an AST file, the ASTReader will call the methods of the
/// listener to pass on specific information. Some of the listener methods can
/// return true to indicate to the ASTReader that the information (and
-/// consequently the PCH file) is invalid.
-class PCHReaderListener {
+/// consequently the AST file) is invalid.
+class ASTReaderListener {
public:
- virtual ~PCHReaderListener();
+ virtual ~ASTReaderListener();
/// \brief Receives the language options.
///
@@ -124,9 +124,9 @@
virtual void ReadCounter(unsigned Value) {}
};
-/// \brief PCHReaderListener implementation to validate the information of
+/// \brief ASTReaderListener implementation to validate the information of
/// the PCH file against an initialized Preprocessor.
-class PCHValidator : public PCHReaderListener {
+class PCHValidator : public ASTReaderListener {
Preprocessor &PP;
ASTReader &Reader;
@@ -173,10 +173,10 @@
friend class ASTDeclReader;
private:
/// \brief The receiver of some callbacks invoked by ASTReader.
- llvm::OwningPtr<PCHReaderListener> Listener;
+ llvm::OwningPtr<ASTReaderListener> Listener;
/// \brief The receiver of deserialization events.
- PCHDeserializationListener *DeserializationListener;
+ ASTDeserializationListener *DeserializationListener;
SourceManager &SourceMgr;
FileManager &FileMgr;
@@ -566,8 +566,8 @@
void MaybeAddSystemRootToFilename(std::string &Filename);
- ASTReadResult ReadPCHCore(llvm::StringRef FileName);
- ASTReadResult ReadPCHBlock(PerFileData &F);
+ ASTReadResult ReadASTCore(llvm::StringRef FileName);
+ ASTReadResult ReadASTBlock(PerFileData &F);
bool CheckPredefinesBuffers();
bool ParseLineTable(llvm::SmallVectorImpl<uint64_t> &Record);
ASTReadResult ReadSourceManagerBlock(PerFileData &F);
@@ -618,7 +618,7 @@
/// \brief Load the PCH file without using any pre-initialized Preprocessor.
///
/// The necessary information to initialize a Preprocessor later can be
- /// obtained by setting a PCHReaderListener.
+ /// obtained by setting a ASTReaderListener.
///
/// \param SourceMgr the source manager into which the precompiled header
/// will be loaded.
@@ -643,15 +643,15 @@
/// \brief Load the precompiled header designated by the given file
/// name.
- ASTReadResult ReadPCH(const std::string &FileName);
+ ASTReadResult ReadAST(const std::string &FileName);
/// \brief Set the PCH callbacks listener.
- void setListener(PCHReaderListener *listener) {
+ void setListener(ASTReaderListener *listener) {
Listener.reset(listener);
}
/// \brief Set the PCH deserialization listener.
- void setDeserializationListener(PCHDeserializationListener *Listener);
+ void setDeserializationListener(ASTDeserializationListener *Listener);
/// \brief Set the Preprocessor to use.
void setPreprocessor(Preprocessor &pp);
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed Aug 18 18:56:56 2010
@@ -304,7 +304,7 @@
/// \brief Gathers information from ASTReader that will be used to initialize
/// a Preprocessor.
-class PCHInfoCollector : public PCHReaderListener {
+class PCHInfoCollector : public ASTReaderListener {
LangOptions &LangOpt;
HeaderSearch &HSI;
std::string &TargetTriple;
@@ -463,7 +463,7 @@
Reader->setListener(new PCHInfoCollector(LangInfo, HeaderInfo, TargetTriple,
Predefines, Counter));
- switch (Reader->ReadPCH(Filename)) {
+ switch (Reader->ReadAST(Filename)) {
case ASTReader::Success:
break;
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Wed Aug 18 18:56:56 2010
@@ -270,8 +270,8 @@
DisablePCHValidation));
Reader->setDeserializationListener(
- static_cast<PCHDeserializationListener *>(DeserializationListener));
- switch (Reader->ReadPCH(Path)) {
+ static_cast<ASTDeserializationListener *>(DeserializationListener));
+ switch (Reader->ReadAST(Path)) {
case ASTReader::Success:
// Set the predefines buffer as suggested by the PCH reader. Typically, the
// predefines buffer will be empty.
Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Wed Aug 18 18:56:56 2010
@@ -122,7 +122,7 @@
CI.getPreprocessorOpts().ImplicitPCHInclude,
CI.getPreprocessorOpts().DisablePCHValidation,
CI.getInvocation().getFrontendOpts().ChainedPCH?
- Consumer->GetPCHDeserializationListener() : 0);
+ Consumer->GetASTDeserializationListener() : 0);
if (!CI.getASTContext().getExternalSource())
goto failure;
}
Modified: cfe/trunk/lib/Serialization/GeneratePCH.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GeneratePCH.cpp?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GeneratePCH.cpp (original)
+++ cfe/trunk/lib/Serialization/GeneratePCH.cpp Wed Aug 18 18:56:56 2010
@@ -59,6 +59,6 @@
Buffer.clear();
}
-PCHDeserializationListener *PCHGenerator::GetPCHDeserializationListener() {
+ASTDeserializationListener *PCHGenerator::GetASTDeserializationListener() {
return &Writer;
}
Modified: cfe/trunk/lib/Serialization/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/PCHReader.cpp?rev=111471&r1=111470&r2=111471&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/PCHReader.cpp (original)
+++ cfe/trunk/lib/Serialization/PCHReader.cpp Wed Aug 18 18:56:56 2010
@@ -46,7 +46,7 @@
// PCH reader validator implementation
//===----------------------------------------------------------------------===//
-PCHReaderListener::~PCHReaderListener() {}
+ASTReaderListener::~ASTReaderListener() {}
bool
PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
@@ -460,7 +460,7 @@
{}
void
-ASTReader::setDeserializationListener(PCHDeserializationListener *Listener) {
+ASTReader::setDeserializationListener(ASTDeserializationListener *Listener) {
DeserializationListener = Listener;
if (DeserializationListener)
DeserializationListener->SetReader(this);
@@ -1419,7 +1419,7 @@
}
ASTReader::ASTReadResult
-ASTReader::ReadPCHBlock(PerFileData &F) {
+ASTReader::ReadASTBlock(PerFileData &F) {
llvm::BitstreamCursor &Stream = F.Stream;
if (Stream.EnterSubBlock(pch::PCH_BLOCK_ID)) {
@@ -1528,7 +1528,7 @@
}
// Load the chained file.
- switch(ReadPCHCore(llvm::StringRef(BlobStart, BlobLen))) {
+ switch(ReadASTCore(llvm::StringRef(BlobStart, BlobLen))) {
case Failure: return Failure;
// If we have to ignore the dependency, we'll have to ignore this too.
case IgnorePCH: return IgnorePCH;
@@ -1792,8 +1792,8 @@
return Failure;
}
-ASTReader::ASTReadResult ASTReader::ReadPCH(const std::string &FileName) {
- switch(ReadPCHCore(FileName)) {
+ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName) {
+ switch(ReadASTCore(FileName)) {
case Failure: return Failure;
case IgnorePCH: return IgnorePCH;
case Success: break;
@@ -1882,7 +1882,7 @@
return Success;
}
-ASTReader::ASTReadResult ASTReader::ReadPCHCore(llvm::StringRef FileName) {
+ASTReader::ASTReadResult ASTReader::ReadASTCore(llvm::StringRef FileName) {
Chain.push_back(new PerFileData());
PerFileData &F = *Chain.back();
@@ -1934,7 +1934,7 @@
}
break;
case pch::PCH_BLOCK_ID:
- switch (ReadPCHBlock(F)) {
+ switch (ReadASTBlock(F)) {
case Success:
break;
More information about the cfe-commits
mailing list