[cfe-commits] r146920 - in /cfe/trunk/lib/CodeGen: CGExprScalar.cpp CGObjCRuntime.cpp
Eli Friedman
eli.friedman at gmail.com
Mon Dec 19 15:03:09 PST 2011
Author: efriedma
Date: Mon Dec 19 17:03:09 2011
New Revision: 146920
URL: http://llvm.org/viewvc/llvm-project?rev=146920&view=rev
Log:
Switch a few callers of MakeAddrLValue places over to MakeNaturalAlignAddrLValue.
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
cfe/trunk/lib/CodeGen/CGObjCRuntime.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=146920&r1=146919&r2=146920&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Mon Dec 19 17:03:09 2011
@@ -1054,7 +1054,7 @@
Value *V = EmitLValue(E).getAddress();
V = Builder.CreateBitCast(V,
ConvertType(CGF.getContext().getPointerType(DestTy)));
- return EmitLoadOfLValue(CGF.MakeAddrLValue(V, DestTy));
+ return EmitLoadOfLValue(CGF.MakeNaturalAlignAddrLValue(V, DestTy));
}
case CK_CPointerToObjCPointerCast:
@@ -2740,11 +2740,11 @@
Expr *BaseExpr = E->getBase();
if (BaseExpr->isRValue()) {
- V = CreateTempAlloca(ClassPtrTy, "resval");
+ V = CreateMemTemp(E->getType(), "resval");
llvm::Value *Src = EmitScalarExpr(BaseExpr);
Builder.CreateStore(Src, V);
V = ScalarExprEmitter(*this).EmitLoadOfLValue(
- MakeAddrLValue(V, E->getType()));
+ MakeNaturalAlignAddrLValue(V, E->getType()));
} else {
if (E->isArrow())
V = ScalarExprEmitter(*this).EmitLoadOfLValue(BaseExpr);
@@ -2755,7 +2755,7 @@
// build Class* type
ClassPtrTy = ClassPtrTy->getPointerTo();
V = Builder.CreateBitCast(V, ClassPtrTy);
- return MakeAddrLValue(V, E->getType());
+ return MakeNaturalAlignAddrLValue(V, E->getType());
}
Modified: cfe/trunk/lib/CodeGen/CGObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCRuntime.cpp?rev=146920&r1=146919&r2=146920&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCRuntime.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCRuntime.cpp Mon Dec 19 17:03:09 2011
@@ -93,7 +93,7 @@
V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
if (!Ivar->isBitField()) {
- LValue LV = CGF.MakeAddrLValue(V, IvarTy);
+ LValue LV = CGF.MakeNaturalAlignAddrLValue(V, IvarTy);
LV.getQuals().addCVRQualifiers(CVRQualifiers);
return LV;
}
More information about the cfe-commits
mailing list