aboutsummaryrefslogtreecommitdiff
path: root/include/clang
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 /include/clang
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 'include/clang')
-rw-r--r--include/clang/AST/ASTContext.h14
-rw-r--r--include/clang/AST/ExternalASTSource.h8
-rw-r--r--include/clang/Frontend/PCHBitCodes.h4
-rw-r--r--include/clang/Frontend/PCHReader.h14
-rw-r--r--include/clang/Frontend/PCHWriter.h1
-rw-r--r--include/clang/Parse/Action.h4
-rw-r--r--include/clang/Parse/Parser.h1
7 files changed, 1 insertions, 45 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 78b808c144..e77dcf86cc 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -259,19 +259,11 @@ class ASTContext {
/// this ASTContext object.
LangOptions LangOpts;
- /// \brief Whether we have already loaded comment source ranges from an
- /// external source.
- bool LoadedExternalComments;
-
/// MallocAlloc/BumpAlloc - The allocator objects used to create AST objects.
bool FreeMemory;
llvm::MallocAllocator MallocAlloc;
llvm::BumpPtrAllocator BumpAlloc;
- /// \brief Mapping from declarations to their comments, once we have
- /// already looked up the comment associated with a given declaration.
- llvm::DenseMap<const Decl *, std::string> DeclComments;
-
public:
const TargetInfo &Target;
IdentifierTable &Idents;
@@ -287,10 +279,6 @@ public:
QualType ObjCClassRedefinitionType;
QualType ObjCSelRedefinitionType;
- /// \brief Source ranges for all of the comments in the source file,
- /// sorted in order of appearance in the translation unit.
- std::vector<SourceRange> Comments;
-
SourceManager& getSourceManager() { return SourceMgr; }
const SourceManager& getSourceManager() const { return SourceMgr; }
void *Allocate(unsigned Size, unsigned Align = 8) {
@@ -357,8 +345,6 @@ public:
TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl; }
- const char *getCommentForDecl(const Decl *D);
-
// Builtin Types.
CanQualType VoidTy;
CanQualType BoolTy;
diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h
index 0670d1a620..b8d80bc897 100644
--- a/include/clang/AST/ExternalASTSource.h
+++ b/include/clang/AST/ExternalASTSource.h
@@ -58,14 +58,6 @@ public:
virtual ~ExternalASTSource();
- /// \brief Reads the source ranges that correspond to comments from
- /// an external AST source.
- ///
- /// \param Comments the contents of this vector will be
- /// replaced with the sorted set of source ranges corresponding to
- /// comments in the source code.
- virtual void ReadComments(std::vector<SourceRange> &Comments) = 0;
-
/// \brief Resolve a type ID into a type, potentially building a new
/// type.
virtual QualType GetType(uint32_t ID) = 0;
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h
index de7888e797..f975c497be 100644
--- a/include/clang/Frontend/PCHBitCodes.h
+++ b/include/clang/Frontend/PCHBitCodes.h
@@ -215,9 +215,7 @@ namespace clang {
/// generate the precompiled header.
ORIGINAL_FILE_NAME = 19,
- /// \brief Record code for the sorted array of source ranges where
- /// comments were encountered in the source code.
- COMMENT_RANGES = 20,
+ /// Record #20 intentionally left blank.
/// \brief Record code for the version control branch and revision
/// information of the compiler used to build this PCH file.
diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h
index 9ccd382dba..73c1bf4cce 100644
--- a/include/clang/Frontend/PCHReader.h
+++ b/include/clang/Frontend/PCHReader.h
@@ -310,12 +310,6 @@ private:
/// preprocessing record.
unsigned NumPreallocatedPreprocessingEntities;
- /// \brief A sorted array of source ranges containing comments.
- SourceRange *Comments;
-
- /// \brief The number of source ranges in the Comments array.
- unsigned NumComments;
-
/// \brief The set of external definitions stored in the the PCH
/// file.
llvm::SmallVector<uint64_t, 16> ExternalDefinitions;
@@ -566,14 +560,6 @@ public:
/// \brief Read preprocessed entities into the
virtual void ReadPreprocessedEntities();
- /// \brief Reads the source ranges that correspond to comments from
- /// an external AST source.
- ///
- /// \param Comments the contents of this vector will be
- /// replaced with the sorted set of source ranges corresponding to
- /// comments in the source code.
- virtual void ReadComments(std::vector<SourceRange> &Comments);
-
/// \brief Reads a TemplateArgumentLocInfo appropriate for the
/// given TemplateArgument kind.
TemplateArgumentLocInfo
diff --git a/include/clang/Frontend/PCHWriter.h b/include/clang/Frontend/PCHWriter.h
index df733b6cae..e006de524c 100644
--- a/include/clang/Frontend/PCHWriter.h
+++ b/include/clang/Frontend/PCHWriter.h
@@ -215,7 +215,6 @@ private:
const Preprocessor &PP,
const char* isysroot);
void WritePreprocessor(const Preprocessor &PP);
- void WriteComments(ASTContext &Context);
void WriteType(QualType T);
uint64_t WriteDeclContextLexicalBlock(ASTContext &Context, DeclContext *DC);
uint64_t WriteDeclContextVisibleBlock(ASTContext &Context, DeclContext *DC);
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 2954b946b4..b79e698d50 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -153,10 +153,6 @@ public:
/// an empty string if not. This is used for pretty crash reporting.
virtual std::string getDeclName(DeclPtrTy D) { return ""; }
- /// \brief Invoked for each comment in the source code, providing the source
- /// range that contains the comment.
- virtual void ActOnComment(SourceRange Comment) { }
-
//===--------------------------------------------------------------------===//
// Declaration Tracking Callbacks.
//===--------------------------------------------------------------------===//
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index f034aa10ce..411162b182 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -90,7 +90,6 @@ class Parser {
llvm::OwningPtr<PragmaHandler> PackHandler;
llvm::OwningPtr<PragmaHandler> UnusedHandler;
llvm::OwningPtr<PragmaHandler> WeakHandler;
- llvm::OwningPtr<clang::CommentHandler> CommentHandler;
/// Whether the '>' token acts as an operator or not. This will be
/// true except when we are parsing an expression within a C++