diff options
author | Christopher Lamb <christopher.lamb@gmail.com> | 2007-12-17 01:11:20 +0000 |
---|---|---|
committer | Christopher Lamb <christopher.lamb@gmail.com> | 2007-12-17 01:11:20 +0000 |
commit | ddc23f3e6fdc4f83dd46ef7e20394cfbd6063ff9 (patch) | |
tree | cee65d95e889d0563363a0ad444eb26e9a9912ff /CodeGen/CGExpr.cpp | |
parent | cc8b7f911892b3257e381677d0a82d43bf7b067c (diff) |
Update to use new PointerType::getUnqual() api.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CGExpr.cpp')
-rw-r--r-- | CodeGen/CGExpr.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index ab5d05969e..8d136bc0b4 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -83,7 +83,7 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) { switch (E->getStmtClass()) { default: { WarnUnsupported(E, "l-value expression"); - llvm::Type *Ty = llvm::PointerType::get(ConvertType(E->getType())); + llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType())); return LValue::MakeAddr(llvm::UndefValue::get(Ty)); } @@ -220,11 +220,13 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst, assert(Src.isScalar() && "Can't emit an agg store with this method"); // FIXME: Handle volatility etc. const llvm::Type *SrcTy = Src.getScalarVal()->getType(); - const llvm::Type *AddrTy = - cast<llvm::PointerType>(DstAddr->getType())->getElementType(); + const llvm::PointerType *DstPtr = cast<llvm::PointerType>(DstAddr->getType()); + const llvm::Type *AddrTy = DstPtr->getElementType(); + unsigned AS = DstPtr->getAddressSpace(); if (AddrTy != SrcTy) - DstAddr = Builder.CreateBitCast(DstAddr, llvm::PointerType::get(SrcTy), + DstAddr = Builder.CreateBitCast(DstAddr, + llvm::PointerType::get(SrcTy, AS), "storetmp"); Builder.CreateStore(Src.getScalarVal(), DstAddr); } @@ -422,7 +424,10 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { const llvm::PointerType * BaseTy = cast<llvm::PointerType>(BaseValue->getType()); if (FieldTy != BaseTy->getElementType()) { - V = Builder.CreateBitCast(V, llvm::PointerType::get(FieldTy), "tmp"); + // FIXME: Need to get address space qualification of pointer + V = Builder.CreateBitCast(V, + llvm::PointerType::getUnqual(FieldTy), + "tmp"); } } return LValue::MakeAddr(V); |