[llvm] [NFC][Support] Create helper function to parse bool. (PR #102818)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 11 14:32:41 PDT 2024


================
@@ -400,6 +400,22 @@ class CommandLineParser {
   SubCommand *LookupSubCommand(StringRef Name, std::string &NearestString);
 };
 
+template <typename T, T TrueVal, T FalseVal>
+bool parseBool(Option &O, StringRef ArgName, StringRef Arg, T &Value) {
----------------
MaskRay wrote:

move the function outside of the unnamed namespace and add `static` per https://llvm.org/docs/CodingStandards.html#anonymous-namespaces

The majority of commits omit the trailing full stop in the subject line.

https://github.com/llvm/llvm-project/pull/102818


More information about the llvm-commits mailing list