aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-12-16 02:57:00 +0000
committerMike Stump <mrs@apple.com>2009-12-16 02:57:00 +0000
commitb14e62d5aee7522b98c410ee65bd750c2cfe6f01 (patch)
tree3cb0a601613d390bb950797e77a16b909f73ef1a /lib/CodeGen/CGExprScalar.cpp
parent5ee56e95c3905d2e7bc403631b03865cdbdd8a42 (diff)
Implement additional undefined checks for additional loads and stores. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 2f31c051a7..07909faa75 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -69,6 +69,7 @@ public:
const llvm::Type *ConvertType(QualType T) { return CGF.ConvertType(T); }
LValue EmitLValue(const Expr *E) { return CGF.EmitLValue(E); }
+ LValue EmitCheckedLValue(const Expr *E) { return CGF.EmitCheckedLValue(E); }
Value *EmitLoadOfLValue(LValue LV, QualType T) {
return CGF.EmitLoadOfLValue(LV, T).getScalarVal();
@@ -78,7 +79,7 @@ public:
/// value l-value, this method emits the address of the l-value, then loads
/// and returns the result.
Value *EmitLoadOfLValue(const Expr *E) {
- return EmitLoadOfLValue(EmitLValue(E), E->getType());
+ return EmitLoadOfLValue(EmitCheckedLValue(E), E->getType());
}
/// EmitConversionToBool - Convert the specified expression value to a
@@ -1217,7 +1218,7 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E,
OpInfo.Ty = E->getComputationResultType();
OpInfo.E = E;
// Load/convert the LHS.
- LValue LHSLV = EmitLValue(E->getLHS());
+ LValue LHSLV = EmitCheckedLValue(E->getLHS());
OpInfo.LHS = EmitLoadOfLValue(LHSLV, LHSTy);
OpInfo.LHS = EmitScalarConversion(OpInfo.LHS, LHSTy,
E->getComputationLHSType());
@@ -1654,7 +1655,7 @@ Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) {
// __block variables need to have the rhs evaluated first, plus this should
// improve codegen just a little.
Value *RHS = Visit(E->getRHS());
- LValue LHS = EmitLValue(E->getLHS());
+ LValue LHS = EmitCheckedLValue(E->getLHS());
// Store the value into the LHS. Bit-fields are handled specially
// because the result is altered by the store, i.e., [C99 6.5.16p1]