llvm::Type *Ty = VMContext.getPointerTypeUnqual(ConvertType(E->getType()));
return LValue::MakeAddr(VMContext.getUndef(Ty),
E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
/// EmitLValue - Emit code to compute a designator that specifies the location
if (VD->getType()->isReferenceType())
V = Builder.CreateLoad(V, "tmp");
LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
else {
llvm::Value *V = LocalDeclMap[VD];
}
if (VD->getType()->isReferenceType())
V = Builder.CreateLoad(V, "tmp");
- LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(), attr);
+ LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(), attr,
+ E->getType().getAddressSpace());
}
LValue::SetObjCNonGC(LV, NonGCable);
return LV;
if (VD->getType()->isReferenceType())
V = Builder.CreateLoad(V, "tmp");
LValue LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
if (LV.isObjCStrong())
LV.SetGlobalObjCRef(LV, true);
return LV;
}
}
return LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
else if (const ImplicitParamDecl *IPD =
dyn_cast<ImplicitParamDecl>(E->getDecl())) {
llvm::Value *V = LocalDeclMap[IPD];
assert(V && "BlockVarDecl not entered in LocalDeclMap?");
return LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
assert(0 && "Unimp declref");
//an invalid LValue, but the assert will
LValue CodeGenFunction::EmitBlockDeclRefLValue(const BlockDeclRefExpr *E) {
return LValue::MakeAddr(GetAddrOfBlockDecl(E),
E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) {
LValue LV = LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()),
T.getCVRQualifiers(),
- getContext().getObjCGCAttrKind(T));
+ getContext().getObjCGCAttrKind(T),
+ ExprTy.getAddressSpace());
// We should not generate __weak write barrier on indirect reference
// of a pointer to object; as in void foo (__weak id *param); *param = 0;
// But, we continue to generate __strong write barrier on indirect write
unsigned Idx = E->getOpcode() == UnaryOperator::Imag;
return LValue::MakeAddr(Builder.CreateStructGEP(LV.getAddress(),
Idx, "idx"),
- ExprTy.getCVRQualifiers());
+ ExprTy.getCVRQualifiers(),
+ QualType::GCNone,
+ ExprTy.getAddressSpace());
}
}
LValue LV = LValue::MakeAddr(Address,
T.getCVRQualifiers(),
- getContext().getObjCGCAttrKind(T));
+ getContext().getObjCGCAttrKind(T),
+ E->getBase()->getType().getAddressSpace());
if (getContext().getLangOptions().ObjC1 &&
getContext().getLangOptions().getGCMode() != LangOptions::NonGC)
LValue::SetObjCNonGC(LV, !E->isOBJCGCCandidate(getContext()));
} else {
const PointerType *PT = E->getBase()->getType()->getAsPointerType();
llvm::Value *Ptr = EmitScalarExpr(E->getBase());
- Base = LValue::MakeAddr(Ptr, PT->getPointeeType().getCVRQualifiers());
+ Base = LValue::MakeAddr(Ptr, PT->getPointeeType().getCVRQualifiers(),
+ QualType::GCNone,
+ PT->getPointeeType().getAddressSpace());
}
// Encode the element access list into a vector of unsigned indices.
LValue LV =
LValue::MakeAddr(V,
Field->getType().getCVRQualifiers()|CVRQualifiers,
- attr);
+ attr,
+ Field->getType().getAddressSpace());
return LV;
}
llvm::Value *DeclPtr = CreateTempAlloca(LTy, ".compoundliteral");
const Expr* InitExpr = E->getInitializer();
- LValue Result = LValue::MakeAddr(DeclPtr, E->getType().getCVRQualifiers());
+ LValue Result = LValue::MakeAddr(DeclPtr, E->getType().getCVRQualifiers(),
+ QualType::GCNone,
+ E->getType().getAddressSpace());
if (E->getType()->isComplexType()) {
EmitComplexExprIntoAddr(InitExpr, DeclPtr, false);
EmitAggExpr(E, Temp, false);
return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
EmitAnyExpr(E->getSubExpr(), Temp, false);
return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
//===--------------------------------------------------------------------===//
EmitAggExpr(E, Temp, false);
// FIXME: Are these qualifiers correct?
return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
LValue CodeGenFunction::EmitCallExprLValue(const CallExpr *E) {
"reference type!");
return LValue::MakeAddr(RV.getScalarVal(), E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
return LValue::MakeAddr(RV.getAggregateAddr(),
E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
LValue CodeGenFunction::EmitVAArgExprLValue(const VAArgExpr *E) {
// FIXME: This shouldn't require another copy.
llvm::Value *Temp = CreateTempAlloca(ConvertType(E->getType()));
EmitAggExpr(E, Temp, false);
- return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers());
+ return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers(),
+ QualType::GCNone, E->getType().getAddressSpace());
}
LValue
LValue CodeGenFunction::EmitCXXConstructLValue(const CXXConstructExpr *E) {
llvm::Value *Temp = CreateTempAlloca(ConvertTypeForMem(E->getType()), "tmp");
EmitCXXConstructExpr(Temp, E);
- return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers());
+ return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers(),
+ QualType::GCNone, E->getType().getAddressSpace());
}
LValue
// FIXME: can this be volatile?
return LValue::MakeAddr(RV.getAggregateAddr(),
E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}
llvm::Value *CodeGenFunction::EmitIvarOffset(const ObjCInterfaceDecl *Interface,
// FIXME: can this be volatile?
return LValue::MakeAddr(RV.getAggregateAddr(),
E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ getContext().getObjCGCAttrKind(E->getType()),
+ E->getType().getAddressSpace());
}