@@ -77,17 +77,15 @@ struct RuntimeLibcallsInfo {
77
77
78
78
// / Get the libcall routine name for the specified libcall.
79
79
// FIXME: This should be removed. Only LibcallImpl should have a name.
80
- const char * getLibcallName (RTLIB::Libcall Call) const {
80
+ StringRef getLibcallName (RTLIB::Libcall Call) const {
81
81
return getLibcallImplName (LibcallImpls[Call]);
82
82
}
83
83
84
84
// / Get the libcall routine name for the specified libcall implementation.
85
- // FIXME: Change to return StringRef
86
- static const char *getLibcallImplName (RTLIB::LibcallImpl CallImpl) {
85
+ static StringRef getLibcallImplName (RTLIB::LibcallImpl CallImpl) {
87
86
if (CallImpl == RTLIB::Unsupported)
88
- return nullptr ;
89
- return RuntimeLibcallImplNameTable[RuntimeLibcallNameOffsetTable[CallImpl]]
90
- .data ();
87
+ return StringRef ();
88
+ return RuntimeLibcallImplNameTable[RuntimeLibcallNameOffsetTable[CallImpl]];
91
89
}
92
90
93
91
// / Return the lowering's selection of implementation call for \p Call
@@ -119,9 +117,10 @@ struct RuntimeLibcallsInfo {
119
117
120
118
// / Return a function name compatible with RTLIB::MEMCPY, or nullptr if fully
121
119
// / unsupported.
122
- const char *getMemcpyName () const {
123
- if (const char *Memcpy = getLibcallName (RTLIB::MEMCPY))
124
- return Memcpy;
120
+ StringRef getMemcpyName () const {
121
+ RTLIB::LibcallImpl Memcpy = getLibcallImpl (RTLIB::MEMCPY);
122
+ if (Memcpy != RTLIB::Unsupported)
123
+ return getLibcallImplName (Memcpy);
125
124
126
125
// Fallback to memmove if memcpy isn't available.
127
126
return getLibcallName (RTLIB::MEMMOVE);
0 commit comments