Store OptTable::Info::Name as a StringRef
authorserge-sans-paille <sguelton@mozilla.com>
Sun, 4 Dec 2022 08:33:14 +0000 (09:33 +0100)
committerserge-sans-paille <sguelton@mozilla.com>
Tue, 6 Dec 2022 13:10:07 +0000 (14:10 +0100)
commit8ae18303f97d5dcfaecc90b4d87effb2011ed82e
tree179cec4fe3a1c68869b1c38b522630edc4d2417e
parentba5c26da7ce85dbdcee3d964282e5f0981792702
Store OptTable::Info::Name as a StringRef

This avoids implicit conversion to StringRef at several points, which in
turns avoid redundant calls to strlen.

As a side effect, this greatly simplifies the implementation of
StrCmpOptionNameIgnoreCase.

It also eventually gives a consistent, humble speedup in compilation
time.

https://llvm-compile-time-tracker.com/compare.php?from=5f5b942823474e98e43a27d515a87ce140396c53&to=60e13b778119fc32d50dc38ff1a564a87146e9c6&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D139274
clang/lib/Driver/ToolChains/Gnu.cpp
llvm/include/llvm/Option/OptTable.h
llvm/lib/Option/OptTable.cpp
llvm/unittests/Option/OptionMarshallingTest.cpp
llvm/utils/TableGen/OptParserEmitter.cpp