From d3ba3f44ad3fc79f31ebbbe15a7a7f4a34226254 Mon Sep 17 00:00:00 2001 From: Christopher Lamb Date: Sat, 29 Dec 2007 04:06:57 +0000 Subject: [PATCH] Make MemberExpr code safe w.r.t. address spaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45394 91177308-0d34-0410-b5e6-96231b3b80d8 --- CodeGen/CGExpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index c20680bc4e..4cb897fe5d 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -424,9 +424,9 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { const llvm::PointerType * BaseTy = cast(BaseValue->getType()); if (FieldTy != BaseTy->getElementType()) { - // FIXME: Need to get address space qualification of pointer + unsigned AS = BaseTy->getAddressSpace(); V = Builder.CreateBitCast(V, - llvm::PointerType::getUnqual(FieldTy), + llvm::PointerType::get(FieldTy, AS), "tmp"); } } -- 2.40.0