comparison gen/llvmhelpers.cpp @ 481:18480579dc04

Use llvmdc helpers for store and bitcast in fp80 padding init code.
author Christian Kamm <kamm incasoftware de>
date Tue, 05 Aug 2008 20:23:44 +0200
parents fc12214ba4a1
children aa8c050dfd19
comparison
equal deleted inserted replaced
480:fc12214ba4a1 481:18480579dc04
92 llvm::AllocaInst* DtoAlloca(const LLType* lltype, const std::string& name) 92 llvm::AllocaInst* DtoAlloca(const LLType* lltype, const std::string& name)
93 { 93 {
94 if(lltype == LLType::X86_FP80Ty) 94 if(lltype == LLType::X86_FP80Ty)
95 { 95 {
96 llvm::AllocaInst* alloca = new llvm::AllocaInst(lltype, name, gIR->topallocapoint()); 96 llvm::AllocaInst* alloca = new llvm::AllocaInst(lltype, name, gIR->topallocapoint());
97 LLValue* castv = new llvm::BitCastInst(alloca, getPtrToType(LLType::Int16Ty), "fp80toi16", gIR->scopebb()); 97 LLValue* castv = DtoBitCast(alloca, getPtrToType(LLType::Int16Ty), "fp80toi16");
98 LLValue* padding = DtoGEPi1(castv, 5, "fp80padding"); 98 LLValue* padding = DtoGEPi1(castv, 5, "fp80padding");
99 new llvm::StoreInst(llvm::Constant::getNullValue(LLType::Int16Ty), padding, gIR->scopebb()); 99 DtoStore(llvm::Constant::getNullValue(LLType::Int16Ty), padding);
100 100
101 return alloca; 101 return alloca;
102 } 102 }
103 103
104 return new llvm::AllocaInst(lltype, name, gIR->topallocapoint()); 104 return new llvm::AllocaInst(lltype, name, gIR->topallocapoint());