[cfe-commits] r90272 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Eli Friedman
eli.friedman at gmail.com
Tue Dec 1 14:31:52 PST 2009
Author: efriedma
Date: Tue Dec 1 16:31:51 2009
New Revision: 90272
URL: http://llvm.org/viewvc/llvm-project?rev=90272&view=rev
Log:
Make EmitStoreOfScalar generate a more sane representation of boolean stores.
"Fixes" PR5645.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=90272&r1=90271&r2=90272&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Dec 1 16:31:51 2009
@@ -330,13 +330,8 @@
if (Ty->isBooleanType()) {
// Bool can have different representation in memory than in registers.
- const llvm::Type *SrcTy = Value->getType();
const llvm::PointerType *DstPtr = cast<llvm::PointerType>(Addr->getType());
- if (DstPtr->getElementType() != SrcTy) {
- const llvm::Type *MemTy =
- llvm::PointerType::get(SrcTy, DstPtr->getAddressSpace());
- Addr = Builder.CreateBitCast(Addr, MemTy, "storetmp");
- }
+ Value = Builder.CreateIntCast(Value, DstPtr->getElementType(), false);
}
Builder.CreateStore(Value, Addr, Volatile);
}
More information about the cfe-commits
mailing list