-
Notifications
You must be signed in to change notification settings - Fork 15.4k
RuntimeLibcalls: Fix missing const on getLibcallNames #143074
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
RuntimeLibcalls: Fix missing const on getLibcallNames #143074
Conversation
|
@llvm/pr-subscribers-llvm-ir Author: Matt Arsenault (arsenm) ChangesThis is made simpler by just returning the array ref instead of Full diff: https://github.com/llvm/llvm-project/pull/143074.diff 1 Files Affected:
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 26c085031a48a..a16c317fd8d41 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -68,10 +68,7 @@ struct RuntimeLibcallsInfo {
return LibcallCallingConvs[Call];
}
- iterator_range<const char **> getLibcallNames() {
- return llvm::make_range(LibcallRoutineNames,
- LibcallRoutineNames + RTLIB::UNKNOWN_LIBCALL);
- }
+ ArrayRef<const char *> getLibcallNames() const { return LibcallRoutineNames; }
private:
/// Stores the name each libcall.
|
| return llvm::make_range(LibcallRoutineNames, | ||
| LibcallRoutineNames + RTLIB::UNKNOWN_LIBCALL); | ||
| } | ||
| ArrayRef<const char *> getLibcallNames() const { return LibcallRoutineNames; } |
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.
If I'm reading this right, this is now going to include the entry for UNKNOWN_LIBCALL as well. Is that intentional?
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.
Not intentional, but it also doesn't really matter. Could drop_back, but it just appears as another null entry which uses have to tolerate anyway
nikic
left a comment
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
This is made simpler by just returning the array ref instead of the fancy range.
f57d03b to
16b0b3e
Compare
This is made simpler by just returning the array ref instead of the fancy range.

This is made simpler by just returning the array ref instead of
the fancy range.