aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-19 22:13:20 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-19 22:13:20 +0000
commitc6fbbedb3e90ff2f04828c36fd839e01468679f5 (patch)
tree5f1f7fe2a21407403bdd85dd1c7262c6c2652d4a /lib/Frontend
parent1b058e8956ea29a7fb7649fdee2b80581dcbdf39 (diff)
Remove the capture, serialization, and deserialization of comment
ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/PCHReader.cpp15
-rw-r--r--lib/Frontend/PCHWriter.cpp20
2 files changed, 2 insertions, 33 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index 7d8fee94f0..e659ff047d 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -328,7 +328,7 @@ PCHReader::PCHReader(Preprocessor &PP, ASTContext *Context,
MethodPoolLookupTable(0), MethodPoolLookupTableData(0),
TotalSelectorsInMethodPool(0), SelectorOffsets(0),
TotalNumSelectors(0), MacroDefinitionOffsets(0),
- NumPreallocatedPreprocessingEntities(0), Comments(0), NumComments(0),
+ NumPreallocatedPreprocessingEntities(0),
isysroot(isysroot), NumStatHits(0), NumStatMisses(0),
NumSLocEntriesRead(0), NumStatementsRead(0),
NumMacrosRead(0), NumMethodPoolSelectorsRead(0), NumMethodPoolMisses(0),
@@ -346,7 +346,7 @@ PCHReader::PCHReader(SourceManager &SourceMgr, FileManager &FileMgr,
MethodPoolLookupTable(0), MethodPoolLookupTableData(0),
TotalSelectorsInMethodPool(0), SelectorOffsets(0),
TotalNumSelectors(0), MacroDefinitionOffsets(0),
- NumPreallocatedPreprocessingEntities(0), Comments(0), NumComments(0),
+ NumPreallocatedPreprocessingEntities(0),
isysroot(isysroot), NumStatHits(0), NumStatMisses(0),
NumSLocEntriesRead(0), NumStatementsRead(0),
NumMacrosRead(0), NumMethodPoolSelectorsRead(0), NumMethodPoolMisses(0),
@@ -1503,11 +1503,6 @@ PCHReader::ReadPCHBlock() {
MaybeAddSystemRootToFilename(OriginalFileName);
break;
- case pch::COMMENT_RANGES:
- Comments = (SourceRange *)BlobStart;
- NumComments = BlobLen / sizeof(SourceRange);
- break;
-
case pch::VERSION_CONTROL_BRANCH_REVISION: {
const std::string &CurBranch = getClangFullRepositoryVersion();
llvm::StringRef PCHBranch(BlobStart, BlobLen);
@@ -1938,12 +1933,6 @@ void PCHReader::ReadPreprocessedEntities() {
ReadDefinedMacros();
}
-void PCHReader::ReadComments(std::vector<SourceRange> &Comments) {
- Comments.resize(NumComments);
- std::copy(this->Comments, this->Comments + NumComments,
- Comments.begin());
-}
-
/// \brief Read and return the type at the given offset.
///
/// This routine actually reads the record corresponding to the type
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index df41ca1e59..4752cd3ea6 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -564,7 +564,6 @@ void PCHWriter::WriteBlockInfoBlock() {
RECORD(SOURCE_LOCATION_PRELOADS);
RECORD(STAT_CACHE);
RECORD(EXT_VECTOR_DECLS);
- RECORD(COMMENT_RANGES);
RECORD(VERSION_CONTROL_BRANCH_REVISION);
RECORD(UNUSED_STATIC_FUNCS);
RECORD(MACRO_DEFINITION_OFFSETS);
@@ -1306,24 +1305,6 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
}
}
-void PCHWriter::WriteComments(ASTContext &Context) {
- using namespace llvm;
-
- if (Context.Comments.empty())
- return;
-
- BitCodeAbbrev *CommentAbbrev = new BitCodeAbbrev();
- CommentAbbrev->Add(BitCodeAbbrevOp(pch::COMMENT_RANGES));
- CommentAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
- unsigned CommentCode = Stream.EmitAbbrev(CommentAbbrev);
-
- RecordData Record;
- Record.push_back(pch::COMMENT_RANGES);
- Stream.EmitRecordWithBlob(CommentCode, Record,
- (const char*)&Context.Comments[0],
- Context.Comments.size() * sizeof(SourceRange));
-}
-
//===----------------------------------------------------------------------===//
// Type Serialization
//===----------------------------------------------------------------------===//
@@ -2088,7 +2069,6 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
if (StatCalls && !isysroot)
WriteStatCache(*StatCalls, isysroot);
WriteSourceManagerBlock(Context.getSourceManager(), PP, isysroot);
- WriteComments(Context);
// Write the record of special types.
Record.clear();