-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[RISCV] Simplify interface of RISCVAsmPrinter::lowerToMCInst [nfc] #156482
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
Conversation
The only case which returns true is just pypassing this routine for custom logic. Given the caller *already* has to special case this to even fall into this routine, let's just put the logic in one place. Note that the code had a guard for a malformed attribute which is unreachable, and was converted into an assert. The verifier enforces that the function attribute is well formed if present.
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.
LGTM, one nit (typo)
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.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/23566 Here is the relevant piece of the build log for the reference
|
.getValueAsString() | ||
.getAsInteger(10, Num); |
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.
for future reference: I believe we can also use Function::getFnAttributeAsParsedInteger
here (it'll use a default value if the string is not an integer, but if we set the default value to zero we can streamline the logics here)
The only case which returns true is just pypassing this routine for custom logic. Given the caller already has to special case this to even fall into this routine, let's just put the logic in one place.
Note that the code had a guard for a malformed attribute which is unreachable, and was converted into an assert. The verifier enforces that the function attribute is well formed if present.