Read/write the identifier namespace in PCH for decls that may modify it.

We can now use a PCH'ed <map>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107617 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp
index 9f7264e..983d6db 100644
--- a/lib/Frontend/PCHWriterDecl.cpp
+++ b/lib/Frontend/PCHWriterDecl.cpp
@@ -161,6 +161,7 @@
 
 void PCHDeclWriter::VisitTagDecl(TagDecl *D) {
   VisitTypeDecl(D);
+  Record.push_back(D->getIdentifierNamespace());
   Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
   Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding
   Record.push_back(D->isDefinition());
@@ -212,6 +213,7 @@
 void PCHDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
   VisitDeclaratorDecl(D);
 
+  Record.push_back(D->getIdentifierNamespace());
   Record.push_back(D->getTemplatedKind());
   switch (D->getTemplatedKind()) {
   default: assert(false && "Unhandled TemplatedKind!");
@@ -787,6 +789,7 @@
 }
 
 void PCHDeclWriter::VisitFriendDecl(FriendDecl *D) {
+  VisitDecl(D);
   Record.push_back(D->Friend.is<TypeSourceInfo*>());
   if (D->Friend.is<TypeSourceInfo*>())
     Writer.AddTypeSourceInfo(D->Friend.get<TypeSourceInfo*>(), Record);
@@ -811,6 +814,7 @@
 void PCHDeclWriter::VisitClassTemplateDecl(ClassTemplateDecl *D) {
   VisitTemplateDecl(D);
 
+  Record.push_back(D->getIdentifierNamespace());
   Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
   if (D->getPreviousDeclaration() == 0) {
     // This ClassTemplateDecl owns the CommonPtr; write it.
@@ -899,6 +903,7 @@
 void PCHDeclWriter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
   VisitTemplateDecl(D);
 
+  Record.push_back(D->getIdentifierNamespace());
   Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
   if (D->getPreviousDeclaration() == 0) {
     // This FunctionTemplateDecl owns the CommonPtr; write it.