summaryrefslogtreecommitdiff
path: root/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-04-28 13:45:00 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-04-28 13:45:00 +0000
commita80e1181b78183dc36ec6568559d38faa86981f0 (patch)
tree88ca9bd2f28f363e50add28297f6220ac8e09fc1 /lib/VMCore/AsmWriter.cpp
parent44b2c5098f5cf766b4eff43d9eb0d8a9a143e7d8 (diff)
downloadllvm-a80e1181b78183dc36ec6568559d38faa86981f0.tar.gz
llvm-a80e1181b78183dc36ec6568559d38faa86981f0.tar.bz2
llvm-a80e1181b78183dc36ec6568559d38faa86981f0.tar.xz
Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 8834e1e2a2..656a7bed74 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -926,7 +926,7 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) {
assert(0 && "Invalid alias linkage");
}
- const GlobalValue *Aliasee = GA->getAliasee();
+ const Constant *Aliasee = dyn_cast_or_null<Constant>(GA->getAliasee());
assert(Aliasee && "Aliasee cannot be null");
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Aliasee)) {
@@ -940,9 +940,15 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) {
Out << getLLVMName(F->getName(), GlobalPrefix);
else
Out << "@\"\"";
- } else
- assert(0 && "Unsupported aliasee");
-
+ } else {
+ const ConstantExpr *CE = 0;
+ if ((CE = dyn_cast<ConstantExpr>(Aliasee)) &&
+ (CE->getOpcode() == Instruction::BitCast)) {
+ writeOperand(CE, false);
+ } else
+ assert(0 && "Unsupported aliasee");
+ }
+
printInfoComment(*GA);
Out << "\n";
}