mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Simplify printAlias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4255274cf8
commit
8d948652f2
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user