@@ -77,17 +77,15 @@ struct RuntimeLibcallsInfo {
7777
7878 // / Get the libcall routine name for the specified libcall.
7979 // 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 {
8181 return getLibcallImplName (LibcallImpls[Call]);
8282 }
8383
8484 // / 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) {
8786 if (CallImpl == RTLIB::Unsupported)
88- return nullptr ;
89- return RuntimeLibcallImplNameTable[RuntimeLibcallNameOffsetTable[CallImpl]]
90- .data ();
87+ return StringRef ();
88+ return RuntimeLibcallImplNameTable[RuntimeLibcallNameOffsetTable[CallImpl]];
9189 }
9290
9391 // / Return the lowering's selection of implementation call for \p Call
@@ -119,9 +117,10 @@ struct RuntimeLibcallsInfo {
119117
120118 // / Return a function name compatible with RTLIB::MEMCPY, or nullptr if fully
121119 // / 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);
125124
126125 // Fallback to memmove if memcpy isn't available.
127126 return getLibcallName (RTLIB::MEMMOVE);
0 commit comments