From: Jay Foad Date: Mon, 1 Aug 2011 12:29:14 +0000 (+0000) Subject: Simplify printAlias. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8d948652f2d6d68023f8cec7ba60e9aed2720bd1;p=oota-llvm.git Simplify printAlias. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136611 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 825a7c1b66f..de993eec69f 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1397,27 +1397,8 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) { if (Aliasee == 0) { TypePrinter.print(GA->getType(), Out); Out << " <>"; - } else if (const GlobalVariable *GV = dyn_cast(Aliasee)) { - TypePrinter.print(GV->getType(), Out); - Out << ' '; - PrintLLVMName(Out, GV); - } else if (const Function *F = dyn_cast(Aliasee)) { - TypePrinter.print(F->getFunctionType(), Out); - Out << "* "; - - WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent()); - } else if (const GlobalAlias *GA = dyn_cast(Aliasee)) { - TypePrinter.print(GA->getType(), Out); - Out << ' '; - PrintLLVMName(Out, GA); - } else { - const ConstantExpr *CE = cast(Aliasee); - // The only valid GEP is an all zero GEP. - assert((CE->getOpcode() == Instruction::BitCast || - CE->getOpcode() == Instruction::GetElementPtr) && - "Unsupported aliasee"); - writeOperand(CE, false); - } + } else + writeOperand(Aliasee, !isa(Aliasee)); printInfoComment(*GA); Out << '\n';