- Notifications
You must be signed in to change notification settings - Fork14.5k
early feedback commit#149579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
early feedback commit#149579
Conversation
"RHS of atomic update statement must be scalar"_err_en_US); | ||
"RHS of atomic %s statement must be scalar"_err_en_US, construct); | ||
} | ||
// TODO: Check if lhs is intrinsic type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
rhs
Do they have to be the same type?
constauto &rhs{std::get<parser::Expr>(assign.t)}; | ||
// Is the rhs something a valid operations that references the updatedVar? | ||
constauto expr{GetExpr(context_, rhs)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
const auto *
please, otherwise it makes me wonder whether you omitted a&
.
llvm::errs() <<"IsAtomicUpdateStmt: no expr\n"; | ||
returnnullptr; | ||
} | ||
constauto [op, args] =evaluate::GetTopLevelOperation(*expr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should there be braces here?
} | ||
constauto [op, args] =evaluate::GetTopLevelOperation(*expr); | ||
switch (op) { | ||
// 2909-2910 operator is one of +, *, -, /, .and., .or., .eqv., or .neqv.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what aboutintegervar = integervar * 2.5
? the top-level operator will be a conversion here. maybe check that the rhs type is the same as the lhs type.
if (!varExpr || !updatedVarExpr || !exprExpr) { | ||
returnfalse; | ||
} | ||
return updatedVarExpr == exprExpr && !(updatedVarExpr == varExpr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
you probably want to compare pointees rather than pointers
WIP Just posting for early feedback