Merge branch 'master' into nvptx

This commit is contained in:
egaburov
2013-11-08 15:42:58 +01:00
8 changed files with 250 additions and 179 deletions

View File

@@ -2798,6 +2798,17 @@ BinaryExpr::TypeCheck() {
}
}
const Type *
BinaryExpr::GetLValueType() const {
const Type *t = GetType();
if (CastType<PointerType>(t) != NULL) {
// Are we doing something like (basePtr + offset)[...] = ...
return t;
}
else {
return NULL;
}
}
int
BinaryExpr::EstimateCost() const {
@@ -4275,8 +4286,9 @@ IndexExpr::GetValue(FunctionEmitContext *ctx) const {
}
else {
Symbol *baseSym = GetBaseSymbol();
if (dynamic_cast<FunctionCallExpr *>(baseExpr) == NULL) {
// Only check for non-function calls
if (dynamic_cast<FunctionCallExpr *>(baseExpr) == NULL &&
dynamic_cast<BinaryExpr *>(baseExpr) == NULL) {
// Don't check if we're doing a function call or pointer arith
AssertPos(pos, baseSym != NULL);
}
mask = lMaskForSymbol(baseSym, ctx);