diff options
author | serge-sans-paille <sguelton@mozilla.com> | 2022-12-04 09:33:14 +0100 |
---|---|---|
committer | serge-sans-paille <sguelton@mozilla.com> | 2022-12-08 10:28:56 +0100 |
commit | 6a35815c73ecce7e1dfd9f54535c7c17878a459a (patch) | |
tree | 0d4c19b6999dd16e0510d9c1401a0243712b834e /lld/MinGW | |
parent | 5b56b5524454883973de7e28547c76e71b95f972 (diff) | |
download | llvm-6a35815c73ecce7e1dfd9f54535c7c17878a459a.tar.gz |
Store OptTable::Info::Name as a StringRef
This is a recommit of 8ae18303f97d5dcfaecc90b4d87effb2011ed82e,
with a few cleanups.
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 (timing updated since original commit).
https://llvm-compile-time-tracker.com/compare.php?from=de4b6a1bc64db33643f001ad45fae7b92b4a4688&to=c23a93d1292052b4be2fbe8c586fa31143d0c7ed&stat=instructions:u
Differential Revision: https://reviews.llvm.org/D139274
Diffstat (limited to 'lld/MinGW')
-rw-r--r-- | lld/MinGW/Driver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index ded78ae391fa..cab2d0c97532 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -66,7 +66,7 @@ enum { #undef PREFIX // Create table mapping all options defined in Options.td -static const opt::OptTable::Info infoTable[] = { +static constexpr opt::OptTable::Info infoTable[] = { #define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, X8, X9, X10, X11, X12) \ {X1, X2, X10, X11, OPT_##ID, opt::Option::KIND##Class, \ X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12}, |