alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

A couple of nits, otherwise looks good. Do you need me to commit the patch for 
you?



================
Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:169
         .Case("camel_Snake_Back", CT_CamelSnakeBack)
-        .Default(CT_AnyCase);
+        .Default(llvm::Optional<CaseType>());
   };
----------------
`llvm::None` is more idiomatic.


================
Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:181
+    } else {
+      NamingStyles.push_back(llvm::Optional<NamingStyle>());
+    }
----------------
`llvm::None` here as well.


================
Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:211
   for (size_t i = 0; i < SK_Count; ++i) {
-    Options.store(Opts, (StyleNames[i] + "Case").str(),
-                  toString(NamingStyles[i].Case));
-    Options.store(Opts, (StyleNames[i] + "Prefix").str(),
-                  NamingStyles[i].Prefix);
-    Options.store(Opts, (StyleNames[i] + "Suffix").str(),
-                  NamingStyles[i].Suffix);
+    if (NamingStyles[i].hasValue()) {
+      if (NamingStyles[i]->Case.hasValue()) {
----------------
`.hasValue()` can be omitted, since `llvm::Optional<>` defines `operator bool` 
and `operator *`, and thus can be used in a similar fashion as a pointer / 
smart pointer: `if (opt) DoSomething(*opt);`.


https://reviews.llvm.org/D30931



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to