diff options
author | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
commit | 55f1c09e31cfc6744fb682e17a2a1a00d914694c (patch) | |
tree | e753e20c7186dc8138bef58089274bb5162a7cef /llvm/lib/CodeGen/ELFWriter.cpp | |
parent | 41a750271b72216801366693bd0f41672892c487 (diff) | |
download | llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.zip llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.tar.gz llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.tar.bz2 |
Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
Diffstat (limited to 'llvm/lib/CodeGen/ELFWriter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ELFWriter.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp index 1518a34..e62079f 100644 --- a/llvm/lib/CodeGen/ELFWriter.cpp +++ b/llvm/lib/CodeGen/ELFWriter.cpp @@ -440,15 +440,16 @@ void ELFWriter::EmitGlobalConstant(const Constant *CV, ELFSection &GblS) { return; } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) { APInt Val = CFP->getValueAPF().bitcastToAPInt(); - if (CFP->getType() == Type::DoubleTy) + if (CFP->getType() == Type::getDoubleTy(CV->getContext())) GblS.emitWord64(Val.getZExtValue()); - else if (CFP->getType() == Type::FloatTy) + else if (CFP->getType() == Type::getFloatTy(CV->getContext())) GblS.emitWord32(Val.getZExtValue()); - else if (CFP->getType() == Type::X86_FP80Ty) { - unsigned PadSize = TD->getTypeAllocSize(Type::X86_FP80Ty)- - TD->getTypeStoreSize(Type::X86_FP80Ty); + else if (CFP->getType() == Type::getX86_FP80Ty(CV->getContext())) { + unsigned PadSize = + TD->getTypeAllocSize(Type::getX86_FP80Ty(CV->getContext()))- + TD->getTypeStoreSize(Type::getX86_FP80Ty(CV->getContext())); GblS.emitWordFP80(Val.getRawData(), PadSize); - } else if (CFP->getType() == Type::PPC_FP128Ty) + } else if (CFP->getType() == Type::getPPC_FP128Ty(CV->getContext())) llvm_unreachable("PPC_FP128Ty global emission not implemented"); return; } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) { @@ -526,7 +527,8 @@ CstExprResTy ELFWriter::ResolveConstantExpr(const Constant *CV) { } case Instruction::IntToPtr: { Constant *Op = CE->getOperand(0); - Op = ConstantExpr::getIntegerCast(Op, TD->getIntPtrType(), false/*ZExt*/); + Op = ConstantExpr::getIntegerCast(Op, TD->getIntPtrType(CV->getContext()), + false/*ZExt*/); return ResolveConstantExpr(Op); } case Instruction::PtrToInt: { |