1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

add asmprinter suport for unions, fixing Feature/unions.ll to actually

be doing something useful.

llvm-svn: 98677
This commit is contained in:
Chris Lattner 2010-03-16 21:21:35 +00:00
parent 16c77b14f2
commit b51960824f

View File

@ -1027,6 +1027,15 @@ static void WriteConstantInt(raw_ostream &Out, const Constant *CV,
return;
}
if (const ConstantUnion *CU = dyn_cast<ConstantUnion>(CV)) {
Out << "{ ";
TypePrinter.print(CU->getOperand(0)->getType(), Out);
Out << ' ';
WriteAsOperandInternal(Out, CU->getOperand(0), &TypePrinter, Machine);
Out << " }";
return;
}
if (const ConstantVector *CP = dyn_cast<ConstantVector>(CV)) {
const Type *ETy = CP->getType()->getElementType();
assert(CP->getNumOperands() > 0 &&