aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriterDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-21 18:22:14 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-21 18:22:14 +0000
commit0cef483f3b9d6a7f9fdbc5910d0a3ed64130e8e1 (patch)
treead7fdcfcf5bff9ee72ff1f7d16b2f10d03077e8e /lib/Frontend/PCHWriterDecl.cpp
parent5e895a87d001ea2e97f5201d22cc5241992ca5a2 (diff)
Implement PCH support for C++ namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriterDecl.cpp')
-rw-r--r--lib/Frontend/PCHWriterDecl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp
index d105382b43..e776d32454 100644
--- a/lib/Frontend/PCHWriterDecl.cpp
+++ b/lib/Frontend/PCHWriterDecl.cpp
@@ -42,6 +42,7 @@ namespace {
void VisitDecl(Decl *D);
void VisitTranslationUnitDecl(TranslationUnitDecl *D);
void VisitNamedDecl(NamedDecl *D);
+ void VisitNamespaceDecl(NamespaceDecl *D);
void VisitTypeDecl(TypeDecl *D);
void VisitTypedefDecl(TypedefDecl *D);
void VisitTagDecl(TagDecl *D);
@@ -99,6 +100,16 @@ void PCHDeclWriter::VisitNamedDecl(NamedDecl *D) {
Writer.AddDeclarationName(D->getDeclName(), Record);
}
+void PCHDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) {
+ VisitNamedDecl(D);
+ Writer.AddSourceLocation(D->getLBracLoc(), Record);
+ Writer.AddSourceLocation(D->getRBracLoc(), Record);
+ Writer.AddDeclRef(D->getNextNamespace(), Record);
+ Writer.AddDeclRef(D->getOriginalNamespace(), Record);
+ Writer.AddDeclRef(D->getAnonymousNamespace(), Record);
+ Code = pch::DECL_NAMESPACE;
+}
+
void PCHDeclWriter::VisitTypeDecl(TypeDecl *D) {
VisitNamedDecl(D);
Writer.AddTypeRef(QualType(D->getTypeForDecl(), 0), Record);