Support chained aliases for LLVM IR printing. This fixes PR2145

llvm-svn: 48684
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index aba66c8..a2de5d9 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -1003,6 +1003,9 @@
       Out << getLLVMName(F->getName(), GlobalPrefix);
     else
       Out << "@\"\"";
+  } else if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Aliasee)) {
+    printType(GA->getType());
+    Out << " " << getLLVMName(GA->getName(), GlobalPrefix);
   } else {
     const ConstantExpr *CE = 0;
     if ((CE = dyn_cast<ConstantExpr>(Aliasee)) &&