Improve location information in the representation of namespace
aliases. Previously, the location of the alias was at the "namespace"
keyword. Now, it's on the identifier being declared (as is the custom
for Clang), and we keep a separate source location for the "namespace"
keyword.

Also, added a getSourceRange() member function to NamespaceAliasDecl
to correctly compute the source range.

Finally, removed a bunch of setters from NamespaceAliasDecl and gave
ASTReaderDecl friendship so that it could set the corresponding fields
directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112681 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index 413f544..9ac12fb 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -614,7 +614,7 @@
 
 void ASTDeclWriter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {
   VisitNamedDecl(D);
-  Writer.AddSourceLocation(D->getAliasLoc(), Record);
+  Writer.AddSourceLocation(D->getNamespaceLoc(), Record);
   Writer.AddSourceRange(D->getQualifierRange(), Record);
   Writer.AddNestedNameSpecifier(D->getQualifier(), Record);
   Writer.AddSourceLocation(D->getTargetNameLoc(), Record);