diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-16 21:21:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-16 21:21:35 +0000 |
commit | b981fcf2d846f02feb2f89b033de22be118c33ff (patch) | |
tree | f6d5d1c117ee8d006e36cbd374a0e0e42bced17b /llvm/lib/VMCore/AsmWriter.cpp | |
parent | 1832cdb2d3b1a4d950bb926f528a98ce2815029e (diff) | |
download | bcm5719-llvm-b981fcf2d846f02feb2f89b033de22be118c33ff.tar.gz bcm5719-llvm-b981fcf2d846f02feb2f89b033de22be118c33ff.zip |
add asmprinter suport for unions, fixing Feature/unions.ll to actually
be doing something useful.
llvm-svn: 98677
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index fd742413abf..0eb9f020dc9 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -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 && |