[PATCH] D139274: Store OptTable::Info::Name as a StringRef

Nikita Popov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 00:53:15 PST 2022


nikic added inline comments.


================
Comment at: llvm/lib/Option/OptTable.cpp:44
     if (a == '\0')
       return 0;
 
----------------
The code in this function (and also StrCmpOptionName) depends on the terminating null byte, while a StringRef is not guaranteed to by directly followed by one. I think these two functions would have to be adjusted to operate on StringRef rather than pointers as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139274/new/

https://reviews.llvm.org/D139274



More information about the cfe-commits mailing list