[cfe-commits] r45394 - /cfe/trunk/CodeGen/CGExpr.cpp
Christopher Lamb
christopher.lamb at gmail.com
Fri Dec 28 20:06:58 PST 2007
Author: clamb
Date: Fri Dec 28 22:06:57 2007
New Revision: 45394
URL: http://llvm.org/viewvc/llvm-project?rev=45394&view=rev
Log:
Make MemberExpr code safe w.r.t. address spaces.
Modified:
cfe/trunk/CodeGen/CGExpr.cpp
Modified: cfe/trunk/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExpr.cpp?rev=45394&r1=45393&r2=45394&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExpr.cpp Fri Dec 28 22:06:57 2007
@@ -424,9 +424,9 @@
const llvm::PointerType * BaseTy =
cast<llvm::PointerType>(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");
}
}
More information about the cfe-commits
mailing list