[llvm-commits] [llvm] r98677 - /llvm/trunk/lib/VMCore/AsmWriter.cpp
Chris Lattner
sabre at nondot.org
Tue Mar 16 14:21:35 PDT 2010
Author: lattner
Date: Tue Mar 16 16:21:35 2010
New Revision: 98677
URL: http://llvm.org/viewvc/llvm-project?rev=98677&view=rev
Log:
add asmprinter suport for unions, fixing Feature/unions.ll to actually
be doing something useful.
Modified:
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=98677&r1=98676&r2=98677&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Mar 16 16:21:35 2010
@@ -1027,6 +1027,15 @@
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 &&
More information about the llvm-commits
mailing list