Be able to determine if two types can be converted without requiring an Expr *.
The Expr::TypeConv() method has been replaced with both a CanConvertTypes() routine that indicates whether one type can be converted to another and a TypeConvertExpr() routine that provides the same functionality as Expr::TypeConv() used to.
This commit is contained in:
17
ctx.cpp
17
ctx.cpp
@@ -652,18 +652,19 @@ FunctionEmitContext::CurrentLanesReturned(Expr *expr, bool doCoherenceCheck) {
|
||||
}
|
||||
else {
|
||||
if (expr == NULL) {
|
||||
Error(funcStartPos,
|
||||
"Must provide return value for return statement for non-void function.");
|
||||
Error(funcStartPos, "Must provide return value for return "
|
||||
"statement for non-void function.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Use a masked store to store the value of the expression in the
|
||||
// return value memory; this preserves the return values from other
|
||||
// lanes that may have executed return statements previously.
|
||||
Expr *r = expr->TypeConv(returnType, "return statement");
|
||||
if (r != NULL) {
|
||||
llvm::Value *retVal = r->GetValue(this);
|
||||
expr = TypeConvertExpr(expr, returnType, "return statement");
|
||||
if (expr != NULL) {
|
||||
llvm::Value *retVal = expr->GetValue(this);
|
||||
if (retVal != NULL)
|
||||
// Use a masked store to store the value of the expression
|
||||
// in the return value memory; this preserves the return
|
||||
// values from other lanes that may have executed return
|
||||
// statements previously.
|
||||
StoreInst(retVal, returnValuePtr, GetInternalMask(), returnType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user