[cfe-commits] r41460 - /cfe/trunk/CodeGen/CGExprScalar.cpp
Chris Lattner
sabre at nondot.org
Sun Aug 26 14:41:21 PDT 2007
Author: lattner
Date: Sun Aug 26 16:41:21 2007
New Revision: 41460
URL: http://llvm.org/viewvc/llvm-project?rev=41460&view=rev
Log:
compound assignment operators are of type CompoundAssignOperator
Modified:
cfe/trunk/CodeGen/CGExprScalar.cpp
Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=41460&r1=41459&r2=41460&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Sun Aug 26 16:41:21 2007
@@ -188,16 +188,16 @@
}
BinOpInfo EmitBinOps(const BinaryOperator *E);
- Value *EmitCompoundAssign(const BinaryOperator *E,
+ Value *EmitCompoundAssign(const CompoundAssignOperator *E,
Value *(ScalarExprEmitter::*F)(const BinOpInfo &));
// Binary operators and binary compound assignment operators.
#define HANDLEBINOP(OP) \
- Value *VisitBin ## OP(const BinaryOperator *E) { \
- return Emit ## OP(EmitBinOps(E)); \
- } \
- Value *VisitBin ## OP ## Assign(const BinaryOperator *E) { \
- return EmitCompoundAssign(E, &ScalarExprEmitter::Emit ## OP); \
+ Value *VisitBin ## OP(const BinaryOperator *E) { \
+ return Emit ## OP(EmitBinOps(E)); \
+ } \
+ Value *VisitBin ## OP ## Assign(const CompoundAssignOperator *E) { \
+ return EmitCompoundAssign(E, &ScalarExprEmitter::Emit ## OP); \
}
HANDLEBINOP(Mul);
HANDLEBINOP(Div);
@@ -211,7 +211,7 @@
HANDLEBINOP(Or);
#undef HANDLEBINOP
Value *VisitBinSub(const BinaryOperator *E);
- Value *VisitBinSubAssign(const BinaryOperator *E) {
+ Value *VisitBinSubAssign(const CompoundAssignOperator *E) {
return EmitCompoundAssign(E, &ScalarExprEmitter::EmitSub);
}
@@ -545,7 +545,7 @@
return Result;
}
-Value *ScalarExprEmitter::EmitCompoundAssign(const BinaryOperator *E,
+Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E,
Value *(ScalarExprEmitter::*Func)(const BinOpInfo &)) {
QualType LHSTy = E->getLHS()->getType(), RHSTy = E->getRHS()->getType();
@@ -559,8 +559,7 @@
OpInfo.RHS = Visit(E->getRHS());
// Convert the LHS/RHS values to the computation type.
- const CompoundAssignOperator *CAO = cast<CompoundAssignOperator>(E);
- QualType ComputeType = CAO->getComputationType();
+ QualType ComputeType = E->getComputationType();
// FIXME: it's possible for the computation type to be complex if the RHS
// is complex. Handle this!
More information about the cfe-commits
mailing list