Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc warning in GetExprArity #1489

Merged
merged 2 commits into from
Jul 18, 2020
Merged

Fix gcc warning in GetExprArity #1489

merged 2 commits into from
Jul 18, 2020

Conversation

binji
Copy link
Member

@binji binji commented Jul 16, 2020

All enumeration values are handled in the switch, but it's still
possible to produce an invalid value, which would not return.

All enumeration values are handled in the switch, but it's still
possible to produce an invalid value, which would not return.
@binji binji requested a review from sbc100 July 16, 2020 23:04
src/ir-util.cc Outdated
@@ -260,4 +259,8 @@ ModuleContext::Arities ModuleContext::GetExprArity(const Expr& expr) const {
case ExprType::SimdShuffleOp:
return { 2, 1 };
}

fprintf(stderr, "bad expr type: %s\n", GetExprTypeName(expr));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it that this case is fully covered? In that case I would use something like LLVM_UNREACHABLE here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point.

@binji binji merged commit e58b367 into master Jul 18, 2020
@binji binji deleted the arities-warning branch July 18, 2020 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants