if (Ty->isConstantSizeType()) {
if (!Target.useGlobalsForAutomaticVariables()) {
// A normal fixed sized variable becomes an alloca in the entry block.
- const llvm::Type *LTy = ConvertType(Ty);
+ const llvm::Type *LTy = ConvertTypeForMem(Ty);
if (isByRef)
LTy = BuildByRefType(Ty, getContext().getDeclAlignInBytes(&D));
llvm::AllocaInst *Alloc =
}
// Get the element type.
- const llvm::Type *LElemTy = ConvertType(Ty);
+ const llvm::Type *LElemTy = ConvertTypeForMem(Ty);
const llvm::Type *LElemPtrTy =
llvm::PointerType::get(LElemTy, D.getType().getAddressSpace());
}
if (!hasAggregateLLVMType(Init->getType())) {
llvm::Value *V = EmitScalarExpr(Init);
- Builder.CreateStore(V, Loc, D.getType().isVolatileQualified());
+ EmitStoreOfScalar(V, Loc, D.getType().isVolatileQualified());
} else if (Init->getType()->isAnyComplexType()) {
EmitComplexExprIntoAddr(Init, Loc, D.getType().isVolatileQualified());
} else {
llvm::GlobalValue::ExternalLinkage);
} else {
// A fixed sized single-value variable becomes an alloca in the entry block.
- const llvm::Type *LTy = ConvertType(Ty);
+ const llvm::Type *LTy = ConvertTypeForMem(Ty);
if (LTy->isSingleValueType()) {
// TODO: Alignment
std::string Name = D.getNameAsString();
DeclPtr = CreateTempAlloca(LTy, Name.c_str());
// Store the initial value into the alloca.
- Builder.CreateStore(Arg, DeclPtr,Ty.isVolatileQualified());
+ EmitStoreOfScalar(Arg, DeclPtr, Ty.isVolatileQualified());
} else {
// Otherwise, if this is an aggregate, just use the input pointer.
DeclPtr = Arg;