summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-08-01 12:29:14 +0000
committerJay Foad <jay.foad@gmail.com>2011-08-01 12:29:14 +0000
commit26db79d236843d37cd1a7b601d2da42233c3c17c (patch)
tree3b91178a293ec5ae8ebdb01c2ac3628a1ab8a856 /llvm/lib
parent7f4cd9e678e6bc16aff4eb87e2d4916c9b2158fb (diff)
downloadbcm5719-llvm-26db79d236843d37cd1a7b601d2da42233c3c17c.tar.gz
bcm5719-llvm-26db79d236843d37cd1a7b601d2da42233c3c17c.zip
Simplify printAlias.
llvm-svn: 136611
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 825a7c1b66f..de993eec69f 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -1397,27 +1397,8 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) {
if (Aliasee == 0) {
TypePrinter.print(GA->getType(), Out);
Out << " <<NULL ALIASEE>>";
- } else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Aliasee)) {
- TypePrinter.print(GV->getType(), Out);
- Out << ' ';
- PrintLLVMName(Out, GV);
- } else if (const Function *F = dyn_cast<Function>(Aliasee)) {
- TypePrinter.print(F->getFunctionType(), Out);
- Out << "* ";
-
- WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent());
- } else if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Aliasee)) {
- TypePrinter.print(GA->getType(), Out);
- Out << ' ';
- PrintLLVMName(Out, GA);
- } else {
- const ConstantExpr *CE = cast<ConstantExpr>(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<ConstantExpr>(Aliasee));
printInfoComment(*GA);
Out << '\n';
OpenPOWER on IntegriCloud