[llvm] [NFC][Support] Create helper function to parse bool. (PR #102818)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 09:58:15 PDT 2024
================
@@ -404,6 +404,22 @@ class CommandLineParser {
static ManagedStatic<CommandLineParser> GlobalParser;
+template <typename T, T TrueVal, T FalseVal>
+static bool parseBool(Option &O, StringRef ArgName, StringRef Arg, T &Value) {
+ if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" ||
----------------
jurahul wrote:
But that would match more than what the code current matches. For example, tRue or TrUE.
https://github.com/llvm/llvm-project/pull/102818
More information about the llvm-commits
mailing list